How mansurrovv10/language-learning-platform works
This is a FastAPI modular-monolith backend for a language-learning platform with social chat features. Users authenticate, take placement tests to establish their level, access unlocked learning content, submit exercises, and accumulate progress and rewards. The graph highlights the documented product areas and sampled service behavior; several domain implementations were not sampled, so their internal wiring is represented only at the API/service boundary. PostgreSQL and Redis are documented, and sampled code confirms Redis rate limiting; database persistence is visible in the authentication repository.
Main entry points: main.py FastAPI application · auth.py Auth API · auth_ser.py Authentication service · chats.py Chat API
Components 27
Application runtime
- FastAPI application
main.py - Auth API
backend/api/auth.py - User API
backend/api/users.py - Authentication service
backend/services/auth_ser.py
Learning journey
- Languages API
backend/api/languages.py - Courses API
backend/api/courses.py - Lessons API
backend/api/lessons.py - Exercises API
backend/api/exercises.py - Level tests API
backend/api/level_tests.py - Learning path
backend/services/learning_path_service.py - Exercise evaluation
backend/services/exercise_service.py - Placement and tests
backend/services/level_test_service.py
Progress and rewards
- Progress API
backend/api/progress.py - Gamification API
backend/api/gamification.py - Achievements API
backend/api/achievement.py - Daily challenges
backend/api/challange.py - Leaderboard API
backend/api/leaderboard.py - Achievement awards
backend/services/achievement_service.py
Social features
- Friends API
backend/api/friends.py - Chat API
backend/api/chats.py - Chat WebSocket
backend/api/chat_ws.py - Chat operations
backend/services/chat_service.py
Platform services
- Auth repository
backend/repositories/auth_repo.py - PostgreSQL
- Rate limiting
backend/middleware.py - Redis
backend/database/redis.py
Other components
- API clients
Connections 25
- API clients → FastAPI application: sends requests
- FastAPI application → Auth API: routes requests
- FastAPI application → User API: routes requests
- FastAPI application → Languages API: routes requests
- FastAPI application → Courses API: routes requests
- FastAPI application → Lessons API: routes requests
- FastAPI application → Exercises API: routes requests
- FastAPI application → Level tests API: routes requests
- FastAPI application → Progress API: routes requests
- FastAPI application → Gamification API: routes requests
- FastAPI application → Achievements API: routes requests
- FastAPI application → Daily challenges: routes requests
- FastAPI application → Leaderboard API: routes requests
- FastAPI application → Friends API: routes requests
- FastAPI application → Chat API: routes requests
- FastAPI application → Chat WebSocket: routes connections
- Auth API → Authentication service: invokes
- Authentication service → Auth repository: uses
- Auth repository → PostgreSQL: reads and writes
- Rate limiting → Redis: increments counters
- FastAPI application → Rate limiting: applies middleware
- Placement and tests → Learning path: sets learner level
- Exercise evaluation → Achievement awards: checks awards
- Chat API → Chat operations: invokes
- Chat WebSocket → Chat operations: invokes