# user-bird/task architecture

> Architecture diagram of the GitHub repository user-bird/task, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/user-bird/task
- Repository: https://github.com/user-bird/task

## Overview

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: [`src/app/components/dashboard/dashboard.ts`](https://github.com/user-bird/task/blob/main/src/app/components/dashboard/dashboard.ts) (Dashboard), [`src/app/app.routes.ts`](https://github.com/user-bird/task/blob/main/src/app/app.routes.ts) (Routes), [`src/app/services/auth.ts`](https://github.com/user-bird/task/blob/main/src/app/services/auth.ts) (Auth service), [`src/app/services/task.ts`](https://github.com/user-bird/task/blob/main/src/app/services/task.ts) (Task service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular client"]
  node_main(("Bootstrap<br/>entrypoint<br/>[main.ts]"))
  node_appconfig["App config<br/>bootstrap config<br/>[app.config.ts]"]
  node_routes["Routes<br/>routing<br/>[app.routes.ts]"]
  node_shell["App shell<br/>root component<br/>[app.ts]"]
  node_login["Login<br/>auth page<br/>[login.ts]"]
  node_register["Register<br/>auth page<br/>[register.ts]"]
  node_dashboard["Dashboard<br/>workspace page<br/>[dashboard.ts]"]
  node_notfound["Not found<br/>error page<br/>[not-found.ts]"]
  node_header["Header<br/>chrome<br/>[header.ts]"]
  node_toastui["Toast<br/>feedback ui<br/>[toast.ts]"]
  node_tasklist["Task list<br/>task browser<br/>[task-list.ts]"]
  node_taskcard["Task card<br/>task item<br/>[task-card.ts]"]
  node_taskdetail["Task detail<br/>task view<br/>[task-detail.ts]"]
  node_taskform["Task form<br/>edit form<br/>[task-form.ts]"]
  node_statscard["Stats card<br/>summary widget<br/>[stats-card.ts]"]
end

subgraph group_domain["App logic"]
  node_authsvc[("Auth service<br/>[auth.ts]")]
  node_tasksvc[("Task service<br/>data service<br/>[task.ts]")]
  node_toastsvc[("Toast service<br/>notification service<br/>[toast.ts]")]
  node_authguard{{"Auth guard<br/>route guard<br/>[auth-guard.ts]"}}
  node_unsavedguard{{"Unsaved guard<br/>route guard"}}
  node_taskmodel["Task model<br/>domain model<br/>[task.ts]"]
  node_usermodel["User model<br/>domain model<br/>[user.ts]"]
  node_datepipe(("Date relative<br/>format pipe"))
  node_prioritypipe(("Priority label<br/>format pipe"))
end

subgraph group_backend["Local API"]
  node_jsonserver[("json-server<br/>local backend<br/>[db.json]")]
end

node_main -->|"loads"| node_appconfig
node_main -->|"starts"| node_routes
node_routes -->|"mounts"| node_shell
node_routes -->|"route"| node_login
node_routes -->|"route"| node_register
node_routes -->|"route"| node_dashboard
node_routes -->|"fallback"| node_notfound
node_dashboard -->|"uses"| node_header
node_dashboard -->|"contains"| node_statscard
node_dashboard -->|"contains"| node_tasklist
node_dashboard -->|"contains"| node_taskdetail
node_dashboard -->|"contains"| node_taskform
node_tasklist -->|"renders"| node_taskcard
node_tasklist -->|"reads"| node_tasksvc
node_taskdetail -->|"reads"| node_tasksvc
node_taskform -->|"writes"| node_tasksvc
node_taskform -.->|"protected by"| node_unsavedguard
node_login -->|"uses"| node_authsvc
node_register -->|"uses"| node_authsvc
node_authguard -->|"checks"| node_authsvc
node_tasksvc -->|"api"| node_jsonserver
node_authsvc -->|"api"| node_jsonserver
node_toastsvc -->|"drives"| node_toastui
node_tasksvc -.->|"notifies"| node_toastsvc
node_authsvc -.->|"notifies"| node_toastsvc
node_tasksvc -->|"uses"| node_taskmodel
node_authsvc -->|"uses"| node_usermodel
node_dashboard -->|"formats"| node_datepipe
node_taskcard -->|"formats"| node_prioritypipe
node_taskdetail -->|"formats"| node_datepipe

click node_main "https://github.com/user-bird/task/blob/main/src/main.ts"
click node_appconfig "https://github.com/user-bird/task/blob/main/src/app/app.config.ts"
click node_routes "https://github.com/user-bird/task/blob/main/src/app/app.routes.ts"
click node_shell "https://github.com/user-bird/task/blob/main/src/app/app.ts"
click node_login "https://github.com/user-bird/task/blob/main/src/app/components/login/login.ts"
click node_register "https://github.com/user-bird/task/blob/main/src/app/components/register/register.ts"
click node_dashboard "https://github.com/user-bird/task/blob/main/src/app/components/dashboard/dashboard.ts"
click node_notfound "https://github.com/user-bird/task/blob/main/src/app/components/not-found/not-found.ts"
click node_header "https://github.com/user-bird/task/blob/main/src/app/components/header/header.ts"
click node_toastui "https://github.com/user-bird/task/blob/main/src/app/components/toast/toast.ts"
click node_tasklist "https://github.com/user-bird/task/blob/main/src/app/components/task-list/task-list.ts"
click node_taskcard "https://github.com/user-bird/task/blob/main/src/app/components/task-card/task-card.ts"
click node_taskdetail "https://github.com/user-bird/task/blob/main/src/app/components/task-detail/task-detail.ts"
click node_taskform "https://github.com/user-bird/task/blob/main/src/app/components/task-form/task-form.ts"
click node_statscard "https://github.com/user-bird/task/blob/main/src/app/components/stats-card/stats-card.ts"
click node_authsvc "https://github.com/user-bird/task/blob/main/src/app/services/auth.ts"
click node_tasksvc "https://github.com/user-bird/task/blob/main/src/app/services/task.ts"
click node_toastsvc "https://github.com/user-bird/task/blob/main/src/app/services/toast.ts"
click node_authguard "https://github.com/user-bird/task/blob/main/src/app/guards/auth-guard.ts"
click node_unsavedguard "https://github.com/user-bird/task/blob/main/src/app/guards/unsaved-changes-guard.ts"
click node_taskmodel "https://github.com/user-bird/task/blob/main/src/app/models/task.ts"
click node_usermodel "https://github.com/user-bird/task/blob/main/src/app/models/user.ts"
click node_datepipe "https://github.com/user-bird/task/blob/main/src/app/pipes/date-relative-pipe.ts"
click node_prioritypipe "https://github.com/user-bird/task/blob/main/src/app/pipes/priority-label-pipe.ts"
click node_jsonserver "https://github.com/user-bird/task/blob/main/db.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_appconfig,node_routes,node_shell,node_login,node_register,node_dashboard,node_notfound,node_header,node_toastui,node_tasklist,node_taskcard,node_taskdetail,node_taskform,node_statscard toneBlue
class node_authsvc,node_tasksvc,node_toastsvc,node_authguard,node_unsavedguard,node_taskmodel,node_usermodel,node_datepipe,node_prioritypipe toneAmber
class node_jsonserver toneMint
```

## Components

### Angular client

Browser-facing SPA bootstrapped by Angular CLI and routed on the client.

- [Bootstrap](https://github.com/user-bird/task/blob/main/src/main.ts): entrypoint · Angular application entry that starts the client app. · `src/main.ts`
- [App config](https://github.com/user-bird/task/blob/main/src/app/app.config.ts): bootstrap config · Provides application-wide providers and setup. · `src/app/app.config.ts`
- [Routes](https://github.com/user-bird/task/blob/main/src/app/app.routes.ts): routing · Defines the client-side navigation structure. · `src/app/app.routes.ts`
- [App shell](https://github.com/user-bird/task/blob/main/src/app/app.ts): root component · Top-level application container and router outlet host. · `src/app/app.ts`
- [Login](https://github.com/user-bird/task/blob/main/src/app/components/login/login.ts): auth page · Route-level sign-in screen. · `src/app/components/login/login.ts`
- [Register](https://github.com/user-bird/task/blob/main/src/app/components/register/register.ts): auth page · Route-level account creation screen. · `src/app/components/register/register.ts`
- [Dashboard](https://github.com/user-bird/task/blob/main/src/app/components/dashboard/dashboard.ts): workspace page · Authenticated task workspace composed of summary, list, detail, and form sections. · `src/app/components/dashboard/dashboard.ts`
- [Not found](https://github.com/user-bird/task/blob/main/src/app/components/not-found/not-found.ts): error page · Fallback screen for invalid routes. · `src/app/components/not-found/not-found.ts`
- [Header](https://github.com/user-bird/task/blob/main/src/app/components/header/header.ts): chrome · Shared top navigation and page chrome. · `src/app/components/header/header.ts`
- [Toast](https://github.com/user-bird/task/blob/main/src/app/components/toast/toast.ts): feedback ui · Global transient notification surface. · `src/app/components/toast/toast.ts`
- [Task list](https://github.com/user-bird/task/blob/main/src/app/components/task-list/task-list.ts): task browser · Lists tasks and coordinates browsing into task items. · `src/app/components/task-list/task-list.ts`
- [Task card](https://github.com/user-bird/task/blob/main/src/app/components/task-card/task-card.ts): task item · Compact task presentation used within lists. · `src/app/components/task-card/task-card.ts`
- [Task detail](https://github.com/user-bird/task/blob/main/src/app/components/task-detail/task-detail.ts): task view · Detailed task inspection and contextual actions. · `src/app/components/task-detail/task-detail.ts`
- [Task form](https://github.com/user-bird/task/blob/main/src/app/components/task-form/task-form.ts): edit form · Create/edit surface for task data. · `src/app/components/task-form/task-form.ts`
- [Stats card](https://github.com/user-bird/task/blob/main/src/app/components/stats-card/stats-card.ts): summary widget · 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](https://github.com/user-bird/task/blob/main/src/app/services/auth.ts): auth service · Handles authentication state and user/session operations. · `src/app/services/auth.ts`
- [Task service](https://github.com/user-bird/task/blob/main/src/app/services/task.ts): data service · Central task data access and mutation boundary. · `src/app/services/task.ts`
- [Toast service](https://github.com/user-bird/task/blob/main/src/app/services/toast.ts): notification service · Dispatches app-wide toast messages from UI and services. · `src/app/services/toast.ts`
- [Auth guard](https://github.com/user-bird/task/blob/main/src/app/guards/auth-guard.ts): route guard · Protects authenticated routes. · `src/app/guards/auth-guard.ts`
- [Unsaved guard](https://github.com/user-bird/task/blob/main/src/app/guards/unsaved-changes-guard.ts): route guard · Prevents navigation away from in-progress task edits. · `src/app/guards/unsaved-changes-guard.ts`
- [Task model](https://github.com/user-bird/task/blob/main/src/app/models/task.ts): domain model · Shared task shape used across services and UI. · `src/app/models/task.ts`
- [User model](https://github.com/user-bird/task/blob/main/src/app/models/user.ts): domain model · Shared user/auth shape used across services and UI. · `src/app/models/user.ts`
- [Date relative](https://github.com/user-bird/task/blob/main/src/app/pipes/date-relative-pipe.ts): format pipe · Formats dates into relative time text. · `src/app/pipes/date-relative-pipe.ts`
- [Priority label](https://github.com/user-bird/task/blob/main/src/app/pipes/priority-label-pipe.ts): format pipe · 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](https://github.com/user-bird/task/blob/main/db.json): local backend · Local REST API backed by db.json for development data. · `db.json`

## Connections

- 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.
