How emtiajium/vocabulary-flashcard-backend works
This is the NestJS backend for Firecracker Vocabulary, a collaborative vocabulary and flashcard app. Clients authenticate and then manage users, cohorts, vocabulary, and Leitner flashcards; vocabulary search and guessing-game features are also documented in the source index and changelog. PostgreSQL provides persistent domain state, while Google token verification is an authentication integration. The graph emphasizes relationships shown in excerpts or the source index; several listed capabilities have unsampled implementations, so their internal links are omitted rather than inferred.
Main entry points: UserService.ts User Service · VocabularyService.ts Vocabulary Service · AuthGuard.ts Auth Guard · CohortService.ts Cohort Service
Components 20
Identity and Cohorts
- Auth Guard
src/common/guards/AuthGuard.ts - Token Manager
src/common/services/TokenManager.ts - User Service
src/user/services/UserService.ts - User API
src/user/controllers/UserController.ts - User Repository
src/user/repositories/UserRepository.ts - Cohort Service
src/user/services/CohortService.ts - Cohort Repository
src/user/repositories/CohortRepository.ts
Vocabulary Management
- Vocabulary API
src/vocabulary/controllers/VocabularyController.ts - Vocabulary Service
src/vocabulary/services/VocabularyService.ts - Vocabulary Repository
src/vocabulary/repositories/VocabularyRepository.ts - Definition Repository
src/vocabulary/repositories/DefinitionRepository.ts
Learning Features
- Leitner API
src/vocabulary/controllers/LeitnerSystemsController.ts - Leitner Service
src/vocabulary/services/LeitnerSystemsService.ts - Leitner Repository
src/vocabulary/repositories/LeitnerSystemsRepository.ts - Guessing Game
src/vocabulary/services/GuessingGameService.ts
Platform Services
- Android API
src/android/controllers/AndroidController.ts - Health Check
src/health-check/controllers/HealthCheckController.ts - PostgreSQL
- Google Identity
Other components
- App Client
Connections 27
- App Client → Auth Guard: requests protected routes
src/common/guards/AuthGuard.ts - Auth Guard → Token Manager: decodes token
src/common/guards/AuthGuard.ts - Auth Guard → User Service: loads user
src/common/guards/AuthGuard.ts - Token Manager → Google Identity: verifies identity token
src/common/services/TokenManager.ts - User API → User Service: delegates user actions
src/user/controllers/UserController.ts - User API → Auth Guard: guards report routes
src/user/controllers/UserController.ts - User API → App Client: returns user results
- User Service → User Repository: reads and writes users
src/user/services/UserService.ts - User Service → Cohort Service: creates default cohort
src/user/services/UserService.ts - User Service → Token Manager: decodes signup token
src/user/services/UserService.ts - Cohort Service → Cohort Repository: creates and finds cohorts
src/user/services/CohortService.ts - Cohort Service → User Repository: updates cohort membership
src/user/services/CohortService.ts - Cohort Service → Vocabulary Service: moves cohort vocabulary
src/user/services/CohortService.ts - Vocabulary API → Vocabulary Service: delegates vocabulary actions
src/vocabulary/controllers/VocabularyController.ts - Vocabulary API → Auth Guard: guards vocabulary routes
src/vocabulary/controllers/VocabularyController.ts - Vocabulary Service → Vocabulary Repository: searches and persists vocabulary
src/vocabulary/services/VocabularyService.ts - Vocabulary Service → Definition Repository: removes orphan definitions
src/vocabulary/services/VocabularyService.ts - Vocabulary Service → Guessing Game: requests game meanings
src/vocabulary/services/VocabularyService.ts - Leitner API → Leitner Service: delegates flashcard actions
src/vocabulary/controllers/LeitnerSystemsController.ts - Leitner Service → Leitner Repository: reads and updates boxes
src/vocabulary/services/LeitnerSystemsService.ts - Leitner Service → Vocabulary Repository: loads vocabulary
src/vocabulary/services/LeitnerSystemsService.ts - Vocabulary Repository → PostgreSQL: queries and persists
src/vocabulary/repositories/VocabularyRepository.ts - User Repository → PostgreSQL: persists user records
- Cohort Repository → PostgreSQL: persists cohort records
- Leitner Repository → PostgreSQL: persists flashcard state
- Android API → App Client: serves Android metadata
- Health Check → App Client: reports service health