How bittu1040/daily-task-tracker works
Project type and purpose
• This is a single‐page web application (SPA) built with Angular (v19).
• It provides a task‐tracking UI: users log in, view dashboards, add tasks, and see statistics.
• There is no backend code here, but the app relies on external REST APIs for data and authentication.
File structure
• Top-level Angular config files (angular.json, tsconfig.json) and the “src” folder containing all code.
• src/app:
• app.component.ts/html/scss – root component and view
• app.routes.ts – routing configuration
• app.config.ts – environment or API endpoints
• components/* – UI components (login, dashboard, add‐task, task‐list, etc.)
• services/* – data and auth logic (AuthService, TaskService, CommonService)
• interceptors/auth.interceptor.ts – attaches auth tokens to HTTP requests
• guards/auth.guard.ts – protects routes behind authentication
• models/interface.ts – TypeScript interfaces for domain models
• src/assets and src/styles – static assets and global styling (SCSS partials).
README
• Confirms it’s an Angular CLI–generated SPA.
• Describes development server, build process, and testing with Karma.
Main components
a. Browser / Client
• Hosts index.html and the Angular app bundle.
b. Angular Application (AppModule)
• AppComponent (root)
• Router Module (app.routes.ts) with route definitions
• Feature Components (login, dashboard, add‐task, task‐list, etc.)
• Services Layer (AuthService, TaskService, CommonService)
• HTTP Interceptor (auth.interceptor.ts)
• Route Guard (auth.guard.ts)
• Models (interfaces)
c. External Services
• Authentication API (e.g., /api/auth)
• Tasks API (e.g., /api/tasks)
• Any third-party services (if used)
d. Build & Deployment
• Angular CLI / Webpack bundling → dist/
• Static hosting (e.g., NGINX, S3 + CloudFront)
Relationships and data flow
• User interacts with the Browser UI → Angular Router loads a component.
• Component calls a Service method (e.g., TaskService.getTasks()).
• Service issues HTTP request; AuthInterceptor attaches JWT.
• Request/response flows to/from External REST API.
• Guard prevents navigation if AuthService.isLoggedIn() is false.
• Data flows back through Service → Component → View.
Architectural patterns and design principles
• Component-based UI (Angular Components).
• Separation of concerns: Components handle view logic; Services handle data & business logic.
• HTTP Interceptor for cross-cutting concern (auth token injection).
• Router Guards for authorization.
• Reactive or promise-based data flows (Observables in Services).