# tup-e/cmsc128-lab1_crud_nice architecture

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

- Interactive diagram: https://gitdiagram.com/tup-e/cmsc128-lab1_crud_nice
- Repository: https://github.com/tup-e/cmsc128-lab1_crud_nice

## Overview

This is a full-stack to-do list application: users create and manage tasks in a React interface, which calls a FastAPI REST API backed by Supabase. The main workflow includes task entry, API validation, persistence, and display with sorting and filtering; editing, completion, soft deletion, and undo are also supported. The README documents the API capabilities and Supabase use. Relationships involving the UI and backend are based on the shown source; database behavior is represented only as far as the route and configuration excerpts support it.

Main entry points: [`frontend/src/App.jsx`](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/App.jsx) (Task state and workflow), [`backend/app/routes/tasks.py`](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/routes/tasks.py) (Task endpoints), [`frontend/src/components/TaskList.jsx`](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskList.jsx) (Task list), [`frontend/src/api/tasks.js`](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/api/tasks.js) (Task API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Task interface"]
  node_entry["React entry<br/>[main.jsx]"]
  node_app["Task state and workflow<br/>[App.jsx]"]
  node_form["Task form<br/>[TaskForm.jsx]"]
  node_controls["Sort and filters<br/>[TaskControls.jsx]"]
  node_list["Task list<br/>[TaskList.jsx]"]
  node_item["Task item<br/>[TaskItem.jsx]"]
end

subgraph group_client["API client"]
  node_clientapi["Task API client<br/>[tasks.js]"]
end

subgraph group_backend["API service"]
  node_server["FastAPI app<br/>[main.py]"]
  node_routes["Task endpoints<br/>[tasks.py]"]
  node_schemas["Task validation models<br/>[schemas.py]"]
end

subgraph group_storage["Persistence"]
  node_config["Supabase client setup<br/>[config.py]"]
end

node_user(("User"))
node_supabase[("Supabase task store")]

node_user -->|"manages tasks"| node_app
node_entry -->|"renders"| node_app
node_app -->|"renders"| node_form
node_app -->|"renders"| node_controls
node_app -->|"renders"| node_list
node_list -->|"renders"| node_item
node_app -->|"calls task operations"| node_clientapi
node_clientapi -->|"sends REST requests"| node_routes
node_server -->|"registers"| node_routes
node_routes -->|"validates and returns"| node_schemas
node_routes -->|"uses client"| node_config
node_routes -->|"reads and writes tasks"| node_supabase
node_config -->|"creates client"| node_supabase

click node_entry "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/App.jsx"
click node_form "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskForm.jsx"
click node_controls "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskControls.jsx"
click node_list "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskList.jsx"
click node_item "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskItem.jsx"
click node_clientapi "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/api/tasks.js"
click node_server "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/main.py"
click node_routes "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/routes/tasks.py"
click node_schemas "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/schemas.py"
click node_config "https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/config.py"

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_entry,node_app,node_form,node_controls,node_list,node_item,node_user toneBlue
class node_clientapi,node_supabase toneAmber
class node_server,node_routes,node_schemas toneMint
class node_config toneRose
```

## Components

### Task interface

- [React entry](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Task state and workflow](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Task form](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskForm.jsx): `frontend/src/components/TaskForm.jsx`
- [Sort and filters](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskControls.jsx): `frontend/src/components/TaskControls.jsx`
- [Task list](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskList.jsx): `frontend/src/components/TaskList.jsx`
- [Task item](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/components/TaskItem.jsx): `frontend/src/components/TaskItem.jsx`

### API client

- [Task API client](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/frontend/src/api/tasks.js): `frontend/src/api/tasks.js`

### API service

- [FastAPI app](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/main.py): `backend/app/main.py`
- [Task endpoints](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/routes/tasks.py): `backend/app/routes/tasks.py`
- [Task validation models](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Persistence

- [Supabase client setup](https://github.com/tup-e/cmsc128-lab1_crud_nice/blob/main/backend/app/config.py): `backend/app/config.py`

### Other components

- **User**
- **Supabase task store**

## Connections

- User → Task state and workflow: manages tasks (evidence: `README.md`)
- React entry → Task state and workflow: renders (evidence: `frontend/src/main.jsx`)
- Task state and workflow → Task form: renders (evidence: `frontend/src/App.jsx`)
- Task state and workflow → Sort and filters: renders (evidence: `frontend/src/App.jsx`)
- Task state and workflow → Task list: renders (evidence: `frontend/src/App.jsx`)
- Task list → Task item: renders (evidence: `frontend/src/components/TaskList.jsx`)
- Task state and workflow → Task API client: calls task operations (evidence: `frontend/src/App.jsx`)
- Task API client → Task endpoints: sends REST requests (evidence: `README.md`)
- FastAPI app → Task endpoints: registers (evidence: `backend/app/main.py`)
- Task endpoints → Task validation models: validates and returns (evidence: `backend/app/routes/tasks.py`)
- Task endpoints → Supabase client setup: uses client (evidence: `backend/app/routes/tasks.py`)
- Task endpoints → Supabase task store: reads and writes tasks (evidence: `backend/app/routes/tasks.py`)
- Supabase client setup → Supabase task store: creates client (evidence: `backend/app/config.py`)
