# hamidnawaz583/whispr architecture

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

- Interactive diagram: https://gitdiagram.com/hamidnawaz583/whispr
- Repository: https://github.com/hamidnawaz583/whispr

## Overview

Whispr is a web app for user accounts and private, expiring text and voice conversations. The apparent workflow is account access, finding another person, opening a conversation, and exchanging messages; conversation and message routes enforce membership and expiry. Password reset and profile/student-facing pages are represented from the file tree, but their runtime behavior and UI-to-API wiring were not sampled. Edges below are limited to route-to-auth/database calls visible in excerpts or the source index.

Main entry points: [`lib/auth.ts`](https://github.com/hamidnawaz583/whispr/blob/main/lib/auth.ts) (Session handling), [`lib/db.ts`](https://github.com/hamidnawaz583/whispr/blob/main/lib/db.ts) (SQLite database), [`app/api/login/route.ts`](https://github.com/hamidnawaz583/whispr/blob/main/app/api/login/route.ts) (Auth endpoints), [`app/api/register/route.ts`](https://github.com/hamidnawaz583/whispr/blob/main/app/api/register/route.ts) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_home["Home<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_chat_ui["Chat interface<br/>[page.tsx]"]
  node_messages_ui["Messages view<br/>[page.tsx]"]
  node_account_ui["Account view<br/>[page.tsx]"]
  node_person_ui["Person profile<br/>[page.tsx]"]
  node_students_ui["Students view<br/>[page.tsx]"]
  node_login_ui["Login and signup<br/>[page.tsx]"]
  node_signup_ui["Account creation<br/>[page.tsx]"]
  node_forgot_ui["Password recovery<br/>[page.tsx]"]
  node_reset_ui["Reset password<br/>[page.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_api["Auth endpoints<br/>[route.ts]"]
  node_register_api["Registration<br/>[route.ts]"]
  node_session_api["Session endpoints<br/>[route.ts]"]
  node_logout_api["Logout endpoint<br/>[route.ts]"]
  node_reset_api["Password reset endpoints"]
  node_auth["Session handling<br/>[auth.ts]"]
end

subgraph group_messaging["People and messaging"]
  node_people_api["People search and lookup<br/>[route.ts]"]
  node_person_api["Person lookup<br/>[route.ts]"]
  node_conversations_api["Conversations<br/>[route.ts]"]
  node_messages_api["Text and voice messages<br/>[route.ts]"]
  node_audio_api["Audio retrieval<br/>[route.ts]"]
end

subgraph group_data["Persistence"]
  node_database[("SQLite database<br/>[db.ts]")]
end

node_visitor(("User"))

node_visitor -.->|"opens"| node_home
node_auth_api -->|"creates session"| node_auth
node_register_api -->|"creates session"| node_auth
node_session_api -->|"gets user"| node_auth
node_logout_api -->|"deletes session"| node_auth
node_people_api -->|"gets user"| node_auth
node_person_api -->|"gets user"| node_auth
node_conversations_api -->|"gets user"| node_auth
node_messages_api -->|"gets user"| node_auth
node_audio_api -->|"gets user"| node_auth
node_auth_api -->|"reads user"| node_database
node_register_api -->|"writes user"| node_database
node_people_api -->|"searches users"| node_database
node_person_api -->|"reads user"| node_database
node_conversations_api -->|"reads and writes"| node_database
node_messages_api -->|"reads and writes"| node_database
node_audio_api -->|"reads message"| node_database
node_auth -->|"reads and writes"| node_database

click node_home "https://github.com/hamidnawaz583/whispr/blob/main/app/page.tsx"
click node_dashboard "https://github.com/hamidnawaz583/whispr/blob/main/app/dashboard/page.tsx"
click node_chat_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/chat/page.tsx"
click node_messages_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/messages/page.tsx"
click node_account_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/account/page.tsx"
click node_person_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/person/page.tsx"
click node_students_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/students/page.tsx"
click node_login_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/login/page.tsx"
click node_signup_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/create-account/page.tsx"
click node_forgot_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/forgot-password/page.tsx"
click node_reset_ui "https://github.com/hamidnawaz583/whispr/blob/main/app/reset-password/page.tsx"
click node_auth_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/login/route.ts"
click node_register_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/register/route.ts"
click node_session_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/me/route.ts"
click node_logout_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/logout/route.ts"
click node_reset_api "https://github.com/hamidnawaz583/whispr/tree/main/app/api/password-reset"
click node_auth "https://github.com/hamidnawaz583/whispr/blob/main/lib/auth.ts"
click node_people_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/people/route.ts"
click node_person_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/people/%5Bid%5D/route.ts"
click node_conversations_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/route.ts"
click node_messages_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/%5Bid%5D/messages/route.ts"
click node_audio_api "https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/%5Bid%5D/messages/%5BmessageId%5D/audio/route.ts"
click node_database "https://github.com/hamidnawaz583/whispr/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_dashboard,node_chat_ui,node_messages_ui,node_account_ui,node_person_ui,node_students_ui,node_login_ui,node_signup_ui,node_forgot_ui,node_reset_ui,node_visitor toneBlue
class node_auth_api,node_register_api,node_session_api,node_logout_api,node_reset_api,node_auth toneAmber
class node_people_api,node_person_api,node_conversations_api,node_messages_api,node_audio_api toneMint
class node_database toneRose
```

## Components

### User experience

- [Home](https://github.com/hamidnawaz583/whispr/blob/main/app/page.tsx): `app/page.tsx`
- [Dashboard](https://github.com/hamidnawaz583/whispr/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Chat interface](https://github.com/hamidnawaz583/whispr/blob/main/app/chat/page.tsx): `app/chat/page.tsx`
- [Messages view](https://github.com/hamidnawaz583/whispr/blob/main/app/messages/page.tsx): `app/messages/page.tsx`
- [Account view](https://github.com/hamidnawaz583/whispr/blob/main/app/account/page.tsx): `app/account/page.tsx`
- [Person profile](https://github.com/hamidnawaz583/whispr/blob/main/app/person/page.tsx): `app/person/page.tsx`
- [Students view](https://github.com/hamidnawaz583/whispr/blob/main/app/students/page.tsx): `app/students/page.tsx`
- [Login and signup](https://github.com/hamidnawaz583/whispr/blob/main/app/login/page.tsx): `app/login/page.tsx`
- [Account creation](https://github.com/hamidnawaz583/whispr/blob/main/app/create-account/page.tsx): `app/create-account/page.tsx`
- [Password recovery](https://github.com/hamidnawaz583/whispr/blob/main/app/forgot-password/page.tsx): `app/forgot-password/page.tsx`
- [Reset password](https://github.com/hamidnawaz583/whispr/blob/main/app/reset-password/page.tsx): `app/reset-password/page.tsx`

### Identity and access

- [Auth endpoints](https://github.com/hamidnawaz583/whispr/blob/main/app/api/login/route.ts): `app/api/login/route.ts`
- [Registration](https://github.com/hamidnawaz583/whispr/blob/main/app/api/register/route.ts): `app/api/register/route.ts`
- [Session endpoints](https://github.com/hamidnawaz583/whispr/blob/main/app/api/me/route.ts): `app/api/me/route.ts`
- [Logout endpoint](https://github.com/hamidnawaz583/whispr/blob/main/app/api/logout/route.ts): `app/api/logout/route.ts`
- [Password reset endpoints](https://github.com/hamidnawaz583/whispr/tree/main/app/api/password-reset): `app/api/password-reset`
- [Session handling](https://github.com/hamidnawaz583/whispr/blob/main/lib/auth.ts): `lib/auth.ts`

### People and messaging

- [People search and lookup](https://github.com/hamidnawaz583/whispr/blob/main/app/api/people/route.ts): `app/api/people/route.ts`
- [Person lookup](https://github.com/hamidnawaz583/whispr/blob/main/app/api/people/%5Bid%5D/route.ts): `app/api/people/[id]/route.ts`
- [Conversations](https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/route.ts): `app/api/conversations/route.ts`
- [Text and voice messages](https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/%5Bid%5D/messages/route.ts): `app/api/conversations/[id]/messages/route.ts`
- [Audio retrieval](https://github.com/hamidnawaz583/whispr/blob/main/app/api/conversations/%5Bid%5D/messages/%5BmessageId%5D/audio/route.ts): `app/api/conversations/[id]/messages/[messageId]/audio/route.ts`

### Persistence

- [SQLite database](https://github.com/hamidnawaz583/whispr/blob/main/lib/db.ts): `lib/db.ts`

### Other components

- **User**

## Connections

- User → Home: opens
- Auth endpoints → Session handling: creates session (evidence: `app/api/login/route.ts`)
- Registration → Session handling: creates session (evidence: `app/api/register/route.ts`)
- Session endpoints → Session handling: gets user (evidence: `app/api/me/route.ts`)
- Logout endpoint → Session handling: deletes session (evidence: `app/api/logout/route.ts`)
- People search and lookup → Session handling: gets user (evidence: `app/api/people/route.ts`)
- Person lookup → Session handling: gets user (evidence: `app/api/people/[id]/route.ts`)
- Conversations → Session handling: gets user (evidence: `app/api/conversations/route.ts`)
- Text and voice messages → Session handling: gets user (evidence: `app/api/conversations/[id]/messages/route.ts`)
- Audio retrieval → Session handling: gets user (evidence: `app/api/conversations/[id]/messages/[messageId]/audio/route.ts`)
- Auth endpoints → SQLite database: reads user (evidence: `app/api/login/route.ts`)
- Registration → SQLite database: writes user (evidence: `app/api/register/route.ts`)
- People search and lookup → SQLite database: searches users (evidence: `app/api/people/route.ts`)
- Person lookup → SQLite database: reads user (evidence: `app/api/people/[id]/route.ts`)
- Conversations → SQLite database: reads and writes (evidence: `app/api/conversations/route.ts`)
- Text and voice messages → SQLite database: reads and writes (evidence: `app/api/conversations/[id]/messages/route.ts`)
- Audio retrieval → SQLite database: reads message (evidence: `app/api/conversations/[id]/messages/[messageId]/audio/route.ts`)
- Session handling → SQLite database: reads and writes (evidence: `lib/auth.ts`)
