VidyaAI — Har topic, har bhasha, har student......
AI-powered animated educational video generation platform for Indian students. Type any topic and watch AI teach it with synchronized voice narration, visual scenes (geometry, equations, diagrams), and a downloadable Manim source — in 22 Indian languages.
TTS: Web Speech API (no external TTS service needed)
Icons: lucide-react
Project Structure
src/
app/
api/
auth/[...nextauth]/ # NextAuth route
generate/ # LLM call → script + scene + manim
library/ # Public list + single-video endpoints
videos/ # User-scoped CRUD + watch tracking
user/stats/ # Streak + dashboard data
library/ # Gallery page + /library/[id] watch page
generate/ # Topic input + live player
dashboard/ # Streak + history
components/
generated-video-player # Player that combines TTS + SceneRenderer
scene-renderer # SVG animation engine
navbar / footer
prisma/
schema.prisma # User, Video, Watch, Streak, Bookmark, …
migrations/
scripts/
seed-videos.mjs # Bulk-loads 40 handcrafted lessons
videos-data.mjs # The lesson data itself
Getting Started Locally
You need a Postgres database — easiest is a free one from
Neon, Supabase, or
Render.
bash
1git clone https://github.com/Abhisingh18/Vidya-AI.git
2cd Vidya-AI
3npminstall45# Set up env6cp .env.example .env.local
7# Edit .env.local — add DATABASE_URL + OPENROUTER_API_KEY89# Push schema to DB + seed 40 lessons10npx prisma db push
11npm run seed
1213npm run dev
This is a Next.js monolith — frontend + backend deploy together on Vercel.
There is no separate backend folder, because every src/app/api/*/route.ts runs
as a serverless function on the same Vercel deployment.
Click Deploy. The build runs prisma generate && prisma db push && next build,
which automatically creates the Postgres tables on first deploy.
Step 3 — Seed the 40-video library
Once Vercel says “Ready”, populate the library by running the seed script against
your production DB from your local machine:
bash
1# In your local shell, point DATABASE_URL to the Render URL temporarily:2DATABASE_URL="postgresql://..."npm run seed
That’s it — visit your Vercel URL’s /library and you’ll see all 40 lessons.
Re-deploys
Every git push to main triggers a Vercel rebuild. The prisma db push
step inside build reconciles your Postgres schema with any new fields you’ve
added to prisma/schema.prisma. If a schema change would drop data, the build
will fail safely — add --accept-data-loss to the build script only when you
intend that.
Why not a separate backend/ folder?
In a traditional split-stack app you’d have frontend/ (React on Vercel) and
backend/ (Express on Render). With Next.js App Router the API routes live
inside the same project and ship to the same serverless deployment. You only
need a separate backend service if you need long-running processes, WebSocket
servers, or background workers — none of which this app uses.