# codexuf/meetscribeai architecture

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

- Interactive diagram: https://gitdiagram.com/codexuf/meetscribeai
- Repository: https://github.com/codexuf/meetscribeai

## Overview

1. **Overall shape**
   - MeetScribe is a **Next.js App Router** application in TypeScript.
   - It has two main surfaces: a **public marketing/auth area** and a **protected dashboard/workspace** for meeting management, transcription, and AI-assisted review.

2. **Frontend route structure**
   - Public pages live under `app/` such as landing (`app/page.tsx`), about, contact, help, FAQs, team, and auth sign-in/sign-up.
   - The authenticated product UI lives under `app/dashboard/*`, including meetings, analytics, calendar, settings, new meeting, and transcription detail pages.
   - `app/layout.tsx`, `app/globals.css`, Tailwind, and the `components/ui` library provide the shared app shell and design system.

3. **Primary user workflow**
   - A user signs in, lands in the dashboard, creates or opens a meeting, records or uploads audio, generates transcription, reviews speaker-labeled segments, and then requests AI summaries or chat interactions.
   - This workflow is reflected in the page hierarchy and the dedicated API routes for audio, transcription, meetings, AI chat, and summaries.

4. **API layer as the backend boundary**
   - The backend is implemented as **Next.js route handlers** under `app/api/*`.
   - These routes are grouped by domain: `auth`, `users`, `meetings`, `audio`, `transcription`, `ai-summary`, `ai-chat`, `embeddings`, `stats`, and `send-email`.
   - The API layer is the main boundary between the browser UI and all persistence/AI/storage services.

5. **Domain controllers**
   - Business logic is separated into `controllers/*` for auth, meetings, users, and AI chat/summary.
   - This suggests a thin route-handler layer that delegates to domain controllers rather than embedding logic directly in each endpoint.
   - For architecture diagrams, these controllers are the service layer between route handlers and data/integration libraries.

6. **Data model and persistence**
   - MongoDB with Mongoose is the primary system of record, with models for `User`, `Meeting`, and `AiChatSummary`.
   - Meeting records likely store transcript metadata, speaker mappings, media references, and generated AI artifacts.
   - `scripts/seed-database.js` indicates a seeded demo dataset used for local exploration and onboarding.

7. **AI and retrieval subsystem**
   - `lib/gemini.ts`, `lib/embedding-service.ts`, and `app/api/embeddings/generate` indicate AI-powered generation and vectorization.
   - OpenAI is used for chat/summaries/embeddings according to the README, while Pinecone serves as the vector store for semantic retrieval.
   - The AI chat flow appears meeting-scoped, with `app/api/ai-chat/[meetingId]` and a download endpoint for exporting results.

8. **Audio and transcription pipeline**
   - Audio handling is split into `start-recording`, `stop-recording`, `upload`, and `delete` endpoints.
   - Transcription has its own generation path plus export/copy/download routes, which implies a lifecycle of capture → upload/store → transcription generation → review/export.
   - The README identifies AssemblyAI as the transcription service, so transcription is an external integration rather than an in-app model.

9. **File/media and external services**
   - `lib/cloudinary.ts` shows Cloudinary is used for file storage, likely for audio assets and/or derived media.
   - `lib/mongodb.ts` centralizes the database connection, while `lib/pinecone.ts` connects the retrieval layer to the vector database.
   - `app/api/send-email` uses Resend for notifications/sharing, making email a separate outbound integration.

10. **Authentication and access control**
   - Authentication is custom session-based, with routes for login, logout, and “me”.
   - `middleware.ts` likely protects dashboard/API access and enforces authenticated navigation.
   - `context/UserContext.tsx` suggests the client keeps current-user state in a shared context for UI personalization and authorization-aware rendering.

11. **Dashboard subsystem**
   - `components/dashboard/*` contains the navigation shell, header, meeting cards, and stats widgets used across the authenticated area.
   - `app/dashboard/meetings`, `analytics`, `calendar`, `settings`, and `transcriptions` are the main operational views, centered on meeting lifecycle management and insight display.
   - `components/modals/*` handles common actions like upload, edit speaker, delete meeting, and transcription viewing.

12. **Transcription review UX**
   - `components/transcription/*` provides the specialized transcript editor/player experience, including audio playback, speaker selection, and per-segment rendering.
   - The route `app/dashboard/transcriptions/[id]` is the detailed review screen for a single meeting transcript.
   - This is the main human-in-the-loop boundary where automated transcription and speaker identification are corrected or reviewed.

