Edu-Ai is a Next.js-based web application that ingests PDF files and uses AI backends to generate educational content — specifically summaries, flash-cards, and question-and-answer (Q&A) materials. It includes PDF upload and generation endpoints, user authentication, database wiring with Drizzle ORM, and integrations with Supabase, Clerk (auth), and OpenRouter (or other LLM providers).
This repository contains the full-stack app (Next.js app router), API routes for PDF upload and content generation, a small suite of UI components, and database configuration using Drizzle. Edu-Ai is a Next.js-based weEdu-Ai is a Next.js-based web application that ingests PDF files and uses AI backends to generate educational content — specifically summaries, flash-cards, and question-and-answer (Q&A) materials.b application that ingests PDF files and uses AI backends to generate educational content — specifically summaries, flash-cards, and question-and-answer (Q&A) materials.
- Next.js (App Router) front-end with React 19
- PDF ingestion and processing (upload PDFs → extract content → generate summaries / Q&A / flash-cards)
- Authentication via Clerk
- Database access with Drizzle ORM and migration tooling (drizzle-kit)
- File upload and AI generation endpoints (OpenRouter / OpenAI compatible)
- Supabase client utilities for storage or realtime features
- Tailwind + UI primitives for fast styling
app/— Next.js app router pages, API routes and server/actionsapp/api/— serverless API routes (file upload, generation, summaries, Q&A, flashcards)app/dashboard,app/generate,app/upload— example pages and flows
components/— shared React components (navbar, footer, UI primitives)db/— Drizzle ORM schema and database helperslib/— helper utilities (env loading, http helpers, supabase, router helpers)drizzle.config.ts— drizzle-kit configuration and migrations
- Next.js 16 (App Router)
- React 19
- TypeScript
- Drizzle ORM + drizzle-kit (migrations)
- Supabase (client integrations)
- Clerk (authentication)
- OpenRouter SDK (AI / LLM provider)
- Tailwind CSS
- Biome (lint/format)
- Node.js (v18+ recommended)
- pnpm (recommended, repository includes
pnpm-lock.yaml) — npm or yarn will also work - A Postgres-compatible database (for production) or a development DB pointed by
DATABASE_URL - Accounts/keys for the third-party services you plan to use (Clerk, Supabase, OpenRouter)
Copy the example env file and update values:
cp .env.example .env.local
# then edit .env.local and fill values.env.example includes the following variables (fill them):
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY— Clerk publishable keyCLERK_SECRET_KEY— Clerk secret keySUPABASE_URL— Supabase project URLSUPABASE_ROLE_KEY— Supabase service/role keyNODE_ENV— environment (development/production)DATABASE_URL— database connection string (Postgres)OPENROUTER_API_KEY— API key for OpenRouter or other LLM provider
Adjust or add any other env variables required by your deployment.
Recommended (pnpm):
# install
pnpm install
# run dev server
pnpm devYou can also use npm or yarn if you prefer:
npm install
npm run devThe Next.js dev server runs on http://localhost:3000 by default.
pnpm dev— run Next.js in development mode (alias fornext dev)pnpm build— build for production (next build)pnpm start— run production server (next start)pnpm db:migrate— run Drizzle migrations (usesdrizzle-kit)pnpm db:push— push schema (drizzle-kit)pnpm db:generate— generate migration files (drizzle-kit)pnpm db:studio— open drizzle studiopnpm lint— run Biome lint checkspnpm format— format code with Biome
Run migrations before starting if you connect to an empty DB:
pnpm db:generate # (optional) scaffold migration
pnpm db:migrateThis project includes API routes under app/api/ such as:
/api/files/[fileId]— file storage handlers/api/generate/...— generation endpoints for flash-cards, summaries, question-and-answer flows/api/upload/— file upload route
Check the route files for implementation details and expected payload shapes.
- Use Clerk dev keys or local test accounts when developing auth flows.
- If using Supabase storage or realtime features, ensure
SUPABASE_URLandSUPABASE_ROLE_KEYare correctly set. - For fast iteration on AI provider keys, set
OPENROUTER_API_KEYand verify requests in server logs.
This repo currently does not include automated tests. Adding a small test suite (Jest/Playwright/Vitest) is a recommended next step.
Contributions are welcome. Recommended workflow:
- Fork the repo
- Create a feature branch
- Run lint/format and tests (if added)
- Open a PR with a clear description
This project includes a LICENSE file in the repository root. Review it for licensing details.