Backend Documentation
Comprehensive technical documentation for the DeepSkill platform backend, including the API reference and internal systems documentation.
📚 What's Included
API Reference
Complete OpenAPI documentation for the Strapi backend API with all 64 endpoints.
- Interactive Documentation - Browse all endpoints with Redoc
- Authentication Guide - JWT token-based authentication
- Request/Response Examples - Code samples in multiple languages
- Schema Definitions - Detailed data models
Internal Systems
Documentation for backend systems, automated jobs, and technical implementations.
Cron Jobs
Scheduled jobs that automate platform processes:
- Coach attendance checking
- Module reminders
- Batch lifecycle management
- Data synchronization
- Analytics generation
View Cron Jobs Documentation →
Strapi Extensions
Custom Strapi extensions and plugins:
- Custom routes and controllers
- Service layer implementations
- Database query optimizations
- Email template system
- Error handling and logging
🏗️ Architecture Overview
Technology Stack
- Runtime: Node.js 20.x
- Framework: Strapi 4.x (Headless CMS)
- Database: PostgreSQL
- Authentication: JWT (JSON Web Tokens)
- API Style: RESTful
- Timezone: Europe/Berlin
Key Patterns
- MVC Architecture: Routes → Controllers → Services
- Entity Service: Always use
strapi.entityServiceover direct DB queries - Mail Templates: Centralized templating system with i18n support
- Error Handling: Sentry integration for error tracking
- Logging: Structured logging with context
🔐 Security & Authentication
Authentication Flow
POST /api/auth/local
Content-Type: application/json
{
"identifier": "user@example.com",
"password": "your_password"
}
Response includes JWT token for subsequent requests.
Authenticated Requests
GET /api/users/me
Authorization: Bearer YOUR_JWT_TOKEN
🔄 Data Flow
Request Lifecycle
- Client → HTTP Request
- Strapi Router → Route matching
- Middleware → Authentication, validation
- Controller → Input processing
- Service → Business logic
- Database → Data persistence
- Response → JSON output
Background Jobs
- Cron Trigger → Scheduled execution
- Service Logic → Business operations
- Database Updates → Batch processing
- Notifications → Email/webhook delivery
- Logging → Audit trail
📊 Database
Entity Service Usage
Always use Entity Service for database operations:
// ✅ Correct
const users = await strapi.entityService.findMany(
"plugin::users-permissions.user",
{
filters: { email: userEmail },
limit: 1,
}
);
// ❌ Avoid direct queries
const user = await strapi.db.query("plugin::users-permissions.user").findOne({
where: { email: userEmail },
});
Data Integrity
- Enum values must match Strapi component definitions exactly
- Always use optional chaining for nested properties
- Validate input before database operations
🛠️ Development Guidelines
Code Style
- Follow MVC pattern: Routes → Controllers → Services
- Use moment-timezone with 'Europe/Berlin'
- Template emails using centralized system
- Report errors to Sentry in catch blocks
Testing
- Unit tests for services
- Integration tests for API endpoints
- Cron job validation tests
Documentation
- JSDoc comments for all custom routes
- OpenAPI spec generation for new endpoints
- Update migration docs for schema changes
View Complete Development Rules →
📡 API Endpoints
Categories
- Analytics - Dashboard, program, and customer analytics
- Coaches - Coach matching, learner management, availability
- Scheduling - Calendly integration, event management
- Content - Blueprints, categories, modules
- User Management - User profiles, roles, permissions
🔍 Monitoring & Logging
Error Tracking
- Sentry Integration - Automatic error reporting
- Context Tags - Service, environment, operation
- Stack Traces - Full error details
Logging
- Console Logging - Development and debugging
- Structured Logs - JSON format for production
- Audit Trails - User actions and system events
🚀 Deployment
Environments
- Development - Local development with hot reload
- Staging - Pre-production testing environment
- Production - Live platform at api.tech.deepskill.de
Deployment Process
- Code review and approval
- Automated tests pass
- Build and package
- Database migrations (if needed)
- Deploy to staging
- Smoke tests
- Deploy to production
- Monitor for errors
🔗 Related Documentation
- Features - Platform features implemented by backend
- Processes - Automated workflows powered by backend
- Frontend - Frontend integration points
📚 Resources
Internal
- API Docs: Interactive API Reference
- Cron Jobs: Scheduled Tasks Documentation
- Extensions: Custom Strapi Implementations
External
- Strapi Documentation - Official framework docs
- Node.js Best Practices - Development guidelines
- REST API Standards - API design principles
Development Support
For backend development questions, reach out to the platform team on Slack (#platform-backend) or check the API Reference for endpoint documentation.