# nipuana/teflow_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/nipuana/teflow_frontend
- Repository: https://github.com/nipuana/teflow_frontend

## Overview

Teflow’s frontend is a Next.js client for signing in, managing an organization, and coordinating project tasks. Users enter through login or registration; session state gates the application, whose pages call the backend API for dashboard, project, task, audit, member, notification, and account workflows. Project details present tasks as a ledger, board, or timeline. The graph preserves these capabilities and shared UI layers. Edges are limited to relationships shown in the README or SOURCE INDEX; several page implementations were not sampled, so their internal behavior is not inferred.

Main entry points: [`lib/api.ts`](https://github.com/nipuana/teflow_frontend/blob/master/lib/api.ts) (API client), [`app/(app)/projects/[projectId]/page.tsx`](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/%5BprojectId%5D/page.tsx) (Project workspace), [`app/(app)/members/page.tsx`](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/members/page.tsx) (Member management), [`lib/permissions.ts`](https://github.com/nipuana/teflow_frontend/blob/master/lib/permissions.ts) (UI permissions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and session"]
  node_login["Login<br/>[page.tsx]"]
  node_register["Registration<br/>[page.tsx]"]
  node_session["Session context<br/>[session.tsx]"]
end

subgraph group_work["Projects and tasks"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_projects["Project list<br/>[page.tsx]"]
  node_project["Project workspace<br/>[page.tsx]"]
  node_task["Task detail<br/>[page.tsx]"]
end

subgraph group_org["Organization features"]
  node_audit["Audit log<br/>[page.tsx]"]
  node_members["Member management<br/>[page.tsx]"]
  node_settings["Account settings<br/>[page.tsx]"]
  node_notifications["Notifications<br/>[page.tsx]"]
end

subgraph group_shared["Shared client layers"]
  node_api["API client<br/>[api.ts]"]
  node_permissions["UI permissions<br/>[permissions.ts]"]
  node_viewstate["Data view states<br/>[ViewState.tsx]"]
  node_ledger["Ledger table<br/>[Ledger.tsx]"]
  node_kanban["Kanban board<br/>[KanbanBoard.tsx]"]
  node_timeline["Task timeline<br/>[Timeline.tsx]"]
  node_command["Command bar<br/>[CommandBar.tsx]"]
  node_confirm["Confirm dialog<br/>[Confirm.tsx]"]
  node_toast["Toast feedback<br/>[Toast.tsx]"]
end

node_user(("User"))
node_backend["Teflow backend"]

node_user -->|"signs in"| node_login
node_user -->|"registers"| node_register
node_login -->|"authenticates via"| node_session
node_register -->|"creates account via"| node_session
node_session -->|"loads session through"| node_api
node_api -->|"sends API requests"| node_backend
node_dashboard -->|"fetches data via"| node_api
node_projects -->|"fetches data via"| node_api
node_project -->|"reads and updates via"| node_api
node_task -->|"fetches data via"| node_api
node_audit -->|"fetches entries via"| node_api
node_members -->|"manages members via"| node_api
node_settings -->|"updates account via"| node_api
node_notifications -->|"loads notifications via"| node_api
node_dashboard -->|"checks roles"| node_permissions
node_projects -->|"checks roles"| node_permissions
node_project -->|"checks roles"| node_permissions
node_members -->|"checks roles"| node_permissions
node_dashboard -->|"renders states with"| node_viewstate
node_projects -->|"renders states with"| node_viewstate
node_project -->|"renders states with"| node_viewstate
node_audit -->|"renders entries in"| node_ledger
node_members -->|"renders members in"| node_ledger
node_projects -->|"renders rows in"| node_ledger
node_project -->|"renders tasks in"| node_ledger
node_project -->|"renders board with"| node_kanban
node_project -->|"renders timeline with"| node_timeline
node_command -->|"reads session"| node_session
node_command -->|"checks roles"| node_permissions
node_settings -->|"requests confirmation"| node_confirm
node_members -->|"requests confirmation"| node_confirm
node_settings -->|"shows feedback"| node_toast
node_members -->|"shows feedback"| node_toast

click node_login "https://github.com/nipuana/teflow_frontend/blob/master/app/login/page.tsx"
click node_register "https://github.com/nipuana/teflow_frontend/blob/master/app/register/page.tsx"
click node_session "https://github.com/nipuana/teflow_frontend/blob/master/lib/session.tsx"
click node_api "https://github.com/nipuana/teflow_frontend/blob/master/lib/api.ts"
click node_dashboard "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/dashboard/page.tsx"
click node_projects "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/page.tsx"
click node_project "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/%5BprojectId%5D/page.tsx"
click node_task "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/%5BprojectId%5D/tasks/%5BtaskId%5D/page.tsx"
click node_audit "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/audit/page.tsx"
click node_members "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/members/page.tsx"
click node_settings "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/settings/page.tsx"
click node_notifications "https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/notifications/page.tsx"
click node_permissions "https://github.com/nipuana/teflow_frontend/blob/master/lib/permissions.ts"
click node_viewstate "https://github.com/nipuana/teflow_frontend/blob/master/components/ViewState.tsx"
click node_ledger "https://github.com/nipuana/teflow_frontend/blob/master/components/Ledger.tsx"
click node_kanban "https://github.com/nipuana/teflow_frontend/blob/master/components/KanbanBoard.tsx"
click node_timeline "https://github.com/nipuana/teflow_frontend/blob/master/components/Timeline.tsx"
click node_command "https://github.com/nipuana/teflow_frontend/blob/master/components/CommandBar.tsx"
click node_confirm "https://github.com/nipuana/teflow_frontend/blob/master/components/Confirm.tsx"
click node_toast "https://github.com/nipuana/teflow_frontend/blob/master/components/Toast.tsx"

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_login,node_register,node_session,node_user toneBlue
class node_dashboard,node_projects,node_project,node_task toneAmber
class node_audit,node_members,node_settings,node_notifications toneMint
class node_api,node_permissions,node_viewstate,node_ledger,node_kanban,node_timeline,node_command,node_confirm,node_toast toneRose
class node_backend toneIndigo
```

## Components

### Access and session

- [Login](https://github.com/nipuana/teflow_frontend/blob/master/app/login/page.tsx): `app/login/page.tsx`
- [Registration](https://github.com/nipuana/teflow_frontend/blob/master/app/register/page.tsx): `app/register/page.tsx`
- [Session context](https://github.com/nipuana/teflow_frontend/blob/master/lib/session.tsx): `lib/session.tsx`

### Projects and tasks

- [Dashboard](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/dashboard/page.tsx): `app/(app)/dashboard/page.tsx`
- [Project list](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/page.tsx): `app/(app)/projects/page.tsx`
- [Project workspace](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/%5BprojectId%5D/page.tsx): `app/(app)/projects/[projectId]/page.tsx`
- [Task detail](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/projects/%5BprojectId%5D/tasks/%5BtaskId%5D/page.tsx): `app/(app)/projects/[projectId]/tasks/[taskId]/page.tsx`

### Organization features

- [Audit log](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/audit/page.tsx): `app/(app)/audit/page.tsx`
- [Member management](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/members/page.tsx): `app/(app)/members/page.tsx`
- [Account settings](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/settings/page.tsx): `app/(app)/settings/page.tsx`
- [Notifications](https://github.com/nipuana/teflow_frontend/blob/master/app/(app)/notifications/page.tsx): `app/(app)/notifications/page.tsx`

### Shared client layers

- [API client](https://github.com/nipuana/teflow_frontend/blob/master/lib/api.ts): `lib/api.ts`
- [UI permissions](https://github.com/nipuana/teflow_frontend/blob/master/lib/permissions.ts): `lib/permissions.ts`
- [Data view states](https://github.com/nipuana/teflow_frontend/blob/master/components/ViewState.tsx): `components/ViewState.tsx`
- [Ledger table](https://github.com/nipuana/teflow_frontend/blob/master/components/Ledger.tsx): `components/Ledger.tsx`
- [Kanban board](https://github.com/nipuana/teflow_frontend/blob/master/components/KanbanBoard.tsx): `components/KanbanBoard.tsx`
- [Task timeline](https://github.com/nipuana/teflow_frontend/blob/master/components/Timeline.tsx): `components/Timeline.tsx`
- [Command bar](https://github.com/nipuana/teflow_frontend/blob/master/components/CommandBar.tsx): `components/CommandBar.tsx`
- [Confirm dialog](https://github.com/nipuana/teflow_frontend/blob/master/components/Confirm.tsx): `components/Confirm.tsx`
- [Toast feedback](https://github.com/nipuana/teflow_frontend/blob/master/components/Toast.tsx): `components/Toast.tsx`

### Other components

- **User**
- **Teflow backend**

## Connections

- User → Login: signs in (evidence: `README.md`)
- User → Registration: registers (evidence: `README.md`)
- Login → Session context: authenticates via (evidence: `app/login/page.tsx`)
- Registration → Session context: creates account via (evidence: `app/register/page.tsx`)
- Session context → API client: loads session through (evidence: `lib/session.tsx`)
- API client → Teflow backend: sends API requests (evidence: `README.md`)
- Dashboard → API client: fetches data via (evidence: `app/(app)/dashboard/page.tsx`)
- Project list → API client: fetches data via (evidence: `app/(app)/projects/page.tsx`)
- Project workspace → API client: reads and updates via (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Task detail → API client: fetches data via (evidence: `app/(app)/projects/[projectId]/tasks/[taskId]/page.tsx`)
- Audit log → API client: fetches entries via (evidence: `app/(app)/audit/page.tsx`)
- Member management → API client: manages members via (evidence: `app/(app)/members/page.tsx`)
- Account settings → API client: updates account via (evidence: `app/(app)/settings/page.tsx`)
- Notifications → API client: loads notifications via
- Dashboard → UI permissions: checks roles (evidence: `app/(app)/dashboard/page.tsx`)
- Project list → UI permissions: checks roles (evidence: `app/(app)/projects/page.tsx`)
- Project workspace → UI permissions: checks roles (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Member management → UI permissions: checks roles (evidence: `app/(app)/members/page.tsx`)
- Dashboard → Data view states: renders states with (evidence: `app/(app)/dashboard/page.tsx`)
- Project list → Data view states: renders states with (evidence: `app/(app)/projects/page.tsx`)
- Project workspace → Data view states: renders states with (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Audit log → Ledger table: renders entries in (evidence: `app/(app)/audit/page.tsx`)
- Member management → Ledger table: renders members in (evidence: `app/(app)/members/page.tsx`)
- Project list → Ledger table: renders rows in (evidence: `app/(app)/projects/page.tsx`)
- Project workspace → Ledger table: renders tasks in (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Project workspace → Kanban board: renders board with (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Project workspace → Task timeline: renders timeline with (evidence: `app/(app)/projects/[projectId]/page.tsx`)
- Command bar → Session context: reads session (evidence: `components/CommandBar.tsx`)
- Command bar → UI permissions: checks roles (evidence: `components/CommandBar.tsx`)
- Account settings → Confirm dialog: requests confirmation (evidence: `app/(app)/settings/page.tsx`)
- Member management → Confirm dialog: requests confirmation (evidence: `app/(app)/members/page.tsx`)
- Account settings → Toast feedback: shows feedback (evidence: `app/(app)/settings/page.tsx`)
- Member management → Toast feedback: shows feedback (evidence: `app/(app)/members/page.tsx`)
