# latawan-20041601/nextjs-crud-latawan architecture

> Architecture diagram of the GitHub repository latawan-20041601/nextjs-crud-latawan, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/latawan-20041601/nextjs-crud-latawan
- Repository: https://github.com/latawan-20041601/nextjs-crud-latawan

## Overview

TaskFlow is a Next.js task-management dashboard. Users open the dashboard, then create, edit, complete, search, filter, sort, and delete tasks, while managing categories and a saved theme preference. The client calls task and category API routes; those validate requests and access SQLite through the shared database module. The README also documents schema migration and retained task data. Edges reflect shown client fetches, route imports, and SQL access; theme persistence and several dashboard capabilities are documented, but some implementation details were not sampled.

Main entry points: [`components/TaskManager.tsx`](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/components/TaskManager.tsx) (Task dashboard), [`app/api/tasks/route.ts`](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/route.ts) (Task collection API), [`app/api/tasks/[id]/route.ts`](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/%5Bid%5D/route.ts) (Task item API), [`lib/task-validation.ts`](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/task-validation.ts) (Task validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Dashboard"]
  node_home["Home entry<br/>[page.tsx]"]
  node_manager["Task dashboard<br/>[TaskManager.tsx]"]
  node_theme["Theme preference<br/>[TaskManager.tsx]"]
end

subgraph group_api["HTTP API"]
  node_task_api["Task collection API<br/>[route.ts]"]
  node_item_api["Task item API<br/>[route.ts]"]
  node_category_api["Category API<br/>[route.ts]"]
end

subgraph group_data["Persistence and types"]
  node_validation["Task validation<br/>[task-validation.ts]"]
  node_types["Task types<br/>[task-types.ts]"]
  node_database[("SQLite database<br/>[db.ts]")]
end

node_user(("Dashboard user"))

node_user -->|"opens"| node_home
node_home -->|"renders"| node_manager
node_manager -->|"fetches tasks"| node_task_api
node_manager -->|"updates tasks"| node_item_api
node_manager -->|"manages categories"| node_category_api
node_manager -->|"saves preference"| node_theme
node_task_api -->|"reads and writes"| node_database
node_item_api -->|"reads and writes"| node_database
node_category_api -->|"reads and writes"| node_database
node_task_api -->|"validates and serializes"| node_validation
node_item_api -->|"validates and serializes"| node_validation
node_task_api -->|"uses row type"| node_types
node_item_api -->|"uses row type"| node_types
node_validation -->|"uses types"| node_types

click node_home "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/page.tsx"
click node_manager "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/components/TaskManager.tsx"
click node_theme "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/components/TaskManager.tsx"
click node_task_api "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/route.ts"
click node_item_api "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/%5Bid%5D/route.ts"
click node_category_api "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/categories/route.ts"
click node_validation "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/task-validation.ts"
click node_types "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/task-types.ts"
click node_database "https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/db.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_home,node_manager,node_theme,node_user toneBlue
class node_task_api,node_item_api,node_category_api toneAmber
class node_validation,node_types,node_database toneMint
```

## Components

### Dashboard

- [Home entry](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/page.tsx): `app/page.tsx`
- [Task dashboard](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/components/TaskManager.tsx): `components/TaskManager.tsx`
- [Theme preference](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/components/TaskManager.tsx): `components/TaskManager.tsx`

### HTTP API

- [Task collection API](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/route.ts): `app/api/tasks/route.ts`
- [Task item API](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/tasks/%5Bid%5D/route.ts): `app/api/tasks/[id]/route.ts`
- [Category API](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/app/api/categories/route.ts): `app/api/categories/route.ts`

### Persistence and types

- [Task validation](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/task-validation.ts): `lib/task-validation.ts`
- [Task types](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/task-types.ts): `lib/task-types.ts`
- [SQLite database](https://github.com/latawan-20041601/nextjs-crud-latawan/blob/main/lib/db.ts): `lib/db.ts`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Home entry: opens (evidence: `app/page.tsx`)
- Home entry → Task dashboard: renders (evidence: `app/page.tsx`)
- Task dashboard → Task collection API: fetches tasks (evidence: `components/TaskManager.tsx`)
- Task dashboard → Task item API: updates tasks (evidence: `components/TaskManager.tsx`)
- Task dashboard → Category API: manages categories (evidence: `components/TaskManager.tsx`)
- Task dashboard → Theme preference: saves preference (evidence: `components/TaskManager.tsx`)
- Task collection API → SQLite database: reads and writes (evidence: `app/api/tasks/route.ts`)
- Task item API → SQLite database: reads and writes (evidence: `app/api/tasks/[id]/route.ts`)
- Category API → SQLite database: reads and writes (evidence: `app/api/categories/route.ts`)
- Task collection API → Task validation: validates and serializes (evidence: `app/api/tasks/route.ts`)
- Task item API → Task validation: validates and serializes (evidence: `app/api/tasks/[id]/route.ts`)
- Task collection API → Task types: uses row type (evidence: `app/api/tasks/route.ts`)
- Task item API → Task types: uses row type (evidence: `app/api/tasks/[id]/route.ts`)
- Task validation → Task types: uses types (evidence: `lib/task-validation.ts`)
