How cuonvc/ex-money-backend works
Main Components
• Mobile Client (Flutter): Although external, it’s important to note the mobile app (referenced in the README) which interacts with this backend.
• API Gateway / Front Controller: The Spring Boot application (ExmoneyApplication) acts as the entry-point. It routes calls through REST controllers such as AuthController, ExpenseController, WalletController, etc.
• Service Layer: Group the services (ExpenseService, UserService, WalletService, etc.) along with their implementations. They encapsulate the business logic.
• Persistence/Repository Layer: Show repositories (e.g., ExpenseRepository, UserRepository) that interact with the PostgreSQL database alongside JPA entities. Optionally highlight Redis if caching is in use.
• Worker/Task Scheduler: Include components like ExpenseSchedulerExecuteWorker and ExpenseSchedulerResetWorker for background processing.
• External Services/Integrations: Represent integrations with third-party services (Firebase, Google OAuth 2.0) and any email service.
Relationships and Interactions
• That the Security components (JWT authentication and filters) are cross-cutting, so link them to the API gateway entry point and service layers.
Architectural Patterns
• Layered Architecture: Clearly separate the presentation (controllers), business logic (services), and data access (repositories) layers.
• Use of Dependency Injection (as seen in the configuration classes) and a service-oriented approach.
• Security aspects (JWT-based authentication via JwtAuthenticationFilter and JwtTokenProvider) are implemented as cross-cutting concerns.
• The system utilizes micro-level scheduling for background processing (TaskSchedulerService and associated worker classes).
Technologies/Frameworks
• Java Spring Boot (Main Framework)
• Spring Data JPA (for ORM capabilities)
• PostgreSQL (database) and Redis (caching, if applicable)
• Spring Security with JWT for authentication
• Docker (for containerization) and associated deployment tooling (docker-compose, Nginx, Ngrok)
• Firebase and OAuth 2.0 for third-party authentication and integration