# Prabhupāda Says — Project Context ## What this project is A Next.js app presenting the books, letters, essays, lectures, and teachings of His Divine Grace A.C. Bhaktivedanta Swami Prabhupāda in a modern, accessible, and searchable format with proper Unicode Sanskrit (IAST + Devanagari). Content is sourced from the pre-1980s Vedabase, extracted and indexed into MongoDB, and served via a Next.js frontend. Extraction scripts and raw data live separately in the `extractor/` directory. --- ## Tech Stack - **Next.js 16** with Turbopack, React 19, TypeScript - **Tailwind CSS v4** with `@tailwindcss/postcss` - **shadcn/ui** (base-nova style, lucide icons) — components: Button, Card, Badge, Tooltip, Input, Drawer - **next-themes** for dark/light/system mode - **vaul** for mobile drawer navigation - **Go BFF API** — all data fetched via `lib/bff.ts` HTTP client calling the Go BFF server (no direct database access) - **framer-motion** for audio player animations (spring enter/exit, minimize/expand transitions, audio wave bars) - **Typesense** (via BFF) — typo-tolerant full-text search across all content - **Python 3** with BeautifulSoup4 + `indic-transliteration` for HTML extraction scripts --- ## Project Structure The project is split into two directories: - **`knowledgebase/`** — Production Next.js app (~3.5MB excluding node_modules) - **`extractor/`** — Extraction scripts, seed scripts, raw data, legacy fonts (~750MB) ``` knowledgebase/ ├── app/ │ ├── page.tsx → Landing page (Books, Essays, Magazines, Letters, Transcriptions, etc.) │ ├── layout.tsx → ThemeProvider + TooltipProvider + TextSelectionToolbar + TextHighlighter │ ├── globals.css → Vintage color palette + reading settings CSS │ ├── about/page.tsx → About page (mission, data source, roadmap) │ ├── books/ → 37 book routes (verse-based + prose) │ │ ├── page.tsx → Books index (searchable grid, diacritic-aware search) │ │ ├── chapter-viewer.tsx → Shared client component for verse-based books │ │ ├── bg/, sb/, cc/, sb1962/, iso/, noi/, bs/, mm/, nbs/ → Verse-based books │ │ ├── kb/, nod/, tlc/, ej/, ek/, mg/, bbd/, owk/, rv/ → Prose books │ │ ├── poy/, pqpa/, ttp/, ochkm/, hkh/, lcl/, lob/ → More prose books │ │ ├── ssr/, ds/ → Hierarchical prose books (sub-chapters) │ │ └── sva/, gg/, mog/, cbhc/, bk/, pk/, va/ → Other books │ ├── magazines/ → Magazine browsing (BTG 1944-1960, BTG 1966-1973) │ ├── letters/ │ │ ├── page.tsx → Letters index with 3-way nav (year/recipient/location) │ │ ├── filter-year-browser.tsx → Shared component: sidebar years + month-grouped content │ │ ├── [slug]/page.tsx → Individual letter reader │ │ ├── year/[year]/ │ │ │ ├── page.tsx → Letters by year │ │ │ └── year-month-browser.tsx → Sidebar months + letter list │ │ ├── recipient/[name]/page.tsx → Letters by recipient (year sidebar + month groups) │ │ └── location/[name]/page.tsx → Letters by location (year sidebar + month groups) │ ├── essays/ → 23 essays across 6 groups │ ├── journals/ → Jaladuta Diary, The Beginning │ ├── other-documents/ → 12 miscellaneous documents │ ├── glossary/ │ │ ├── page.tsx → Redirects to /glossary/a │ │ ├── glossary-client.tsx → Client component (sidebar terms, single entry view, prev/next nav) │ │ └── [letter]/page.tsx → Dynamic route per letter (A-Z) │ ├── disciples/ → 4,747 initiated disciples directory │ │ ├── page.tsx → Disciples browser (letter nav, suffix filter, search, sort, pagination) │ │ └── disciples-browser.tsx → Client component │ ├── transcriptions/ → 3,787 transcriptions (lectures, conversations, philosophy, dictations) │ │ ├── page.tsx → Browse by year / place / type (3 views) │ │ ├── year/[year]/page.tsx → Year listing, grouped by month │ │ ├── place/[place]/page.tsx → Place listing │ │ ├── type/[type]/page.tsx → Type listing (lecture/conversation), year sidebar │ │ └── [slug]/page.tsx → Individual transcription reading page │ ├── search/ → Search page (server + client components) │ │ ├── page.tsx → Server component (URL-driven state) │ │ └── search-content.tsx → Client component (input, filters, results) │ └── api/ │ ├── og/route.tsx → Dynamic OG image generator (Noto Sans, Prabhupāda image) │ ├── books/ → Book/verse API routes │ ├── search/route.ts → BFF search proxy (Typesense via /api/v1/search) │ └── glossary/route.ts → Glossary API ├── components/ │ ├── ui/ → shadcn components (button, card, badge, tooltip, input, drawer) │ ├── selection-toolbar/ → Text selection toolbar sub-components │ │ ├── shared.tsx → KautilyaIcon, types, hooks (useMediaQuery, useCopyFeedback) │ │ ├── floating-toolbar.tsx → Desktop floating pill / mobile bottom bar │ │ ├── share-modal.tsx → Share modal (desktop) / drawer (mobile) │ │ ├── collections-drawer.tsx → Save to collection drawer │ │ └── more-popover.tsx → More options popover (desktop) / drawer (mobile) │ ├── text-selection-toolbar.tsx → Main orchestrator (event listeners, state management) │ ├── text-highlighter.tsx → Processes incoming ?hl= URLs (scroll + highlight) │ ├── page-header.tsx → Shared header with ReadingSettings (max-w-5xl) │ ├── reading-settings.tsx → Theme/font/size/justify accessibility panel │ ├── mobile-nav.tsx → Left-slide drawer for mobile sidebar navigation │ ├── header-search.tsx → Header search button with framer-motion expand animation │ ├── site-footer.tsx → Global footer (About + Home links) │ ├── audio-player/ → Site-wide floating audio player │ │ ├── audio-context.tsx → React context + provider, manages