How tanuj-datta/gita-gpt works
Gita-GPT is a bilingual Bhagavad Gita guidance app. Users explore chapter summaries or ask Krishna questions; the chat API retrieves verse context, requests a streamed Gemini response, and can persist conversations. Separate API routes handle verse loading, chat history, authentication, and voice. The excerpts show the UI-to-chat and chat-to-engine/auth/database/AI relationships; other unsampled route behavior is represented without inferred connections.
Main entry points: auth.ts Authentication · route.ts AI Chat API · page.tsx Gita-GPT Interface · prisma.ts Prisma Client
Components 20
User Experience
- Gita-GPT Interface
app/page.tsx - Background Audio
components/AudioContext.tsx
Gita Wisdom
- Chapter Roadmap
components/ChapterRoadmap.tsx - Chapter Summaries
lib/chapter-roadmap-data.ts - Verse Dataset
lib/gita-data.json - Verse Retrieval
lib/gita-engine.ts - Chapter Verse API
app/api/chapters/[id]/slokas/route.ts
Guidance and Chat
- AI Chat API
app/api/chat/route.ts - Chat List API
app/api/chats/route.ts - Chat Detail API
app/api/chats/[id]/route.ts - Voice API
app/api/voice/route.ts
Identity and Storage
- Auth Route
app/api/auth/[...nextauth]/route.ts - Authentication
auth.ts - Prisma Client
lib/prisma.ts - PostgreSQL
- Session Providers
components/Providers.tsx
Other components
- Visitor
- Gemini AI
- Google Sign-In
- YouTube Player
Connections 22
- Visitor → Gita-GPT Interface: uses
- Gita-GPT Interface → Chapter Roadmap: renders
app/page.tsx - Gita-GPT Interface → Verse Dataset: reads
app/page.tsx - Chapter Roadmap → Chapter Summaries: reads
components/ChapterRoadmap.tsx - Gita-GPT Interface → AI Chat API: sends messages
app/page.tsx - Gita-GPT Interface → Background Audio: uses
app/page.tsx - Background Audio → YouTube Player: controls playback
components/AudioContext.tsx - AI Chat API → Verse Retrieval: retrieves verses
app/api/chat/route.ts - Verse Retrieval → Verse Dataset: searches
lib/gita-engine.ts - AI Chat API → Chapter Verse API: requests verses
app/api/chat/route.ts - AI Chat API → Gemini AI: generates response
app/api/chat/route.ts - AI Chat API → Authentication: checks session
app/api/chat/route.ts - AI Chat API → Prisma Client: reads and writes
app/api/chat/route.ts - Chat List API → Authentication: checks session
app/api/chats/route.ts - Chat List API → Prisma Client: reads and creates
app/api/chats/route.ts - Chat Detail API → Authentication: checks session
app/api/chats/[id]/route.ts - Chat Detail API → Prisma Client: reads and deletes
app/api/chats/[id]/route.ts - Auth Route → Authentication: routes handlers
app/api/auth/[...nextauth]/route.ts - Authentication → Prisma Client: configures adapter
auth.ts - Authentication → Google Sign-In: configures sign-in
auth.ts - Prisma Client → PostgreSQL: connects
lib/prisma.ts - Session Providers → Authentication: provides session context