How 25ghost/superteacher works
SuperTeacher API is a FastAPI backend whose documented core is student registration, catalog selection, and enrollment; it also supports authentication and broader tutoring/learning features. A typical request enters through the versioned API, is authenticated where required, runs through a domain service, and uses repositories and SQLAlchemy models for persisted state. The README documents account, session, and recovery behavior; the source index and excerpts support selected learning flows. Many tutoring, classroom, and administration endpoints are present in the tree but were not sampled, so their internal connections are not inferred.
Main entry points: database.py SQL database · auth_service.py Accounts and sessions · router.py Versioned API router · learning_enrollment_service.py Learning enrollment rules
Components 31
API and identity
- Versioned API router
app/api/v1/router.py - Authentication routes
app/api/v1/endpoints/auth.py - Identity and role guards
app/core/auth_dependencies.py
Registration and catalog
- Registration endpoints
app/api/v1/endpoints/registrations.py - Catalog endpoints
app/api/v1/endpoints/catalog.py - Student profiles
app/services/student_service.py - Enrollment workflow
app/services/registration_service.py - Education catalog data
app/data - Student profile model
app/models/student.py - Student profile schema
app/schemas/student_profile.py - Program version model
app/models/program_version.py
Tutoring and learning
- Learning enrollment API
app/api/v1/endpoints/learning_enrollments.py - Learning enrollment rules
app/services/learning_enrollment_service.py - Learning context resolution
app/services/learning_context_service.py - Learning enrollment storage
app/repositories/learning_enrollment_repository.py - Teaching offerings
app/services/teaching_offering_service.py - Learning content and books
app/services/student_content_service.py - Live classroom
app/api/v1/endpoints/classroom_ws.py - Teacher verification
app/services/teacher_verification_service.py
Authentication state
- Accounts and sessions
app/services/auth_service.py - Session repository
app/repositories/auth_session_repository.py - Audit events
app/repositories/auth_event_repository.py - User identity model
app/models/user.py
Shared platform
- SQL database
app/core/database.py - Runtime configuration
app/core/config.py - Token security
app/core/security.py - Domain states
app/models/enums.py - API tags
app/api/v1/tags.py - Application logging
app/core/logging.py - Timestamp fields
app/core/time_mixin.py
Other components
- API client
Connections 34
- API client → Versioned API router: sends requests
app/api/v1/router.py - Versioned API router → Authentication routes: routes to
app/api/v1/router.py - Versioned API router → Registration endpoints: routes to
app/api/v1/router.py - Versioned API router → Catalog endpoints: routes to
app/api/v1/router.py - Versioned API router → Learning enrollment API: routes to
app/api/v1/router.py - Authentication routes → Accounts and sessions: calls
app/api/v1/endpoints/auth.py - Authentication routes → Identity and role guards: uses guards
app/api/v1/endpoints/auth.py - Accounts and sessions → Session repository: manages sessions
app/services/auth_service.py - Accounts and sessions → Audit events: records events
app/services/auth_service.py - Accounts and sessions → User identity model: uses identity
app/services/auth_service.py - Accounts and sessions → Student profile model: loads profile
app/services/auth_service.py - Accounts and sessions → Token security: creates tokens
app/services/auth_service.py - Identity and role guards → Token security: decodes tokens
app/core/auth_dependencies.py - Identity and role guards → Session repository: checks session
app/core/auth_dependencies.py - Registration endpoints → Student profiles: uses profiles
- Registration endpoints → Enrollment workflow: runs registration
- Catalog endpoints → Education catalog data: serves catalog
- Student profiles → Student profile model: manages profile
app/services/student_service.py - Student profiles → Student profile schema: builds responses
app/services/student_service.py - Enrollment workflow → SQL database: persists enrollment
- Learning enrollment API → Learning enrollment rules: calls
app/api/v1/endpoints/learning_enrollments.py - Learning enrollment rules → Learning enrollment storage: creates enrollment
app/services/learning_enrollment_service.py - Learning enrollment rules → Learning context resolution: resolves context
app/services/learning_enrollment_service.py - Learning enrollment rules → Teaching offerings: checks offering
app/services/learning_enrollment_service.py - Learning enrollment storage → SQL database: reads and writes
- Learning context resolution → Program version model: validates version
app/services/learning_context_service.py - Identity and role guards → User identity model: loads account
app/core/auth_dependencies.py - Session repository → SQL database: stores sessions
- Audit events → SQL database: stores audit
- SQL database → Runtime configuration: reads settings
app/core/database.py - User identity model → SQL database: maps table
app/models/user.py - Student profile model → SQL database: maps table
app/models/student.py - Program version model → SQL database: maps table
app/models/program_version.py - Learning enrollment rules → Domain states: uses states
app/services/learning_enrollment_service.py