Multi-tenant educational platform for managing small educational institutes.
Classera/
├── README.md # This file (only doc at repo root)
├── docs/ # All other documentation
│ ├── design/ # UI / design system
│ ├── project/ # Structure, recovery notes
│ ├── archive/ # Milestone / historical notes
│ └── database/ # DB reference (schema notes, API docs, security)
├── web/ # Next.js app (UI + API routes, Prisma)
├── database/ # SQL schema, policies, seeds, diagrams
└── scripts/ # Helper scripts (e.g. git push helpers)
cd database
psql -U postgres -d classera -f schema/01_core_tables.sql
# … run remaining schema files as in database/README.mdcd web
npm install
copy .env.local.example .env.local
# Edit .env.local with your database URL and secrets
npx prisma generate
npm run devThe dev script runs Next.js on port 3001 (see web/package.json). Open http://localhost:3001 and set NEXTAUTH_URL in web/.env.local to the same origin.
For a database schema that matches the Prisma models (typical local dev), run cd web && npx prisma db push after PostgreSQL is up, or apply the SQL under database/ as described in database/README.md.
| Kind | Command | Notes |
|---|---|---|
| Unit + API routes | cd web && npm test |
Vitest: lib/**/*.test.ts (pure helpers) and tests/api/**/*.test.ts (HTTP handlers with mocked session/DB; no database) |
| Integration | From web/: npm run test:integration |
Vitest, tests/integration/**/*.test.ts, uses DATABASE_URL (.env.local is loaded when not in CI). Run npx prisma db push first so the schema matches. |
| E2E smoke | From web/: npm run test:e2e (starts npm run dev on 3001 when CI is unset). In CI, run after npm run build; Playwright starts next start -p 3001. |
Playwright: e2e/smoke.spec.ts (login page, /api/health liveness, /api/health/ready). Readiness needs a working DATABASE_URL. |
GitHub Actions (.github/workflows/web-ci.yml) runs unit tests, integration tests, Playwright smoke, lint, typecheck, and build on every web/** change. Step-by-step CI behavior, env vars, and troubleshooting: docs/project/CI_AND_TESTING.md.
| Topic | Location |
|---|---|
| Index | docs/README.md |
| CI & testing | docs/project/CI_AND_TESTING.md |
| Design system | docs/design/DESIGN_SYSTEM.md |
| Database schema & API reference | docs/database/ |
| Web app (Next.js) | web/README.md |
| Production deploy | docs/project/DEPLOYMENT.md |
| Migrations / Prisma vs SQL | docs/project/MIGRATIONS.md |
| Database setup (SQL) | database/README.md |
- PostgreSQL schema with RLS-oriented design
- Multi-tenant institute model
- Next.js 14 (App Router) with Prisma and NextAuth
- Session, course, user, payment, and exam APIs; exams also have a dashboard list/create flow (see docs/project/EXAMS_SCOPE.md)
- App: Next.js 14, React, TypeScript, Tailwind, Prisma, NextAuth
- Database: PostgreSQL
- Row Level Security policies in SQL (see
database/policies/) - JWT / session handling via NextAuth (see
web/lib/auth.ts)
Private — educational platform.