Live Demo: https://assignmentcreatorte5et.vercel.app/
Demo Video: https://drive.google.com/file/d/1WkQXU9whEcAfdaBnaeTykMEl16EI23s9/view?usp=sharing
An AI-powered Assignment Generator that creates structured academic assignments dynamically using AI.
- AI-generated assignment papers
- Structured question generation
- Real-time updates using WebSockets
- Background job processing with BullMQ
- PDF/file uploads using Cloudinary
- Assignment history & detail pages
- Responsive UI
- Proper form validation
- Zustand state management
- React.js
- Next.js
- TypeScript
- Tailwind CSS
- Zustand
- Socket.IO Client
- Node.js
- Next.js API Routes
- TypeScript
- MongoDB
- Redis (Upstash)
- BullMQ
- Gemini API
- Cloudinary
- Socket.IO
Frontend (Next.js)
│
▼
API Route (/api/assignment/create)
│
▼
BullMQ Queue (Redis / Upstash)
│
▼
Worker Server (Render)
│
▼
Gemini API
│
▼
MongoDB
│
▼
Socket.IO Update
│
▼
Frontendapp/
│
├── api/
│ └── assignment/
│ ├── create/
│ │ └── route.ts
│ ├── [id]/
│ │ ├── route.ts
│ │ └── page.tsx
│ ├── assignments/
│ │ └── page.tsx
│ └── createassignment/
│ └── page.tsx
│
├── mobilebottomnav/
├── navbar/
├── sidebar/
├── components/
│
├── lib/
│ ├── buildprompt.ts
│ ├── bullredis.ts
│ ├── cloudinary.ts
│ ├── db.ts
│ ├── gemini.ts
│ ├── queue.ts
│ ├── redis.ts
│ ├── socket.ts
│ ├── utils.ts
│ └── worker.ts
│
├── socket-server.ts
│
├── store/
│ └── assignmentStore.ts
│
└── models/
└── schema.ts- User submits assignment request
- API stores pending assignment
- Job added to BullMQ queue
- Worker processes assignment generation
- Gemini generates structured questions
- Result stored in MongoDB
- Socket event updates frontend in real-time
The system converts user input into a structured prompt and generates:
- Sections (A, B, C...)
- Questions
- Difficulty levels
- Marks distribution
LLM responses are structured before rendering.
- No empty fields
- No negative values
- File validation
- Structured request validation
| Route | Description |
|---|---|
/ |
Landing Page |
/assignments |
All Assignments |
/assignment/[id] |
Assignment Details |
/createassignment |
Create Assignment |
/api/assignment/create |
Create Assignment API |
/api/assignment/[id] |
Fetch Assignment API |
| Service | Platform |
|---|---|
| Frontend | Vercel |
| Worker Server | Render |
| Socket Server | Render |
| Redis | Upstash |
| File Storage | Cloudinary |
MONGODB_URI=
REDIS_URL=
GEMINI_API_KEY=
NEXT_PUBLIC_SOCKET_URL=
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=git clone <repo-url>
npm install
npm run devRun Worker:
npm run workerRun Socket Server:
npm run socketSamradhi Rathore
Full Stack Developer | MERN Stack Developer