# abinaya2006/nagare architecture

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

- Interactive diagram: https://gitdiagram.com/abinaya2006/nagare
- Repository: https://github.com/abinaya2006/nagare

## Overview

Nagare is an AI-assisted, energy-aware productivity app. Users onboard and set preferences, capture and manage tasks, generate or adjust a daily schedule, then track work through the dashboard, focus timer, and Constellation World. NANI offers a separate natural-language interaction path. The backend exposes authenticated task, schedule, preference, and ORDA APIs backed by repositories and Supabase; a Python AI module provides schedule generation and ORDA intent processing. README capabilities fill out feature branches beyond the sampled source; several frontend-to-backend wiring details are therefore left implicit.

Main entry points: [`backend/app/main.py`](https://github.com/abinaya2006/nagare/blob/main/backend/app/main.py) (FastAPI routers), [`frontend/contexts/TaskContext.tsx`](https://github.com/abinaya2006/nagare/blob/main/frontend/contexts/TaskContext.tsx) (Task context), [`frontend/services/api.ts`](https://github.com/abinaya2006/nagare/blob/main/frontend/services/api.ts) (API client), [`frontend/app/settings/page.tsx`](https://github.com/abinaya2006/nagare/blob/main/frontend/app/settings/page.tsx) (Preferences)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Product experience"]
  node_onboarding["Onboarding<br/>[page.tsx]"]
  node_preferences_ui["Preferences<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_task_ui["Task management<br/>[page.tsx]"]
  node_schedule_ui["Flow schedule<br/>[page.tsx]"]
  node_world["Constellation World<br/>[page.tsx]"]
  node_task_state["Task context<br/>[TaskContext.tsx]"]
  node_schedule_state["Schedule context"]
  node_api_client["API client<br/>[api.ts]"]
  node_offline["Offline queue<br/>[offlineQueue.ts]"]
  node_nani_proxy["NANI message route<br/>[route.ts]"]
end

subgraph group_backend["Application backend"]
  node_api["FastAPI routers<br/>[main.py]"]
  node_task_api["Task endpoints<br/>[tasks.py]"]
  node_task_service["Task service<br/>[tasks.py]"]
  node_task_repo["Task repository<br/>[tasks.py]"]
  node_schedule_api["Schedule endpoints<br/>[schedules.py]"]
  node_preferences["Preference services<br/>[preferences.py]"]
  node_orda["ORDA service<br/>[orda.py]"]
end

subgraph group_ai["AI services"]
  node_ai_entry["AI API<br/>[main.py]"]
  node_ai_schedule["Schedule generation"]
end

subgraph group_external["External services"]
  node_supabase[("Supabase")]
  node_gemini(("Gemini"))
end

node_user(("User"))

node_user -->|"sets up"| node_onboarding
node_user -->|"manages tasks"| node_task_ui
node_user -->|"plans day"| node_schedule_ui
node_user -->|"tracks focus"| node_dashboard
node_user -->|"explores goals"| node_world
node_user -->|"sets preferences"| node_preferences_ui
node_task_ui -->|"uses state"| node_task_state
node_dashboard -->|"uses state"| node_task_state
node_schedule_ui -->|"uses state"| node_schedule_state
node_task_state -->|"requests tasks"| node_api_client
node_schedule_state -->|"requests schedules"| node_api_client
node_task_state -->|"queues offline"| node_offline
node_api_client -->|"calls API"| node_api
node_nani_proxy -->|"returns reply"| node_user
node_api -->|"dispatches"| node_task_api
node_api -->|"dispatches"| node_schedule_api
node_task_api -->|"calls"| node_task_service
node_task_service -->|"reads/writes"| node_task_repo
node_task_repo -->|"persists tasks"| node_supabase
node_preferences_ui -->|"requests preferences"| node_api_client
node_api -->|"dispatches"| node_orda
node_ai_entry -->|"dispatches"| node_ai_schedule
node_ai_schedule -.->|"generates schedule"| node_gemini

click node_onboarding "https://github.com/abinaya2006/nagare/blob/main/frontend/app/onboarding/page.tsx"
click node_preferences_ui "https://github.com/abinaya2006/nagare/blob/main/frontend/app/settings/page.tsx"
click node_dashboard "https://github.com/abinaya2006/nagare/blob/main/frontend/app/dashboard/page.tsx"
click node_task_ui "https://github.com/abinaya2006/nagare/blob/main/frontend/app/tasks/page.tsx"
click node_schedule_ui "https://github.com/abinaya2006/nagare/blob/main/frontend/app/schedule/page.tsx"
click node_world "https://github.com/abinaya2006/nagare/blob/main/frontend/app/world/page.tsx"
click node_task_state "https://github.com/abinaya2006/nagare/blob/main/frontend/contexts/TaskContext.tsx"
click node_schedule_state "https://github.com/abinaya2006/nagare/blob/main/frontend/contexts/ScheduleContext.tsx"
click node_api_client "https://github.com/abinaya2006/nagare/blob/main/frontend/services/api.ts"
click node_offline "https://github.com/abinaya2006/nagare/blob/main/frontend/services/offlineQueue.ts"
click node_nani_proxy "https://github.com/abinaya2006/nagare/blob/main/frontend/app/api/v1/NANI/process/route.ts"
click node_api "https://github.com/abinaya2006/nagare/blob/main/backend/app/main.py"
click node_task_api "https://github.com/abinaya2006/nagare/blob/main/backend/app/api/tasks.py"
click node_task_service "https://github.com/abinaya2006/nagare/blob/main/backend/app/services/tasks.py"
click node_task_repo "https://github.com/abinaya2006/nagare/blob/main/backend/app/repositories/tasks.py"
click node_schedule_api "https://github.com/abinaya2006/nagare/blob/main/backend/app/api/schedules.py"
click node_preferences "https://github.com/abinaya2006/nagare/blob/main/backend/app/services/preferences.py"
click node_orda "https://github.com/abinaya2006/nagare/blob/main/backend/app/services/orda.py"
click node_ai_entry "https://github.com/abinaya2006/nagare/blob/main/ai/main.py"
click node_ai_schedule "https://github.com/abinaya2006/nagare/blob/main/ai/services/schedule_service.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_onboarding,node_preferences_ui,node_dashboard,node_task_ui,node_schedule_ui,node_world,node_task_state,node_schedule_state,node_api_client,node_offline,node_nani_proxy,node_user toneBlue
class node_api,node_task_api,node_task_service,node_task_repo,node_schedule_api,node_preferences,node_orda toneAmber
class node_ai_entry,node_ai_schedule toneMint
class node_supabase,node_gemini toneRose
```

## Components

### Product experience

- [Onboarding](https://github.com/abinaya2006/nagare/blob/main/frontend/app/onboarding/page.tsx): `frontend/app/onboarding/page.tsx`
- [Preferences](https://github.com/abinaya2006/nagare/blob/main/frontend/app/settings/page.tsx): `frontend/app/settings/page.tsx`
- [Dashboard](https://github.com/abinaya2006/nagare/blob/main/frontend/app/dashboard/page.tsx): `frontend/app/dashboard/page.tsx`
- [Task management](https://github.com/abinaya2006/nagare/blob/main/frontend/app/tasks/page.tsx): `frontend/app/tasks/page.tsx`
- [Flow schedule](https://github.com/abinaya2006/nagare/blob/main/frontend/app/schedule/page.tsx): `frontend/app/schedule/page.tsx`
- [Constellation World](https://github.com/abinaya2006/nagare/blob/main/frontend/app/world/page.tsx): `frontend/app/world/page.tsx`
- [Task context](https://github.com/abinaya2006/nagare/blob/main/frontend/contexts/TaskContext.tsx): `frontend/contexts/TaskContext.tsx`
- [Schedule context](https://github.com/abinaya2006/nagare/blob/main/frontend/contexts/ScheduleContext.tsx): `frontend/contexts/ScheduleContext.tsx`
- [API client](https://github.com/abinaya2006/nagare/blob/main/frontend/services/api.ts): `frontend/services/api.ts`
- [Offline queue](https://github.com/abinaya2006/nagare/blob/main/frontend/services/offlineQueue.ts): `frontend/services/offlineQueue.ts`
- [NANI message route](https://github.com/abinaya2006/nagare/blob/main/frontend/app/api/v1/NANI/process/route.ts): `frontend/app/api/v1/NANI/process/route.ts`

### Application backend

- [FastAPI routers](https://github.com/abinaya2006/nagare/blob/main/backend/app/main.py): `backend/app/main.py`
- [Task endpoints](https://github.com/abinaya2006/nagare/blob/main/backend/app/api/tasks.py): `backend/app/api/tasks.py`
- [Task service](https://github.com/abinaya2006/nagare/blob/main/backend/app/services/tasks.py): `backend/app/services/tasks.py`
- [Task repository](https://github.com/abinaya2006/nagare/blob/main/backend/app/repositories/tasks.py): `backend/app/repositories/tasks.py`
- [Schedule endpoints](https://github.com/abinaya2006/nagare/blob/main/backend/app/api/schedules.py): `backend/app/api/schedules.py`
- [Preference services](https://github.com/abinaya2006/nagare/blob/main/backend/app/services/preferences.py): `backend/app/services/preferences.py`
- [ORDA service](https://github.com/abinaya2006/nagare/blob/main/backend/app/services/orda.py): `backend/app/services/orda.py`

### AI services

- [AI API](https://github.com/abinaya2006/nagare/blob/main/ai/main.py): `ai/main.py`
- [Schedule generation](https://github.com/abinaya2006/nagare/blob/main/ai/services/schedule_service.py): `ai/services/schedule_service.py`

### External services

- **Supabase**
- **Gemini**

### Other components

- **User**

## Connections

- User → Onboarding: sets up
- User → Task management: manages tasks
- User → Flow schedule: plans day
- User → Dashboard: tracks focus
- User → Constellation World: explores goals
- User → Preferences: sets preferences
- Task management → Task context: uses state
- Dashboard → Task context: uses state
- Flow schedule → Schedule context: uses state
- Task context → API client: requests tasks
- Schedule context → API client: requests schedules
- Task context → Offline queue: queues offline
- API client → FastAPI routers: calls API
- NANI message route → User: returns reply
- FastAPI routers → Task endpoints: dispatches
- FastAPI routers → Schedule endpoints: dispatches
- Task endpoints → Task service: calls
- Task service → Task repository: reads/writes
- Task repository → Supabase: persists tasks
- Preferences → API client: requests preferences
- FastAPI routers → ORDA service: dispatches
- AI API → Schedule generation: dispatches
- Schedule generation → Gemini: generates schedule
