Downloads · 30 days
0
Abhisingh-18/Vidya-AI
Vidya-AI is a machine learning model from Abhisingh-18. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
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…
Downloads · 30 days
0
Access
Public
Updated Jul 13, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.tsx305 KB · 25%
From the Hugging Face model README
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.
gpt-oss-20b:free, gemma-4-31b-it:free, gpt-oss-120b:free)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
You need a Postgres database — easiest is a free one from Neon, Supabase, or Render.
git clone https://github.com/Abhisingh18/Vidya-AI.git
cd Vidya-AI
npm install
# Set up env
cp .env.example .env.local
# Edit .env.local — add DATABASE_URL + OPENROUTER_API_KEY
# Push schema to DB + seed 40 lessons
npx prisma db push
npm run seed
npm run dev
Open http://localhost:3000.
See .env.example. Required:
| Variable | Purpose |
|---|---|
NEXTAUTH_URL | Public URL of the app |
NEXTAUTH_SECRET | Random secret for JWT signing |
OPENROUTER_API_KEY | Free LLM access for /api/generate |
GOOGLE_CLIENT_ID | Optional — Google OAuth |
GOOGLE_CLIENT_SECRET | Optional — Google OAuth |
DATABASE_URL | Optional override (defaults to local SQLite) |
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.
You only need two services:
| Service | Purpose |
|---|---|
| Vercel | Hosts the app (UI + API routes) |
| Render | Hosts the Postgres database (free tier is enough) |
postgresql://user:[email protected]/dbname.Sign in to https://vercel.com → Add New → Project → import the
Abhisingh18/Vidya-AI repo.
In Environment Variables, add:
| Key | Value |
|---|---|
DATABASE_URL | The Render Postgres URL from Step 1 |
NEXTAUTH_URL | https://<your-vercel-project>.vercel.app |
NEXTAUTH_SECRET | Run openssl rand -base64 32 to generate one |
OPENROUTER_API_KEY | Your key from https://openrouter.ai/keys |
GOOGLE_CLIENT_ID | (Optional — for Google login) |
GOOGLE_CLIENT_SECRET | (Optional — for Google login) |
Click Deploy. The build runs prisma generate && prisma db push && next build,
which automatically creates the Postgres tables on first deploy.
Once Vercel says “Ready”, populate the library by running the seed script against your production DB from your local machine:
# In your local shell, point DATABASE_URL to the Render URL temporarily:
DATABASE_URL="postgresql://..." npm run seed
That’s it — visit your Vercel URL’s /library and you’ll see all 40 lessons.
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.
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.
The 40 pre-built lessons are defined in scripts/videos-data.mjs. Each entry has:
topic, language, gradeduration (seconds)scriptLines — array of narration strings (becomes timed TTS captions)steps — scene-renderer instructions (shapes, equations, transitions)Add more entries to the VIDEOS array, then re-run node scripts/seed-videos.mjs. It is idempotent — skips topics already present for the seed user.
| Command | What it does |
|---|---|
npm run dev | Local dev server on :3000 |
npm run build | Prisma generate + db push + Next build (Vercel runs this) |
npm run start | Run production build |
npm run seed | Seed the 40 pre-built lessons |
npx prisma studio | Browse the DB in a GUI |
MIT — free to fork, learn from, and build on.