13. **Analytics and stats**
   - `app/api/stats/[userId]` and the analytics dashboard indicate usage metrics are derived from persisted meeting/user data.
   - `components/dashboard/meeting-stats.tsx` likely visualizes operational KPIs such as meeting counts, transcription usage, or generated summaries.
   - Analytics appears to be an internal reporting subsystem rather than a separate service.

14. **Implementation style and reusable UI**
   - The project uses a broad `components/ui` library based on shadcn/ui primitives, with Tailwind CSS driving styling.
   - Shared helpers live in `lib/utils.ts`, `lib/toast.ts`, and client hooks under `hooks/*`.
   - Overall, the architecture is a fairly standard **Next.js monolith** with clear separation between presentation, API routes, domain controllers, persistent models, and third-party AI/storage integrations.

Main entry points: [`app/dashboard/page.tsx`](https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/page.tsx) (Dashboard shell), [`app/api`](https://github.com/codexuf/meetscribeai/tree/main/app/api) (Route handlers), [`controllers/authController.ts`](https://github.com/codexuf/meetscribeai/blob/main/controllers/authController.ts) (Controllers), [`app/layout.tsx`](https://github.com/codexuf/meetscribeai/blob/main/app/layout.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app_shell["App shell<br/>nextjs app<br/>[layout.tsx]"]
  node_marketing_site["Marketing site<br/>public pages<br/>[page.tsx]"]
  node_auth_pages["Auth pages<br/>sign-in/up<br/>[page.tsx]"]
  node_dashboard_shell["Dashboard shell<br/>protected app<br/>[page.tsx]"]
  node_meeting_views["Meetings<br/>workspace views<br/>[page.tsx]"]
  node_transcription_view["Transcript review<br/>editor view<br/>[page.tsx]"]
  node_ui_system["UI system<br/>component library<br/>[button.tsx]"]
  node_dashboard_components["Dashboard UI<br/>feature components"]
  node_transcription_components["Transcript UI<br/>feature components<br/>[audio-player.tsx]"]
  node_client_state["User state<br/>context/hooks<br/>[UserContext.tsx]"]
end

subgraph group_api["API layer"]
  node_route_handlers["Route handlers<br/>nextjs api"]
  node_auth_api["Auth API<br/>session endpoints<br/>[route.ts]"]
  node_meeting_api["Meeting API<br/>meeting endpoints<br/>[route.ts]"]
  node_audio_transcription_api["Audio pipeline API<br/>media endpoints<br/>[route.ts]"]
  node_ai_api["AI API<br/>generation endpoints<br/>[route.ts]"]
  node_stats_email_api["Stats & email API<br/>support endpoints<br/>[route.ts]"]
end

subgraph group_domain["Domain services"]
  node_controllers["Controllers<br/>service layer<br/>[authController.ts]"]
  node_models[("Data models<br/>mongoose models<br/>[User.ts]")]
end

subgraph group_infra["Infra & integrations"]
  node_app_services["App services<br/>shared libs<br/>[gemini.ts]"]
  node_database[("MongoDB<br/>system of record<br/>[mongodb.ts]")]
  node_vector_store[("Pinecone<br/>vector db<br/>[pinecone.ts]")]
  node_ai_storage["AI & storage<br/>external services<br/>[cloudinary.ts]"]
end

node_app_shell -->|"renders"| node_marketing_site
node_app_shell -->|"renders"| node_auth_pages
node_app_shell -->|"renders"| node_dashboard_shell
node_dashboard_shell -->|"navigates"| node_meeting_views
node_dashboard_shell -->|"navigates"| node_transcription_view
node_dashboard_shell -->|"composes"| node_dashboard_components
node_transcription_view -->|"uses"| node_transcription_components
node_dashboard_shell -->|"uses"| node_ui_system
node_marketing_site -->|"uses"| node_ui_system
node_route_handlers -->|"contains"| node_auth_api
node_route_handlers -->|"contains"| node_meeting_api
node_route_handlers -->|"contains"| node_audio_transcription_api
node_route_handlers -->|"contains"| node_ai_api
node_route_handlers -->|"contains"| node_stats_email_api
node_auth_api -->|"delegates"| node_controllers
node_meeting_api -->|"delegates"| node_controllers
node_ai_api -->|"delegates"| node_controllers
node_controllers -->|"persists"| node_models
node_controllers -->|"connects"| node_database
node_app_services -->|"integrates"| node_ai_storage
node_app_services -->|"integrates"| node_vector_store
node_ai_api -->|"uses"| node_app_services
node_audio_transcription_api -->|"integrates"| node_ai_storage
node_stats_email_api -->|"integrates"| node_ai_storage
node_client_state -->|"supports"| node_dashboard_shell

click node_app_shell "https://github.com/codexuf/meetscribeai/blob/main/app/layout.tsx"
click node_marketing_site "https://github.com/codexuf/meetscribeai/blob/main/app/page.tsx"
click node_auth_pages "https://github.com/codexuf/meetscribeai/blob/main/app/auth/sign-in/page.tsx"
click node_dashboard_shell "https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/page.tsx"
click node_meeting_views "https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/meetings/page.tsx"
click node_transcription_view "https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/transcriptions/[id]/page.tsx"
click node_ui_system "https://github.com/codexuf/meetscribeai/blob/main/components/ui/button.tsx"
click node_dashboard_components "https://github.com/codexuf/meetscribeai/blob/main/components/dashboard/dashboard-header.tsx"
click node_transcription_components "https://github.com/codexuf/meetscribeai/blob/main/components/transcription/audio-player.tsx"
click node_client_state "https://github.com/codexuf/meetscribeai/blob/main/context/UserContext.tsx"
click node_route_handlers "https://github.com/codexuf/meetscribeai/tree/main/app/api"
click node_auth_api "https://github.com/codexuf/meetscribeai/blob/main/app/api/auth/login/route.ts"
click node_meeting_api "https://github.com/codexuf/meetscribeai/blob/main/app/api/meetings/route.ts"
click node_audio_transcription_api "https://github.com/codexuf/meetscribeai/blob/main/app/api/audio/upload/route.ts"
click node_ai_api "https://github.com/codexuf/meetscribeai/blob/main/app/api/ai-chat/[meetingId]/route.ts"
click node_stats_email_api "https://github.com/codexuf/meetscribeai/blob/main/app/api/stats/[userId]/route.ts"
click node_controllers "https://github.com/codexuf/meetscribeai/blob/main/controllers/authController.ts"
click node_models "https://github.com/codexuf/meetscribeai/blob/main/models/User.ts"
click node_app_services "https://github.com/codexuf/meetscribeai/blob/main/lib/gemini.ts"
click node_database "https://github.com/codexuf/meetscribeai/blob/main/lib/mongodb.ts"
click node_vector_store "https://github.com/codexuf/meetscribeai/blob/main/lib/pinecone.ts"
click node_ai_storage "https://github.com/codexuf/meetscribeai/blob/main/lib/cloudinary.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_app_shell,node_marketing_site,node_auth_pages,node_dashboard_shell,node_meeting_views,node_transcription_view,node_ui_system,node_dashboard_components,node_transcription_components,node_client_state toneBlue
class node_route_handlers,node_auth_api,node_meeting_api,node_audio_transcription_api,node_ai_api,node_stats_email_api toneAmber
class node_controllers,node_models toneMint
class node_app_services,node_database,node_vector_store,node_ai_storage toneRose
```

## Components

### Frontend

Public site and authenticated dashboard UI

- [App shell](https://github.com/codexuf/meetscribeai/blob/main/app/layout.tsx): nextjs app · Root layout, globals, and shared page framing · `app/layout.tsx`
- [Marketing site](https://github.com/codexuf/meetscribeai/blob/main/app/page.tsx): public pages · Landing and informational pages for visitors · `app/page.tsx`
- [Auth pages](https://github.com/codexuf/meetscribeai/blob/main/app/auth/sign-in/page.tsx): sign-in/up · Public authentication entry points · `app/auth/sign-in/page.tsx`
- [Dashboard shell](https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/page.tsx): protected app · Authenticated workspace and route group · `app/dashboard/page.tsx`
- [Meetings](https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/meetings/page.tsx): workspace views · Meeting list, creation, calendar, and settings · `app/dashboard/meetings/page.tsx`
- [Transcript review](https://github.com/codexuf/meetscribeai/blob/main/app/dashboard/transcriptions/[id]/page.tsx): editor view · Single transcript review and playback experience · `app/dashboard/transcriptions/[id]/page.tsx`
- [UI system](https://github.com/codexuf/meetscribeai/blob/main/components/ui/button.tsx): component library · Reusable shadcn-style primitives and shared components · `components/ui/button.tsx`
- [Dashboard UI](https://github.com/codexuf/meetscribeai/blob/main/components/dashboard/dashboard-header.tsx): feature components · Navigation, cards, stats, and dashboard chrome · `components/dashboard/dashboard-header.tsx`
- [Transcript UI](https://github.com/codexuf/meetscribeai/blob/main/components/transcription/audio-player.tsx): feature components · Audio player, speaker picker, and segment rendering · `components/transcription/audio-player.tsx`
- [User state](https://github.com/codexuf/meetscribeai/blob/main/context/UserContext.tsx): context/hooks · Client-side user context and shared UI hooks · `context/UserContext.tsx`

### API layer

Next.js route handlers and request boundary

- [Route handlers](https://github.com/codexuf/meetscribeai/tree/main/app/api): nextjs api · HTTP boundary for auth, meetings, audio, AI, stats, and email · `app/api`
- [Auth API](https://github.com/codexuf/meetscribeai/blob/main/app/api/auth/login/route.ts): session endpoints · Login, logout, and current-user session routes · `app/api/auth/login/route.ts`
- [Meeting API](https://github.com/codexuf/meetscribeai/blob/main/app/api/meetings/route.ts): meeting endpoints · CRUD and speaker management for meetings · `app/api/meetings/route.ts`
- [Audio pipeline API](https://github.com/codexuf/meetscribeai/blob/main/app/api/audio/upload/route.ts): media endpoints · Record, upload, delete, and transcription lifecycle routes · `app/api/audio/upload/route.ts`
- [AI API](https://github.com/codexuf/meetscribeai/blob/main/app/api/ai-chat/[meetingId]/route.ts): generation endpoints · Chat, summary, embeddings, and export routes · `app/api/ai-chat/[meetingId]/route.ts`
- [Stats & email API](https://github.com/codexuf/meetscribeai/blob/main/app/api/stats/[userId]/route.ts): support endpoints · Usage analytics and notification/sharing routes · `app/api/stats/[userId]/route.ts`

### Domain services

Controllers, models, and shared app state

- [Controllers](https://github.com/codexuf/meetscribeai/blob/main/controllers/authController.ts): service layer · Business logic for auth, meetings, users, and AI workflows · `controllers/authController.ts`
- [Data models](https://github.com/codexuf/meetscribeai/blob/main/models/User.ts): mongoose models · User, meeting, and AI chat summary persistence · `models/User.ts`

### Infra & integrations

Database, AI, storage, and external services

- [App services](https://github.com/codexuf/meetscribeai/blob/main/lib/gemini.ts): shared libs · Audio, Gemini, embeddings, toast, and utility helpers · `lib/gemini.ts`
- [MongoDB](https://github.com/codexuf/meetscribeai/blob/main/lib/mongodb.ts): system of record · Mongoose-backed primary persistence layer · `lib/mongodb.ts`
- [Pinecone](https://github.com/codexuf/meetscribeai/blob/main/lib/pinecone.ts): vector db · Semantic retrieval store for embeddings · `lib/pinecone.ts`
- [AI & storage](https://github.com/codexuf/meetscribeai/blob/main/lib/cloudinary.ts): external services · OpenAI/Gemini, AssemblyAI, Cloudinary, and Resend integrations · `lib/cloudinary.ts`

## Connections

- App shell → Marketing site: renders · Shared layout frames public pages
- App shell → Auth pages: renders · Shared layout frames auth pages
- App shell → Dashboard shell: renders · Shared layout frames authenticated workspace
- Dashboard shell → Meetings: navigates · Dashboard routes expose meeting operations
- Dashboard shell → Transcript review: navigates · Dashboard routes expose transcript review
- Dashboard shell → Dashboard UI: composes · Dashboard shell is built from shared chrome
- Transcript review → Transcript UI: uses · Transcript page uses specialized playback and segment UI
- Dashboard shell → UI system: uses · Workspace UI is assembled from shared primitives
- Marketing site → UI system: uses · Public pages use the same design system
- Route handlers → Auth API: contains · Auth routes are implemented as Next.js handlers
- Route handlers → Meeting API: contains · Meeting routes are implemented as Next.js handlers
- Route handlers → Audio pipeline API: contains · Media and transcript lifecycle routes live here
- Route handlers → AI API: contains · AI generation and export routes live here
- Route handlers → Stats & email API: contains · Reporting and outbound email routes live here
- Auth API → Controllers: delegates · Session handling delegates business logic to controllers
- Meeting API → Controllers: delegates · Meeting CRUD delegates business logic to controllers
- AI API → Controllers: delegates · Chat and summary routes delegate to AI controllers
- Controllers → Data models: persists · Controllers read and write domain records
- Controllers → MongoDB: connects · Controllers rely on MongoDB via Mongoose models
- App services → AI & storage: integrates · Shared libs wrap third-party AI, media, and email services
- App services → Pinecone: integrates · Embedding service connects to the vector database
- AI API → App services: uses · AI routes use Gemini, embeddings, and helper utilities
- Audio pipeline API → AI & storage: integrates · Audio and transcription workflows depend on external services
- Stats & email API → AI & storage: integrates · Email delivery and outbound notifications use external services
- User state → Dashboard shell: supports · Shared user state powers authenticated UI
