How dhakarraghu/gitbuddy works
1. Overall shape
- This is a Next.js App Router application with a clear split between public entry points and a protected workspace.
- The public side contains the home page and login flow; the authenticated side is organized around a project workspace and project-management actions.
2. Authentication and access control
- Authentication is handled through NextAuth in src/app/api/auth/[...nextauth]/route.ts.
- src/middleware.ts and the (protected) route group enforce access boundaries so workspace pages only load for signed-in users.
- src/lib/auth.ts is the central auth config/helper, and src/components/Providers.tsx likely wires session/theme/global client providers into the app shell.
3. Persistent application state
- The app uses Prisma with a relational database, as shown by src/lib/db.ts and prisma/schema.prisma.
- Migrations indicate the main stored entities include users, projects, and repository indexing data, plus at least one enum-based state model.
- This database is the system of record for project membership, saved summaries, analytics, and meeting artifacts.
4. Project-centric domain model
- The main workspace is organized around src/app/project/[projectId], which is the primary domain boundary.
- Subpages under a project include:
- dashboard for overview/status
- analytics for repository and activity insights
- meetings for meeting lists and meeting detail
- prAndissue for pull request / issue analysis
- qa for question-answering over project context
- src/app/project/[projectId]/layout.tsx suggests shared project-scoped navigation/state across these tabs.
5. Project lifecycle and collaboration
- Project creation and membership are handled in the protected workspace via create, join/[projectId], and projects.
- Collaboration features are surfaced through components such as invite-button.tsx, team-member.tsx, and archive-button.tsx.
- The billing page implies account or workspace-level plan management, even if it is not the core product flow.
6. Repository ingestion and analysis pipeline
- Repository analysis appears to start from GitHub data and repo loading helpers in src/lib/github.ts, src/lib/githubLoader.ts, src/lib/github-insights.ts, and src/lib/repoEmbedding.ts.
- src/lib/query.ts and src/lib/retrival.ts suggest a retrieval layer that turns indexed repository content into answerable context.
- The architecture implies a pipeline of: user supplies repo URL → repo is fetched/indexed → embeddings are generated → data is stored for search/QA/analytics.
7. Vector retrieval and AI assistant layer
- src/lib/pineconedb.ts indicates a Pinecone-backed vector store for semantic retrieval.
- src/lib/gemini.ts and src/lib/gemini2.ts indicate Gemini is used for generation tasks such as summaries, explanations, and project Q&A.
- This creates a retrieval-augmented workflow: the app fetches relevant project/repo context from Pinecone and passes it to the model for grounded responses.
8. Meeting audio processing
- Meeting support is a separate ingestion path from repository analysis.
- src/components/upload-audio.tsx and src/lib/assembly.ts indicate audio upload plus AssemblyAI transcription.
- src/lib/uploadToVercel.ts suggests uploaded media is stored externally, likely via Vercel storage/asset handling, before transcription and summarization.
- The resulting transcript, summary, and extracted issues feed the meetings pages and likely the project analytics layer.
9. UI composition and state handling
- The UI is built from a shared design system in src/components/ui/*, with app-specific shell pieces like app-sidebar.tsx, homeSidebar.tsx, mode-toggle.tsx, and ConfromDialog.tsx.
- Multiple loading.tsx files under project subroutes show that the workspace is designed around asynchronous data loading and progressive rendering.
- Hooks such as use-refetch.ts and use-mobile.ts suggest client-side refresh and responsive behavior are part of the interaction model.
10. Data flow across the system
- The two main ingestion streams are:
- GitHub repository data flowing into database + embeddings + AI summaries
- Meeting audio flowing into storage + transcription + extracted action items/issues
- Both streams converge in the project workspace, where the UI reads persisted records and generated insights to render dashboards, analytics, Q&A, and meeting views.
11. External service boundaries
- The architecture depends on several external services that materially shape the system:
- GitHub for repository source data
- Gemini for language generation and analysis
- AssemblyAI for audio transcription
- Pinecone for vector search / semantic retrieval
- Vercel for deployment and likely file/storage handling
- These are not just integrations; they define the major processing boundaries of the product.
12. What to draw in an architecture diagram
- A useful diagram should center on the project workspace as the hub, with arrows to:
- auth/middleware and session management
- Prisma/Postgres persistence
- GitHub ingestion/indexing
- Pinecone retrieval
- Gemini generation
- AssemblyAI meeting transcription
- external media upload/storage
- The public login and protected project routes should be shown as separate entry paths into the same core workspace.
Main entry points: [projectId]/layout.tsx Project Hub · githubLoader.ts Repo Pipeline · upload-audio.tsx Meeting Pipeline · (protected)/layout.tsx Protected Area
Components 25
Public entry
Unauthenticated routes and login entry points.
- Home · Public landing page.
rampage/src/app/page.tsx - Login · Sign-in entry page.
rampage/src/app/login/page.tsx - Auth API · NextAuth handler and session flow.
rampage/src/app/api/auth/[...nextauth]/route.ts - Middleware · Protects signed-in areas and enforces access boundaries.
rampage/src/middleware.ts
Protected workspace
Signed-in app shell and project management area.
- Protected Area · Authenticated route group and workspace entry.
rampage/src/app/(protected)/layout.tsx - Projects · Project list and workspace overview.
rampage/src/app/(protected)/projects/page.tsx - Create / Join · Project creation and membership entry points.
rampage/src/app/(protected)/create/page.tsx - Billing · Plan or account management surface.
rampage/src/app/(protected)/billing/page.tsx
Project hub
Project-scoped routes and shared navigation.
- Project Hub · Shared project-scoped layout and navigation.
rampage/src/app/project/[projectId]/layout.tsx - Dashboard · Project overview and status.
rampage/src/app/project/[projectId]/dashboard/page.tsx - Analytics · Repository and activity insights.
rampage/src/app/project/[projectId]/analytics/page.tsx - Meetings · Meeting list and detail views.
rampage/src/app/project/[projectId]/meetings/page.tsx - PR / Issues · Pull request and issue analysis.
rampage/src/app/project/[projectId]/prAndissue/page.tsx - Q&A · Question answering over project context.
rampage/src/app/project/[projectId]/qa/page.tsx
Ingestion and AI
Repository, retrieval, and meeting processing pipeline.
- Repo Pipeline · GitHub loading, indexing, embeddings, and retrieval prep.
rampage/src/lib/githubLoader.ts - Meeting Pipeline · Upload, transcription, and meeting summary processing.
rampage/src/components/upload-audio.tsx
Persistence
Database and vector storage backends.
- Prisma DB · Primary application database and schema.
rampage/prisma/schema.prisma - Vector Store · Semantic retrieval index for repository context.
rampage/src/lib/pineconedb.ts
External services
Third-party systems the app depends on.
- GitHub · Repository source data provider.
- Gemini · Generation and explanation model layer.
- AssemblyAI · Audio transcription service.
- Vercel Storage · External media upload and storage boundary.
rampage/src/lib/uploadToVercel.ts
Shared UI
Cross-cutting UI components and client helpers.
Connections 31
- Home → App Shell: renders via · Public shell renders inside the global app layout.
- Login → Auth API: authenticates with · Login flow delegates to NextAuth.
- Middleware → Protected Area: guards · Middleware protects authenticated routes.
- App Shell → Providers: provides · Root layout wires shared providers.
- Protected Area → Projects: shows · Protected workspace exposes project list.
- Protected Area → Create / Join: offers · Workspace contains create and join flows.
- Protected Area → Billing: includes · Workspace includes billing settings.
- Projects → Project Hub: opens · Projects lead into a project-scoped hub.
- Project Hub → Dashboard: navigates · Shared project layout frames the dashboard.
- Project Hub → Analytics: navigates · Shared project layout frames analytics.
- Project Hub → Meetings: navigates · Shared project layout frames meetings.
- Project Hub → PR / Issues: navigates · Shared project layout frames PR and issue analysis.
- Project Hub → Q&A: navigates · Shared project layout frames Q&A.
- Repo Pipeline → GitHub: loads from · Repository pipeline starts with GitHub data.
- Repo Pipeline → Prisma DB: persists to · Indexed project data is stored in the relational database.
- Repo Pipeline → Vector Store: indexes in · Embeddings and retrieval state are stored in vector search.
- Repo Pipeline → Gemini: summarizes with · Gemini supports repo analysis and answer generation.
- Meeting Pipeline → Vercel Storage: uploads to · Meeting media is stored before processing.
- Meeting Pipeline → AssemblyAI: transcribes with · Audio is sent to AssemblyAI for transcription.
- Meeting Pipeline → Gemini: summarizes with · Transcript artifacts feed AI-generated summaries.
- Dashboard → Prisma DB: reads · Dashboard reads persisted project state.
- Analytics → Repo Pipeline: queries · Analytics depends on repo ingestion and retrieval.
- Meetings → Meeting Pipeline: shows · Meeting pages surface audio-derived artifacts.
- PR / Issues → Repo Pipeline: analyzes · PR and issue views use repository indexing data.
- Q&A → Repo Pipeline: retrieves from · Q&A uses retrieval over indexed project context.
- Q&A → Vector Store: searches · Semantic retrieval comes from the vector store.
- PR / Issues → Gemini: explains with · LLM generates issue and PR insights.
- Meetings → Prisma DB: stores · Meeting records and summaries persist in the database.
- Meeting Pipeline → Prisma DB: stores · Transcripts and outputs are saved in the system of record.
- UI System → Project Hub: supports · Shared UI components are used throughout the project shell.
- UI System → Protected Area: supports · Design system components power the protected workspace.