# achyantsh/gnani-task architecture

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

- Interactive diagram: https://gitdiagram.com/achyantsh/gnani-task
- Repository: https://github.com/achyantsh/gnani-task

## Overview

AudioNote is an audio-notes web application whose main workflow is browser upload to R2, asynchronous transcription through Gnani, language-aware summarization, and saved results users can revisit. The graph separates the frontend experience, backend orchestration, external providers, and persistence/authentication. Backend service calls and the sampled auth callback are supported by excerpts; several frontend-to-service relationships and history details are documented in the README, while unsampled implementation specifics are not inferred.

Main entry points: [`backend/routes/transcription.py`](https://github.com/achyantsh/gnani-task/blob/master/backend/routes/transcription.py) (Job orchestration), [`frontend/components/home/hero/dropzone.tsx`](https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/dropzone.tsx) (Upload and progress), [`frontend/actions/transcribe.ts`](https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/transcribe.ts) (Transcription action), [`frontend/app/transcriptions/page.tsx`](https://github.com/achyantsh/gnani-task/blob/master/frontend/app/transcriptions/page.tsx) (Transcription history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_home["Home experience<br/>[page.tsx]"]
  node_dropzone["Upload and progress<br/>[dropzone.tsx]"]
  node_upload_action["Upload action<br/>[upload.ts]"]
  node_transcribe_action["Transcription action<br/>[transcribe.ts]"]
  node_result["Transcript and summary<br/>[result-card.tsx]"]
  node_audio_player["Audio playback<br/>[audio-player.tsx]"]
  node_history_page["Transcription history<br/>[page.tsx]"]
  node_history_list["History list"]
  node_history_action["History action<br/>[transcriptions.ts]"]
  node_auth_ui["Sign-in interface<br/>[page.tsx]"]
  node_auth_callback["Auth callback<br/>[route.ts]"]
end

subgraph group_backend["Backend processing"]
  node_backend_app["FastAPI application<br/>[main.py]"]
  node_transcription_api["Job orchestration<br/>[transcription.py]"]
  node_r2_service["R2 signing<br/>[r2.py]"]
  node_gnani_service["Gnani client<br/>[gnani.py]"]
  node_summary_service["Summary generation<br/>[summary.py]"]
end

subgraph group_providers["External providers"]
  node_r2[("Cloudflare R2")]
  node_gnani["Gnani Batch STT"]
  node_gemini["Google Gemini"]
end

subgraph group_identity_data["Identity and records"]
  node_supabase[("Supabase records")]
  node_supabase_auth["Supabase Auth"]
end

node_user(("User"))

node_user -->|"uses"| node_home
node_home -->|"offers upload"| node_dropzone
node_dropzone -->|"requests URL"| node_upload_action
node_upload_action -->|"uploads audio"| node_r2
node_dropzone -->|"starts job"| node_transcribe_action
node_transcribe_action -->|"calls API"| node_backend_app
node_backend_app -->|"routes requests"| node_transcription_api
node_transcription_api -->|"requests signed URL"| node_r2_service
node_r2_service -->|"signs read URL"| node_r2
node_transcription_api -->|"manages job"| node_gnani_service
node_gnani_service -->|"creates and polls"| node_gnani
node_transcribe_action -->|"polls status"| node_transcription_api
node_transcription_api -->|"summarizes transcript"| node_summary_service
node_summary_service -->|"generates summary"| node_gemini
node_transcription_api -->|"saves completed result"| node_supabase
node_transcription_api -->|"returns completed result"| node_result
node_result -->|"renders playback"| node_audio_player
node_user -->|"revisits recordings"| node_history_page
node_history_page -->|"shows recordings"| node_history_list
node_history_page -->|"loads history"| node_history_action
node_history_action -->|"reads records"| node_supabase
node_user -->|"signs in"| node_auth_ui
node_auth_ui -->|"authenticates"| node_supabase_auth
node_auth_callback -->|"exchanges code"| node_supabase_auth

click node_home "https://github.com/achyantsh/gnani-task/blob/master/frontend/app/page.tsx"
click node_dropzone "https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/dropzone.tsx"
click node_upload_action "https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/upload.ts"
click node_transcribe_action "https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/transcribe.ts"
click node_result "https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/result-card.tsx"
click node_audio_player "https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/audio-player.tsx"
click node_history_page "https://github.com/achyantsh/gnani-task/blob/master/frontend/app/transcriptions/page.tsx"
click node_history_list "https://github.com/achyantsh/gnani-task/blob/master/frontend/components/transcriptions/transcription-list.tsx"
click node_history_action "https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/transcriptions.ts"
click node_backend_app "https://github.com/achyantsh/gnani-task/blob/master/backend/main.py"
click node_transcription_api "https://github.com/achyantsh/gnani-task/blob/master/backend/routes/transcription.py"
click node_r2_service "https://github.com/achyantsh/gnani-task/blob/master/backend/services/r2.py"
click node_gnani_service "https://github.com/achyantsh/gnani-task/blob/master/backend/services/gnani.py"
click node_summary_service "https://github.com/achyantsh/gnani-task/blob/master/backend/services/summary.py"
click node_auth_ui "https://github.com/achyantsh/gnani-task/blob/master/frontend/app/(auth)/login/page.tsx"
click node_auth_callback "https://github.com/achyantsh/gnani-task/blob/master/frontend/app/auth/callback/route.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_dropzone,node_upload_action,node_transcribe_action,node_result,node_audio_player,node_history_page,node_history_list,node_history_action,node_auth_ui,node_auth_callback,node_user toneBlue
class node_backend_app,node_transcription_api,node_r2_service,node_gnani_service,node_summary_service toneAmber
class node_r2,node_gnani,node_gemini toneMint
class node_supabase,node_supabase_auth toneRose
```

## Components

### Frontend experience

- [Home experience](https://github.com/achyantsh/gnani-task/blob/master/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Upload and progress](https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/dropzone.tsx): `frontend/components/home/hero/dropzone.tsx`
- [Upload action](https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/upload.ts): `frontend/actions/upload.ts`
- [Transcription action](https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/transcribe.ts): `frontend/actions/transcribe.ts`
- [Transcript and summary](https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/result-card.tsx): `frontend/components/home/hero/result-card.tsx`
- [Audio playback](https://github.com/achyantsh/gnani-task/blob/master/frontend/components/home/hero/audio-player.tsx): `frontend/components/home/hero/audio-player.tsx`
- [Transcription history](https://github.com/achyantsh/gnani-task/blob/master/frontend/app/transcriptions/page.tsx): `frontend/app/transcriptions/page.tsx`
- [History list](https://github.com/achyantsh/gnani-task/blob/master/frontend/components/transcriptions/transcription-list.tsx): `frontend/components/transcriptions/transcription-list.tsx`
- [History action](https://github.com/achyantsh/gnani-task/blob/master/frontend/actions/transcriptions.ts): `frontend/actions/transcriptions.ts`
- [Sign-in interface](https://github.com/achyantsh/gnani-task/blob/master/frontend/app/(auth)/login/page.tsx): `frontend/app/(auth)/login/page.tsx`
- [Auth callback](https://github.com/achyantsh/gnani-task/blob/master/frontend/app/auth/callback/route.ts): `frontend/app/auth/callback/route.ts`

### Backend processing

- [FastAPI application](https://github.com/achyantsh/gnani-task/blob/master/backend/main.py): `backend/main.py`
- [Job orchestration](https://github.com/achyantsh/gnani-task/blob/master/backend/routes/transcription.py): `backend/routes/transcription.py`
- [R2 signing](https://github.com/achyantsh/gnani-task/blob/master/backend/services/r2.py): `backend/services/r2.py`
- [Gnani client](https://github.com/achyantsh/gnani-task/blob/master/backend/services/gnani.py): `backend/services/gnani.py`
- [Summary generation](https://github.com/achyantsh/gnani-task/blob/master/backend/services/summary.py): `backend/services/summary.py`

### External providers

- **Cloudflare R2**
- **Gnani Batch STT**
- **Google Gemini**

### Identity and records

- **Supabase records**
- **Supabase Auth**

### Other components

- **User**

## Connections

- User → Home experience: uses
- Home experience → Upload and progress: offers upload
- Upload and progress → Upload action: requests URL
- Upload action → Cloudflare R2: uploads audio
- Upload and progress → Transcription action: starts job
- Transcription action → FastAPI application: calls API
- FastAPI application → Job orchestration: routes requests (evidence: `backend/main.py`)
- Job orchestration → R2 signing: requests signed URL (evidence: `backend/routes/transcription.py`)
- R2 signing → Cloudflare R2: signs read URL
- Job orchestration → Gnani client: manages job (evidence: `backend/routes/transcription.py`)
- Gnani client → Gnani Batch STT: creates and polls (evidence: `backend/services/gnani.py`)
- Transcription action → Job orchestration: polls status
- Job orchestration → Summary generation: summarizes transcript (evidence: `backend/routes/transcription.py`)
- Summary generation → Google Gemini: generates summary (evidence: `backend/services/summary.py`)
- Job orchestration → Supabase records: saves completed result (evidence: `backend/routes/transcription.py`)
- Job orchestration → Transcript and summary: returns completed result
- Transcript and summary → Audio playback: renders playback (evidence: `frontend/components/home/hero/result-card.tsx`)
- User → Transcription history: revisits recordings
- Transcription history → History list: shows recordings
- Transcription history → History action: loads history
- History action → Supabase records: reads records
- User → Sign-in interface: signs in
- Sign-in interface → Supabase Auth: authenticates
- Auth callback → Supabase Auth: exchanges code (evidence: `frontend/app/auth/callback/route.ts`)
