Skip to main content

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

View API Reference →


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

View Strapi Extensions →


🏗️ 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.entityService over 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

Full Authentication Guide →


🔄 Data Flow​

Request Lifecycle​

  1. Client → HTTP Request
  2. Strapi Router → Route matching
  3. Middleware → Authentication, validation
  4. Controller → Input processing
  5. Service → Business logic
  6. Database → Data persistence
  7. Response → JSON output

Background Jobs​

  1. Cron Trigger → Scheduled execution
  2. Service Logic → Business operations
  3. Database Updates → Batch processing
  4. Notifications → Email/webhook delivery
  5. 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

Explore All 64 Endpoints →


🔍 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​

  1. Code review and approval
  2. Automated tests pass
  3. Build and package
  4. Database migrations (if needed)
  5. Deploy to staging
  6. Smoke tests
  7. Deploy to production
  8. Monitor for errors

  • Features - Platform features implemented by backend
  • Processes - Automated workflows powered by backend
  • Frontend - Frontend integration points

📚 Resources​

Internal​

External​


Development Support

For backend development questions, reach out to the platform team on Slack (#platform-backend) or check the API Reference for endpoint documentation.