# shakthinami/repobrief architecture

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

- Interactive diagram: https://gitdiagram.com/shakthinami/repobrief
- Repository: https://github.com/shakthinami/repobrief

## Overview

RepoBrief is a team platform for indexing GitHub repositories, answering codebase questions, analyzing meeting audio, and managing project collaboration and credits. The main journey is sign-in, create a repository project, index its files, then ask questions and review cited code; meetings and billing are parallel product workflows. The graph combines sampled call paths with README-documented capabilities. Several UI-to-route connections and unsampled team/auth internals are not shown where wiring could not be verified.

Main entry points: [`src/lib/prisma.ts`](https://github.com/shakthinami/repobrief/blob/main/src/lib/prisma.ts) (Prisma database), [`src/lib/embeddingPipeline.ts`](https://github.com/shakthinami/repobrief/blob/main/src/lib/embeddingPipeline.ts) (Repository indexer), [`src/app/api/qa/route.ts`](https://github.com/shakthinami/repobrief/blob/main/src/app/api/qa/route.ts) (Q&A endpoint), [`src/app/(protected)/create/page.tsx`](https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/create/page.tsx) (Create project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_projects["Projects and indexing"]
  node_create["Create project<br/>[page.tsx]"]
  node_indexer["Repository indexer"]
  node_github_loader["GitHub loader<br/>[githubLoader.ts]"]
  node_dashboard["Project dashboard<br/>[page.tsx]"]
end

subgraph group_qa["Codebase Q&amp;A"]
  node_qa_page["Q&amp;A interface<br/>[page.tsx]"]
  node_qa_api["Q&amp;A endpoint<br/>[route.ts]"]
  node_simple_qa["Keyword Q&amp;A<br/>[route.ts]"]
  node_saved_questions["Saved questions API<br/>[route.ts]"]
  node_saved_questions_read["Saved question lookup<br/>[route.ts]"]
end

subgraph group_meetings["Meeting analysis"]
  node_meeting_upload["Meeting upload UI"]
  node_transcribe["Transcription API<br/>[route.ts]"]
  node_meeting_store["Meeting transcription storage<br/>[meeting-storage.ts]"]
end

subgraph group_account["Teams and billing"]
  node_team_routes["Project membership APIs<br/>[route.ts]"]
  node_billing["Billing and credits<br/>[page.tsx]"]
  node_stripe_checkout["Stripe checkout<br/>[stripe.ts]"]
  node_stripe_webhook["Stripe webhook<br/>[route.ts]"]
  node_credits_api["Credit balance APIs<br/>[route.ts]"]
end

subgraph group_platform["Persistence and integrations"]
  node_github["GitHub API"]
  node_gemini["Gemini AI"]
  node_assembly["AssemblyAI"]
  node_supabase[("Supabase")]
  node_auth["Clerk authentication"]
  node_stripe["Stripe"]
  node_db[("Prisma database<br/>[prisma.ts]")]
end

node_user(("Team member"))

node_user -->|"creates project"| node_create
node_create -->|"starts indexing"| node_indexer
node_indexer -->|"loads files"| node_github_loader
node_github_loader -->|"fetches repository"| node_github
node_indexer -->|"summarizes and embeds"| node_gemini
node_indexer -->|"stores embeddings"| node_db
node_user -->|"asks question"| node_qa_page
node_qa_page -->|"submits question"| node_qa_api
node_qa_api -->|"reads indexed files"| node_db
node_qa_api -->|"generates answer"| node_gemini
node_qa_api -->|"returns answer and references"| node_qa_page
node_simple_qa -->|"reads project files"| node_db
node_simple_qa -->|"generates answer"| node_gemini
node_user -->|"saves answer"| node_saved_questions
node_saved_questions -->|"writes question"| node_db
node_saved_questions_read -->|"reads saved questions"| node_db
node_user -->|"uploads audio"| node_meeting_upload
node_meeting_upload -->|"submits audio URL"| node_transcribe
node_transcribe -->|"submits and checks job"| node_assembly
node_meeting_upload -->|"saves transcription"| node_meeting_store
node_meeting_store -->|"reads and writes records"| node_supabase
node_transcribe -->|"looks up and deletes records"| node_supabase
node_user -->|"manages membership"| node_team_routes
node_team_routes -->|"updates project members"| node_db
node_user -->|"manages credits"| node_billing
node_billing -->|"starts purchase"| node_stripe_checkout
node_stripe_checkout -->|"creates checkout"| node_stripe
node_stripe -->|"sends payment event"| node_stripe_webhook
node_stripe_webhook -->|"updates credits and transactions"| node_db
node_credits_api -->|"reads credit balance"| node_db
node_create -.->|"requires sign-in"| node_auth
node_dashboard -.->|"uses project data"| node_db

click node_create "https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/create/page.tsx"
click node_indexer "https://github.com/shakthinami/repobrief/blob/main/src/lib/embeddingPipeline.ts"
click node_github_loader "https://github.com/shakthinami/repobrief/blob/main/src/lib/githubLoader.ts"
click node_dashboard "https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/dashboard/page.tsx"
click node_qa_page "https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/qa/page.tsx"
click node_qa_api "https://github.com/shakthinami/repobrief/blob/main/src/app/api/qa/route.ts"
click node_simple_qa "https://github.com/shakthinami/repobrief/blob/main/src/app/api/simple-qa/route.ts"
click node_saved_questions "https://github.com/shakthinami/repobrief/blob/main/src/app/api/save-question/route.ts"
click node_saved_questions_read "https://github.com/shakthinami/repobrief/blob/main/src/app/api/get-saved-questions/route.ts"
click node_meeting_upload "https://github.com/shakthinami/repobrief/blob/main/src/components/meeting-transcription.tsx"
click node_transcribe "https://github.com/shakthinami/repobrief/blob/main/src/app/api/transcribe/route.ts"
click node_meeting_store "https://github.com/shakthinami/repobrief/blob/main/src/lib/meeting-storage.ts"
click node_team_routes "https://github.com/shakthinami/repobrief/blob/main/src/app/api/projects/%5BprojectId%5D/members/route.ts"
click node_billing "https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/billing/page.tsx"
click node_stripe_checkout "https://github.com/shakthinami/repobrief/blob/main/src/app/actions/stripe.ts"
click node_stripe_webhook "https://github.com/shakthinami/repobrief/blob/main/src/app/api/webhooks/stripe/route.ts"
click node_credits_api "https://github.com/shakthinami/repobrief/blob/main/src/app/api/get-credits/route.ts"
click node_db "https://github.com/shakthinami/repobrief/blob/main/src/lib/prisma.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_create,node_indexer,node_github_loader,node_dashboard toneBlue
class node_qa_page,node_qa_api,node_simple_qa,node_saved_questions,node_saved_questions_read toneAmber
class node_meeting_upload,node_transcribe,node_meeting_store toneMint
class node_team_routes,node_billing,node_stripe_checkout,node_stripe_webhook,node_credits_api toneRose
class node_github,node_gemini,node_assembly,node_supabase,node_auth,node_stripe,node_db,node_user toneIndigo
```

## Components

### Projects and indexing

- [Create project](https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/create/page.tsx): `src/app/(protected)/create/page.tsx`
- [Repository indexer](https://github.com/shakthinami/repobrief/blob/main/src/lib/embeddingPipeline.ts): `src/lib/embeddingPipeline.ts`
- [GitHub loader](https://github.com/shakthinami/repobrief/blob/main/src/lib/githubLoader.ts): `src/lib/githubLoader.ts`
- [Project dashboard](https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/dashboard/page.tsx): `src/app/(protected)/dashboard/page.tsx`

### Codebase Q&A

- [Q&A interface](https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/qa/page.tsx): `src/app/(protected)/qa/page.tsx`
- [Q&A endpoint](https://github.com/shakthinami/repobrief/blob/main/src/app/api/qa/route.ts): `src/app/api/qa/route.ts`
- [Keyword Q&A](https://github.com/shakthinami/repobrief/blob/main/src/app/api/simple-qa/route.ts): `src/app/api/simple-qa/route.ts`
- [Saved questions API](https://github.com/shakthinami/repobrief/blob/main/src/app/api/save-question/route.ts): `src/app/api/save-question/route.ts`
- [Saved question lookup](https://github.com/shakthinami/repobrief/blob/main/src/app/api/get-saved-questions/route.ts): `src/app/api/get-saved-questions/route.ts`

### Meeting analysis

- [Meeting upload UI](https://github.com/shakthinami/repobrief/blob/main/src/components/meeting-transcription.tsx): `src/components/meeting-transcription.tsx`
- [Transcription API](https://github.com/shakthinami/repobrief/blob/main/src/app/api/transcribe/route.ts): `src/app/api/transcribe/route.ts`
- [Meeting transcription storage](https://github.com/shakthinami/repobrief/blob/main/src/lib/meeting-storage.ts): `src/lib/meeting-storage.ts`

### Teams and billing

- [Project membership APIs](https://github.com/shakthinami/repobrief/blob/main/src/app/api/projects/%5BprojectId%5D/members/route.ts): `src/app/api/projects/[projectId]/members/route.ts`
- [Billing and credits](https://github.com/shakthinami/repobrief/blob/main/src/app/(protected)/billing/page.tsx): `src/app/(protected)/billing/page.tsx`
- [Stripe checkout](https://github.com/shakthinami/repobrief/blob/main/src/app/actions/stripe.ts): `src/app/actions/stripe.ts`
- [Stripe webhook](https://github.com/shakthinami/repobrief/blob/main/src/app/api/webhooks/stripe/route.ts): `src/app/api/webhooks/stripe/route.ts`
- [Credit balance APIs](https://github.com/shakthinami/repobrief/blob/main/src/app/api/get-credits/route.ts): `src/app/api/get-credits/route.ts`

### Persistence and integrations

- **GitHub API**
- **Gemini AI**
- **AssemblyAI**
- **Supabase**
- **Clerk authentication**
- **Stripe**
- [Prisma database](https://github.com/shakthinami/repobrief/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`

### Other components

- **Team member**

## Connections

- Team member → Create project: creates project
- Create project → Repository indexer: starts indexing
- Repository indexer → GitHub loader: loads files
- GitHub loader → GitHub API: fetches repository
- Repository indexer → Gemini AI: summarizes and embeds
- Repository indexer → Prisma database: stores embeddings
- Team member → Q&A interface: asks question
- Q&A interface → Q&A endpoint: submits question
- Q&A endpoint → Prisma database: reads indexed files
- Q&A endpoint → Gemini AI: generates answer
- Q&A endpoint → Q&A interface: returns answer and references
- Keyword Q&A → Prisma database: reads project files
- Keyword Q&A → Gemini AI: generates answer
- Team member → Saved questions API: saves answer
- Saved questions API → Prisma database: writes question
- Saved question lookup → Prisma database: reads saved questions
- Team member → Meeting upload UI: uploads audio
- Meeting upload UI → Transcription API: submits audio URL
- Transcription API → AssemblyAI: submits and checks job
- Meeting upload UI → Meeting transcription storage: saves transcription
- Meeting transcription storage → Supabase: reads and writes records
- Transcription API → Supabase: looks up and deletes records
- Team member → Project membership APIs: manages membership
- Project membership APIs → Prisma database: updates project members
- Team member → Billing and credits: manages credits
- Billing and credits → Stripe checkout: starts purchase
- Stripe checkout → Stripe: creates checkout
- Stripe → Stripe webhook: sends payment event
- Stripe webhook → Prisma database: updates credits and transactions
- Credit balance APIs → Prisma database: reads credit balance
- Create project → Clerk authentication: requires sign-in
- Project dashboard → Prisma database: uses project data
