How higor-castro/studyflow-backend works
StudyFlow is a Spring REST backend. The sampled implementation centers on account registration and login: credentials are checked, consent and temporary lockouts are considered, a second-factor code is emailed, and a JWT is issued after code validation. It also supports password recovery and personal-data/consent operations. The README describes a broader study planner, but no subject, task, exam, or deadline modules appear in the supplied tree, so those capabilities are not mapped as implemented. Some controller and service excerpts are partial; links for unsampled features are limited to documented or tree-supported evidence.
Main entry points: UserController.java User endpoints · RedefinirSenhaService.java Password recovery · LogService.java Activity logging · UserService.java Account service
Components 22
REST API
- User endpoints
src/main/java/com/edu/StudyFlow/controller/UserController.java - Admin endpoint
src/main/java/com/edu/StudyFlow/controller/UserAdminController.java - Error responses
src/main/java/com/edu/StudyFlow/exception/GlobalExceptionHandler.java - Request validation
src/main/java/com/edu/StudyFlow/validation
Identity and security
- Account service
src/main/java/com/edu/StudyFlow/service/UserService.java - Login throttling
src/main/java/com/edu/StudyFlow/service/LoginTimeService.java - Two-factor codes
src/main/java/com/edu/StudyFlow/service/TwoFAService.java - Password recovery
src/main/java/com/edu/StudyFlow/service/RedefinirSenhaService.java - JWT lifecycle
src/main/java/com/edu/StudyFlow/security/JwtService.java - JWT request filter
src/main/java/com/edu/StudyFlow/security/JwtAuthFilter.java - User lookup
src/main/java/com/edu/StudyFlow/security/CustomUserDetailsService.java - Security configuration
src/main/java/com/edu/StudyFlow/security/SecurityConfig.java - Email delivery
src/main/java/com/edu/StudyFlow/service/EmailService.java
Consent and privacy
- Consent management
src/main/java/com/edu/StudyFlow/service/ConsentimentoService.java - Activity logging
src/main/java/com/edu/StudyFlow/service/LogService.java
Persistence and records
- User records
src/main/java/com/edu/StudyFlow/repository/UserRepository.java - Consent records
src/main/java/com/edu/StudyFlow/repository/ConsentimentoRepository.java - Revoked tokens
src/main/java/com/edu/StudyFlow/repository/TokenInvalidadoRepository.java - Audit records
src/main/java/com/edu/StudyFlow/repository/LogRepository.java
Other components
- Client
- Brevo email
- PostgreSQL
Connections 31
- Client → User endpoints: sends requests
- User endpoints → Account service: handles accounts
- User endpoints → Login throttling: checks lockout
- User endpoints → Two-factor codes: requests code
- User endpoints → JWT lifecycle: issues token
- User endpoints → Password recovery: handles recovery
- User endpoints → Consent management: manages consent
- User endpoints → Activity logging: records actions
- User endpoints → Request validation: accepts validated input
- User endpoints → Error responses: raises handled errors
- Admin endpoint → Client: returns response
- Account service → User records: reads and writes
- Account service → Consent management: registers or reads consent
- Login throttling → Activity logging: records lockout events
- Two-factor codes → Email delivery: sends code
- Password recovery → User records: looks up account
- Password recovery → Account service: resets password
- Password recovery → Email delivery: sends recovery code
- Password recovery → Activity logging: records recovery events
- Email delivery → Brevo email: delivers messages
- Consent management → Consent records: reads and writes
- Consent management → Activity logging: records consent events
- JWT request filter → JWT lifecycle: checks token
- JWT request filter → User lookup: loads identity
- User lookup → User records: finds user
- JWT lifecycle → Revoked tokens: stores revoked token
- User records → PostgreSQL: persists users
- Consent records → PostgreSQL: persists consent
- Revoked tokens → PostgreSQL: persists revocations
- Activity logging → Audit records: persists logs
- Audit records → PostgreSQL: persists records