VedaAI is a full-stack AI assessment creator for teachers. It follows the provided Figma/UI references in ui/ and implements the flow from assignment creation to background generation to a structured printable question paper.
Figma reference:
apps/web: Next.js + TypeScript frontend with Zustand state management and Socket.IO client updates.apps/api: Express + TypeScript backend with REST APIs, Socket.IO, MongoDB persistence, Redis/BullMQ jobs, OpenAI structured generation, and local fallbacks.packages/shared: Shared TypeScript contracts for assignments, generation progress, and generated papers.
The backend is designed around clean boundaries:
- Routes validate input and call application services.
- Repository stores assignments and generated papers in MongoDB when
MONGODB_URIis present, otherwise memory for quick demos. - Queue uses BullMQ when
REDIS_URLis present, otherwise an in-process async worker. - Generator uses OpenAI structured JSON when
OPENAI_API_KEYis present, validates the response with Zod, and maps it into app-owned paper objects. It never renders raw model text.
- Assignment list and empty state based on the supplied desktop/mobile references.
- Create assignment form with file upload selection UI, due date, question type rows, count/marks steppers, source material, and validation.
- Real-time generation progress over WebSocket.
- Structured question paper output with student info lines, sections, instructions, difficulty tags, and marks.
- Backend PDF download endpoint powered by a BullMQ PDF job.
- Responsive desktop and mobile layouts.
Install dependencies:
npm installStart MongoDB and Redis for the complete backend flow:
docker compose up -dCreate apps/api/.env:
PORT=4000
CLIENT_URL=http://localhost:3000
MONGODB_URI=mongodb://localhost:27017/veda-ai
REDIS_URL=redis://localhost:6379
OPENAI_API_KEY=your_key_here
OPENAI_MODEL=gpt-4o-miniCreate apps/web/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:4000Run the API:
npm run dev:apiRun the web app:
npm run dev:webOpen:
http://localhost:3000
Full assignment mode:
- MongoDB stores assignments and generated papers.
- Redis powers BullMQ queue state and short-lived assignment/paper response caching.
- BullMQ processes generation and PDF jobs in the background.
- Socket.IO sends real-time progress to the frontend.
- OpenAI returns structured JSON, which is validated and rendered as sections/questions.
Demo mode:
- If
MONGODB_URI,REDIS_URL, orOPENAI_API_KEYare missing, the app still runs with memory storage, an in-process worker, and deterministic structured generation.
npm run typecheck
npm run build
npm run dev:api
npm run dev:web