How baohuy6505/flashbrain works
FlashBrain is a spaced-repetition flashcard product with an Android client and a Node/Express backend. The user studies and manages decks and cards in the app; documented cloud sync carries data to the authenticated API, which persists user, study, and learning data and exposes progress, statistics, and notification capabilities. The sampled backend confirms route/controller/service boundaries and some repository wiring; Android implementation details and most service internals are not present in the supplied tree or excerpts, so those links are shown only where documented or directly supported.
Main entry points: authService.js Auth service · index.js API routes · app.js Express app · authRoutes.js Auth routes
Components 30
API presentation
- Express app
backend/src/app.js - API routes
backend/src/presentation/routes/index.js - Auth routes
backend/src/presentation/routes/authRoutes.js - Deck routes
backend/src/presentation/routes/deckRoutes.js - Flashcard routes
backend/src/presentation/routes/flashcardRoutes.js - JWT middleware
backend/src/presentation/middlewares/authMiddleware.js - Auth controller
backend/src/presentation/controllers/authController.js - Deck controller
backend/src/presentation/controllers/deckController.js - Flashcard controller
backend/src/presentation/controllers/flashcardController.js - Progress controller
backend/src/presentation/controllers/userProgressController.js - Statistics controller
backend/src/presentation/controllers/statisticController.js - Notification controller
backend/src/presentation/controllers/notificationController.js
Application services
- Auth service
backend/src/application/services/authService.js - Deck service
backend/src/application/services/deckService.js - Flashcard service
backend/src/application/services/flashcardService.js - Progress service
backend/src/application/services/userProgressService.js - Statistics service
backend/src/application/services/satisticService.js - Notification service
backend/src/application/services/notificationService.js
Persistence
- User repository
backend/src/infrastructure/repositories/userRepository.js - Deck repository
backend/src/infrastructure/repositories/deckRepository.js - Flashcard repository
backend/src/infrastructure/repositories/flashcardRepository.js - Progress repository
backend/src/infrastructure/repositories/userProgressRepository.js - Notification repository
backend/src/infrastructure/repositories/notificationRepository.js - MongoDB
Learning operations
- Notification job
backend/src/infrastructure/jobs/notificationJob.js - Cloudinary
- Google identity
- JWT utility
backend/src/application/utils/jwt.js
Other components
- Learner
- Android app
Connections 30
- Learner → Android app: studies with
- Android app → Express app: syncs via API
- Express app → API routes: mounts routes
- API routes → Auth routes: dispatches
- API routes → Deck routes: dispatches
- API routes → Flashcard routes: dispatches
- Auth routes → JWT middleware: guards requests
- Deck routes → JWT middleware: guards requests
- Flashcard routes → JWT middleware: guards requests
- Auth routes → Auth controller: dispatches
- Deck routes → Deck controller: dispatches
- Flashcard routes → Flashcard controller: dispatches
- Auth controller → Auth service: calls
- Deck controller → Deck service: calls
- Flashcard controller → Flashcard service: calls
- Progress controller → Progress service: calls
- Statistics controller → Statistics service: calls
- Notification controller → Notification service: calls
- Auth service → User repository: reads and writes
- Auth service → JWT utility: generates tokens
- Auth service → Google identity: verifies identity
- Auth service → Cloudinary: deletes old image
- Flashcard service → Flashcard repository: uses repository
- User repository → MongoDB: stores users
- Deck repository → MongoDB: stores decks
- Flashcard repository → MongoDB: stores cards
- Progress repository → MongoDB: stores progress
- Notification repository → MongoDB: stores notifications
- Express app → Notification job: starts job
- Android app → Android app: studies offline