How nguyen1976/cse702025-n04-nhom-10 works
Project type and purpose
• This is a full-stack task management application.
• Frontend: Native Android app (“Taskify”) built with Kotlin, MVVM, Repository, DI (Hilt/Koin) patterns.
• Backend: Node.js/Express REST API providing user authentication (JWT) and task CRUD.
• Database (implied by .env config and Mongoose-style models): stores users and tasks.
• A Postman collection in documents confirms the REST endpoints.
Main components
a. Android Mobile Client
– Presentation layer (Activities, Composables in presentation/…)
– ViewModels (data/viewmodel)
– Repositories (data/repository)
– Data sources
• Remote: Retrofit interfaces (data/remote/*.kt) + OkHttp interceptors (AuthInterceptor, TokenExpirationInterceptor)
• Local: DataStore for tokens and preferences (data/local)
– Domain models (domain/model)
– DI modules (di/AppModule.kt)
b. Backend API Server
– Entry point: server.js
– Configuration: env loader (config/environment.js)
– Routing layers (routes/v1, routes/v2)
– Controllers (controllers/*Controller.js)
– Services (services/*Service.js)
– Data models (models/*Model.js)
– Middleware: authentication, error handling
– JWT provider (providers/JwtProvider.js)
– Utilities: formatters, validators, ApiError
c. Database
– Collections / tables: Users, Tasks
– Managed via ORM/ODM in models/
d. External/development tools
– Postman (collection file)
– Build tools: Gradle (Android), npm/Node (backend)
Relationships and data flow
1. User interacts with Android UI → triggers ViewModel
2. ViewModel calls Repository → decides between remote/local
3. Remote calls go through Retrofit → OkHttp Interceptors → HTTP request to Backend
4. Backend receives request → Router → Controller → Service → Model (DB) → Service → Controller → JSON response
5. Response passes back through network interceptor to Repository → ViewModel → UI
6. Local data (tokens/preferences) go through DataStore
Architectural patterns & design principles
• Frontend uses MVVM, Repository, DI, separation of concerns.
• Backend uses layered architecture: Routing → Controller → Service → Data Model.
• RESTful design, stateless JWT authentication.
• Error handling via centralized middleware.
Detail orientation
• Every folder/layer sufficiently: e.g., interceptors in the Android network layer, middleware in the backend.