How user-bird/task works
1. This repository is an Angular single-page application for task management, built as a client-side UI with Angular CLI. The app is bootstrapped from src/main.ts, configured through app.config.ts, and routed via app.routes.ts.
2. The system is split into a presentation layer and a data layer. UI is implemented as Angular components under src/app/components, while business/data access concerns live in src/app/services. This makes the architecture easy to diagram as “pages/components” calling into “services,” which in turn talk to the backend.
3. The main user-facing screens are login, register, dashboard, and not-found. These are the route-level pages. The dashboard is the core authenticated workspace, while the auth pages handle access entry and the not-found page handles invalid routes.
4. The dashboard is composed from smaller feature components: task-list, task-card, task-detail, task-form, and stats-card. That suggests a clear nested structure where the dashboard aggregates task summary, list browsing, detail viewing, and task creation/editing.
5. Shared chrome and feedback components include header and toast. The header likely provides top-level navigation, while toast is a global transient notification surface used by services and/or pages for success and error feedback.
6. Data access is centralized in auth.ts, task.ts, and toast.ts services. In architecture terms, these are the main application boundary between UI and state/network logic. The task and auth services are the primary entry points for reading/writing backend data and managing authentication-related state.
7. The backend is not a custom server; it is a local json-server instance backed by db.json on port 3000. The README explicitly says the Vercel deployment is UI-only and data loading requires running this local REST API, so the app’s data flow depends on a separate backend process during development.
8. The app uses route guards to enforce navigation rules. auth-guard.ts protects authenticated areas, and unsaved-changes-guard.ts prevents losing in-progress edits from the task form. These guards are an important boundary between routing and form state.
9. Domain data is represented by simple models in src/app/models/task.ts and src/app/models/user.ts. Those models define the shape shared across services, components, and pipes, which helps keep the UI and API contracts aligned.
10. Display formatting is separated into reusable pipes: date-relative-pipe and priority-label-pipe. These are presentation-only transformations, so they belong between raw model data and component templates rather than inside services.
11. Styling is mostly local to components via per-component .css and .html files, with global app styles in src/styles.css and src/app/app.css. That indicates a component-scoped UI structure with a small amount of global theming/layout.
12. Operationally, the repo is designed to run in two processes: Angular frontend on the dev server and json-server backend from db.json. The architecture diagram should therefore show a browser client consuming a local REST API, with deployment on Vercel limited to the frontend shell unless the API is also available.
Main entry points: dashboard.ts Dashboard · app.routes.ts Routes · auth.ts Auth service · task.ts Task service
Components 25
Angular client
Browser-facing SPA bootstrapped by Angular CLI and routed on the client.
- Bootstrap · Angular application entry that starts the client app.
src/main.ts - App config · Provides application-wide providers and setup.
src/app/app.config.ts - Routes · Defines the client-side navigation structure.
src/app/app.routes.ts - App shell · Top-level application container and router outlet host.
src/app/app.ts - Login · Route-level sign-in screen.
src/app/components/login/login.ts - Register · Route-level account creation screen.
src/app/components/register/register.ts - Dashboard · Authenticated task workspace composed of summary, list, detail, and form sections.
src/app/components/dashboard/dashboard.ts - Not found · Fallback screen for invalid routes.
src/app/components/not-found/not-found.ts - Header · Shared top navigation and page chrome.
src/app/components/header/header.ts - Toast · Global transient notification surface.
src/app/components/toast/toast.ts - Task list · Lists tasks and coordinates browsing into task items.
src/app/components/task-list/task-list.ts - Task card · Compact task presentation used within lists.
src/app/components/task-card/task-card.ts - Task detail · Detailed task inspection and contextual actions.
src/app/components/task-detail/task-detail.ts - Task form · Create/edit surface for task data.
src/app/components/task-form/task-form.ts - Stats card · Dashboard summary metrics and status cards.
src/app/components/stats-card/stats-card.ts
App logic
Shared models, services, guards, and formatting used by the UI.
- Auth service · Handles authentication state and user/session operations.
src/app/services/auth.ts - Task service · Central task data access and mutation boundary.
src/app/services/task.ts - Toast service · Dispatches app-wide toast messages from UI and services.
src/app/services/toast.ts - Auth guard · Protects authenticated routes.
src/app/guards/auth-guard.ts - Unsaved guard · Prevents navigation away from in-progress task edits.
src/app/guards/unsaved-changes-guard.ts - Task model · Shared task shape used across services and UI.
src/app/models/task.ts - User model · Shared user/auth shape used across services and UI.
src/app/models/user.ts - Date relative · Formats dates into relative time text.
src/app/pipes/date-relative-pipe.ts - Priority label · Maps priority values to readable labels.
src/app/pipes/priority-label-pipe.ts
Local API
Development REST backend served from db.json via json-server.
- json-server · Local REST API backed by db.json for development data.
db.json
Connections 30
- Bootstrap → App config: loads · Bootstraps app-wide providers and setup.
- Bootstrap → Routes: starts · Initializes client-side routing.
- Routes → App shell: mounts · Root route renders the app shell.
- Routes → Login: route · Public authentication entry.
- Routes → Register: route · Public account creation entry.
- Routes → Dashboard: route · Authenticated workspace.
- Routes → Not found: fallback · Handles invalid URLs.
- Dashboard → Header: uses · Shared page chrome.
- Dashboard → Stats card: contains · Shows summary cards.
- Dashboard → Task list: contains · Browses task collection.
- Dashboard → Task detail: contains · Displays selected task.
- Dashboard → Task form: contains · Creates and edits tasks.
- Task list → Task card: renders · Uses cards to present tasks.
- Task list → Task service: reads · Loads task data.
- Task detail → Task service: reads · Fetches task details and updates.
- Task form → Task service: writes · Creates and persists task changes.
- Task form → Unsaved guard: protected by · Navigation away from edits is guarded.
- Login → Auth service: uses · Authenticates the user.
- Register → Auth service: uses · Creates new user accounts.
- Auth guard → Auth service: checks · Reads auth state for route access.
- Task service → json-server: api · Reads and writes task data through the local REST backend.
- Auth service → json-server: api · Reads and writes auth-related data through the local REST backend.
- Toast service → Toast: drives · Triggers global notifications.
- Task service → Toast service: notifies · Emits success and error feedback.
- Auth service → Toast service: notifies · Emits success and error feedback.
- Task service → Task model: uses · Shares task contract with UI.
- Auth service → User model: uses · Shares user contract with UI.
- Dashboard → Date relative: formats · Displays relative dates in the workspace.
- Task card → Priority label: formats · Shows readable priority labels.
- Task detail → Date relative: formats · Presents task timing details.