A quiet, readable home for Hindu scriptures — 108 names (ashtottara), aartis, bhajans, stotras, and sahasranamas — in Devanagari with pronunciation and meaning. Built with Next.js and MongoDB.
-
Copy
.env.exampleto.env.localand fill in:MONGODB_URI— a MongoDB Atlas connection string (include the database name)ADMIN_PASSWORD— the password for/adminSESSION_SECRET— a random 32+ character string (openssl rand -base64 32)NEXT_PUBLIC_SITE_URL—http://localhost:3000for local dev
-
Install dependencies and seed a few sample works:
npm install npm run seed
-
Run the dev server:
npm run dev
Visit http://localhost:3000, and http://localhost:3000/admin to manage content.
Content is entered through /admin — create a deity, then a work under it,
pasting the text into the bulk-entry format shown in each editor (instructions
appear above the content field for each content type). Saving parses the text
into individual verse/name documents and publishes immediately when status is
set to "Published".
- Data model: each verse/name is its own MongoDB document (not nested in
an array), so it can later be individually vector-embedded for semantic
search — see
atlas/README.md. - OG images: auto-generated per work at
/[type]/[slug]/opengraph-image. They render English text only — the underlying renderer (satori) doesn't shape Devanagari conjuncts correctly, so scripture text itself is kept off the share image. The actual site pages are unaffected, since real browsers shape Devanagari correctly. - Fonts:
src/assets/fonts/holds static (non-variable) TTF files used only for satori-rendered images (OG images, favicons), under the SIL Open Font License — Eczar for OG images, plus a Tiro Devanagari Sanskrit TTF (extracted from the same cached filenext/font/googlealready serves the real site, so the ॐ mark matches pixel-for-pixel) for the app icon. - PWA: the site is installable (manifest + icons + service worker) and
keeps previously visited pages readable offline.
src/lib/brand-icon.tsxis the one design used everywhere — ivory background, gold ॐ, matchingom-mark.tsxexactly — rendered live vianext/ogforsrc/app/icon.tsxandapple-icon.tsx;npm run generate-iconsrenders the sizes Next can't generate itself (favicon.ico, and the PWA manifest'spublic/icons/*.png) and writes them to disk. Re-run that script after changing the design.public/sw.jsis a small hand-written service worker (network-first for pages, cache-first for static assets,/adminalways bypassed) — no build plugin, so it isn't tied to webpack vs. Turbopack. It only registers in a production build (ServiceWorkerRegistrationchecksNODE_ENV) and actively unregisters itself undernext dev— dev-mode bundle URLs aren't content-hashed, so a cache-first SW left over from a previousnext startwill otherwise keep serving stale JS chunks through laternext devruns.