How parthamallick49/task_manager_app works
1. Repository shape
- This is a two-tier mobile app: a Flutter client in frontend/task_manager_app and a Node.js/Express backend in backend/task-manager-server.
- The system is centered on a REST API plus a small static file host for app distribution.
2. Client-side presentation layer
- The Flutter app is organized by concern: screens, widgets, auth, providers, services, models, and utils.
- Screens represent the user journeys: splash, login/register, home/dashboard, add/edit task, task details, search, and update prompt.
3. Client state and data orchestration
- providers/ acts as the app’s state boundary, likely wrapping authentication, task lists, and current user data for the widget tree.
- services/ contains the network-facing layer, so UI widgets do not talk directly to HTTP endpoints.
- utils/shared_prefs.dart indicates local persistence of session data such as JWTs or user state.
4. Authentication flow
- The app has a dedicated auth subdomain: login_screen.dart, register_screen.dart, and auth_service.dart.
- Login/register appear to authenticate against the backend, then store credentials locally and drive subsequent API calls through the providers.
5. Task management flow
- Task CRUD is split between task_service.dart, task_provider.dart, task_model.dart, and task-oriented screens/widgets.
- The UI likely fetches tasks from the server, renders them in cards, and routes create/update/delete actions back through the service layer.
6. Update/version-check path
- version_check_service.dart and UpdateScreen.dart suggest the app checks backend-provided version metadata.
- The backend’s public/apk/task_manager_latest.apk and routes/appInfoRoutes.js indicate a built-in distribution path for APK updates, separate from normal task/auth APIs.
7. Backend HTTP API boundary
- The Express app is split into routes, controllers, middleware, and models, which is a classic layered API architecture.
- Routes define endpoints, controllers implement request handling, models map to persisted data, and middleware handles cross-cutting concerns.
8. Backend domain modules
- userController.js and taskController.js are the main business logic entry points.
- userModel.js and taskModel.js define the backend’s persistent entities, with MongoDB as the data store per the README.
9. Backend security and error handling
- middleware/authMiddleware.js enforces authenticated access, likely validating JWTs on protected task/user routes.
- middleware/errorMiddleware.js centralizes API error shaping, so the controllers can remain thin and route-specific.
10. Backend API surface
- userRoutes.js likely handles signup/login and user-related operations.
- taskRoutes.js handles authenticated CRUD for tasks.
- appInfoRoutes.js exposes application metadata such as latest version/build info for the Flutter update flow.
11. Static asset and distribution boundary
- The backend also serves static content from public/, most notably the APK file.
- That means the server is both an API provider and an app artifact host, which is important for the architecture diagram.
12. Platform packaging
- The Flutter project includes both Android and iOS runners, so the client is cross-platform even though the APK update path is Android-specific.
- Android network/security config files suggest the mobile app is configured for backend connectivity and file handling on-device.
13. End-to-end data flow
- User opens the Flutter app → splash/auth state is resolved from local storage → app calls backend APIs via services/providers.
- Authenticated requests go to Express routes → middleware validates JWTs → controllers read/write MongoDB-backed models → JSON responses return to the app.
- Separately, version checks hit app-info endpoints and may direct the user to download the latest APK from the backend-hosted static file.
14. Key architectural boundaries to draw
- UI vs state vs network in Flutter.
- Public API routes vs protected routes on the backend.
- Business logic in controllers vs persistence in models.
- Normal task/auth traffic vs update/distribution traffic.
Main entry points: taskRoutes.js Task & user routes · task_provider.dart Task state · auth_provider.dart Auth state · server.js Server entry
Components 23
Flutter client
Cross-platform mobile app in frontend/task_manager_app
- App shell · Bootstraps the mobile app and initial routing
frontend/task_manager_app/lib/main.dart - Splash · Resolves initial auth/session state before navigation
frontend/task_manager_app/lib/screens/splash_screen.dart - Login & register · User sign-in and account creation screens
frontend/task_manager_app/lib/auth/login_screen.dart - Home · Primary task overview and navigation hub
frontend/task_manager_app/lib/screens/home_screen.dart - Task flows · Add, detail, search, and update task screens
frontend/task_manager_app/lib/screens/add_task_screen.dart - Auth state · App state boundary for authentication
frontend/task_manager_app/lib/providers/auth_provider.dart - Task state · State management for task lists and task actions
frontend/task_manager_app/lib/providers/task_provider.dart - User state · Current user/session data for the widget tree
frontend/task_manager_app/lib/providers/user_provider.dart - Auth API · Handles login and registration requests
frontend/task_manager_app/lib/services/auth_service.dart - Task API · CRUD client for task endpoints
frontend/task_manager_app/lib/services/task_service.dart - Version check · Fetches app version metadata for update prompts
frontend/task_manager_app/lib/services/version_check_service.dart - Local prefs · Stores session and user data on device
frontend/task_manager_app/lib/utils/shared_prefs.dart - Task model · Client-side task entity shape
frontend/task_manager_app/lib/models/task.dart
Express API
Node.js server in backend/task-manager-server
- Server entry · Starts the API server and wires middleware/routes
backend/task-manager-server/server.js - Task & user routes · Protected task endpoints and auth-related user endpoints
backend/task-manager-server/routes/taskRoutes.js - App info routes · Exposes version/build info for update checks
backend/task-manager-server/routes/appInfoRoutes.js - User controller · Implements signup/login and user-facing logic
backend/task-manager-server/controllers/userController.js - Task controller · Implements task CRUD business logic
backend/task-manager-server/controllers/taskController.js - Auth guard · Validates authenticated access on protected routes
backend/task-manager-server/middleware/authMiddleware.js - Error handler · Central API error shaping and response handling
backend/task-manager-server/middleware/errorMiddleware.js - User model · Persistent user entity definition
backend/task-manager-server/models/userModel.js - Task model · Persistent task entity definition
backend/task-manager-server/models/taskModel.js - APK host · Served Android build artifact for app distribution
backend/task-manager-server/public/apk/task_manager_latest.apk
Connections 24
- App shell → Splash: launches · App starts in splash and session resolution
- Splash → Auth state: reads state · Checks whether a user is already authenticated
- Splash → Local prefs: loads session · Restores cached token or user state
- Login & register → Auth state: updates · Auth UI drives auth state changes
- Auth state → Auth API: calls · Delegates login and registration to the network layer
- Auth API → Task & user routes: POST auth · Sends authentication requests to the backend
- Auth API → Local prefs: stores token · Persists session data after successful auth
- Home → Task state: consumes · Dashboard renders task state from provider
- Task flows → Task state: updates · Task UI triggers create/update/search flows
- Task state → Task API: calls · Provider mediates task API access
- Task API → Task & user routes: CRUD tasks · Authenticated task operations go through REST routes
- Task API → Task model: maps data · Task payloads mirror backend task entities
- Task state → Task model: uses · Client state is shaped by the task model
- User state → Auth state: derives from · Current user state follows authentication state
- Version check → App info routes: checks version · Queries backend metadata for update availability
- Version check → APK host: downloads APK · Update flow points to hosted app binary
- Server entry → Task & user routes: mounts · Registers REST API routes
- Server entry → App info routes: mounts · Registers version/info routes
- Task & user routes → Auth guard: protects · Authenticated task endpoints are guarded
- Task & user routes → User controller: delegates · User requests are handled by the user controller
- Task & user routes → Task controller: delegates · Task requests are handled by the task controller
- User controller → User model: persists · User logic reads and writes user records
- Task controller → Task model: persists · Task logic reads and writes task records
- Server entry → Error handler: uses · Centralizes API error handling