# cihanelias/serverless-todo-app architecture

> Architecture diagram of the GitHub repository cihanelias/serverless-todo-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cihanelias/serverless-todo-app
- Repository: https://github.com/cihanelias/serverless-todo-app

## Overview

A serverless todo SPA: users manage tasks in the Angular page, whose store calls HTTP API functions; backend services validate operations and repositories persist them. The README establishes the frontend/backend split and Vercel hosting. Source excerpts show most frontend-to-store and backend-to-database calls; the HTTP boundary between browser and functions is documented by the API URL and README architecture, while no endpoint excerpt was supplied. UI dialog and item behavior is represented by their components, but their template-level interactions were not sampled.

Main entry points: [`src/app/components/todo-page/todo-page.ts`](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-page/todo-page.ts) (Todo page), [`api/todos`](https://github.com/cihanelias/serverless-todo-app/tree/main/api/todos) (HTTP routes), [`src/app/app.ts`](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/app.ts) (SPA shell), [`api/lib/services/todoService.ts`](https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/services/todoService.ts) (Todo service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular frontend"]
  node_app["SPA shell<br/>[app.ts]"]
  node_page["Todo page<br/>[todo-page.ts]"]
  node_list["Todo list<br/>[todo-list.ts]"]
  node_item["Todo item<br/>[todo-item.ts]"]
  node_dialog["Edit dialog<br/>[todo-dialog.ts]"]
  node_store["Todo state"]
  node_client["HTTP client"]
  node_webtodo["Frontend Todo model<br/>[todo.model.ts]"]
end

subgraph group_api["Serverless API"]
  node_routes["HTTP routes"]
  node_health["Health function<br/>[health.ts]"]
  node_service["Todo service<br/>[todoService.ts]"]
  node_model["API Todo model<br/>[todo.ts]"]
end

subgraph group_data["Persistence"]
  node_repository["Todo repository<br/>[todoRepository.ts]"]
  node_postgres[("Postgres database")]
end

node_user(("Todo user"))
node_vercel["Vercel platform"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_page
node_page -->|"loads and mutates"| node_store
node_page -->|"renders"| node_list
node_page -->|"renders"| node_dialog
node_list -->|"uses row template"| node_item
node_store -->|"calls"| node_client
node_client -.->|"sends HTTP requests"| node_routes
node_routes -->|"dispatches"| node_service
node_routes -->|"dispatches"| node_service
node_service -->|"calls"| node_repository
node_repository -->|"queries"| node_postgres
node_vercel -->|"hosts"| node_app
node_vercel -->|"hosts functions"| node_routes

click node_app "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/app.ts"
click node_page "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-page/todo-page.ts"
click node_list "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-list/todo-list.ts"
click node_item "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-item/todo-item.ts"
click node_dialog "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-dialog/todo-dialog.ts"
click node_store "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/services/todo-store.service.ts"
click node_client "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/services/todo-api.service.ts"
click node_webtodo "https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/models/todo.model.ts"
click node_routes "https://github.com/cihanelias/serverless-todo-app/tree/main/api/todos"
click node_health "https://github.com/cihanelias/serverless-todo-app/blob/main/api/health.ts"
click node_service "https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/services/todoService.ts"
click node_model "https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/models/todo.ts"
click node_repository "https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/repositories/todoRepository.ts"

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_app,node_page,node_list,node_item,node_dialog,node_store,node_client,node_webtodo,node_user toneBlue
class node_routes,node_health,node_service,node_model toneAmber
class node_repository,node_postgres toneMint
class node_vercel toneIndigo
```

## Components

### Angular frontend

- [SPA shell](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/app.ts): `src/app/app.ts`
- [Todo page](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-page/todo-page.ts): `src/app/components/todo-page/todo-page.ts`
- [Todo list](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-list/todo-list.ts): `src/app/components/todo-list/todo-list.ts`
- [Todo item](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-item/todo-item.ts): `src/app/components/todo-item/todo-item.ts`
- [Edit dialog](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/components/todo-dialog/todo-dialog.ts): `src/app/components/todo-dialog/todo-dialog.ts`
- [Todo state](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/services/todo-store.service.ts): `src/app/services/todo-store.service.ts`
- [HTTP client](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/services/todo-api.service.ts): `src/app/services/todo-api.service.ts`
- [Frontend Todo model](https://github.com/cihanelias/serverless-todo-app/blob/main/src/app/models/todo.model.ts): `src/app/models/todo.model.ts`

### Serverless API

- [HTTP routes](https://github.com/cihanelias/serverless-todo-app/tree/main/api/todos): `api/todos`
- [Health function](https://github.com/cihanelias/serverless-todo-app/blob/main/api/health.ts): `api/health.ts`
- [Todo service](https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/services/todoService.ts): `api/lib/services/todoService.ts`
- [API Todo model](https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/models/todo.ts): `api/lib/models/todo.ts`

### Persistence

- [Todo repository](https://github.com/cihanelias/serverless-todo-app/blob/main/api/lib/repositories/todoRepository.ts): `api/lib/repositories/todoRepository.ts`
- **Postgres database**

### Other components

- **Todo user**
- **Vercel platform**

## Connections

- Todo user → SPA shell: uses (evidence: `README.md`)
- SPA shell → Todo page: renders (evidence: `src/app/app.ts`)
- Todo page → Todo state: loads and mutates (evidence: `src/app/components/todo-page/todo-page.ts`)
- Todo page → Todo list: renders (evidence: `src/app/components/todo-page/todo-page.ts`)
- Todo page → Edit dialog: renders (evidence: `src/app/components/todo-page/todo-page.ts`)
- Todo list → Todo item: uses row template (evidence: `src/app/components/todo-list/todo-list.ts`)
- Todo state → HTTP client: calls (evidence: `src/app/services/todo-store.service.ts`)
- HTTP client → HTTP routes: sends HTTP requests
- HTTP routes → Todo service: dispatches (evidence: `api/todos/index.ts`)
- HTTP routes → Todo service: dispatches (evidence: `api/todos/[id].ts`)
- Todo service → Todo repository: calls (evidence: `api/lib/services/todoService.ts`)
- Todo repository → Postgres database: queries (evidence: `api/lib/repositories/todoRepository.ts`)
- Vercel platform → SPA shell: hosts (evidence: `README.md`)
- Vercel platform → HTTP routes: hosts functions (evidence: `README.md`)
