Skip to content

Repository files navigation

๐Ÿง  Assignly

AI-powered Assessment Creator
Structured Generation โ€ข Validation โ€ข Async Processing โ€ข Real-Time Updates

A system design-focused project that generates exam-ready question papers using AI, with a focus on reliability, structured output, and continuous improvement.


๐ŸŽฅ Demo

๐Ÿ‘‰ https://youtu.be/Rtrf6n0DlC8


๐Ÿ“„ Sample Paper Generations

A few outputs generated by the system:

๐Ÿ“‘ Sample Paper 1

๐Ÿ“‘ Sample Paper 2

โšก These outputs are generated by the current system. Quality and validation are actively being improved over time.


๐Ÿ–ผ๏ธ Product Preview


๐Ÿš€ Overview

Assignly is a system design-oriented project focused on building a reliable AI pipeline for generating structured question papers.

Instead of directly using AI responses, the system processes outputs through multiple stages to improve consistency and usability.


๐Ÿง  Core Pipeline

Parse โ†’ Validate โ†’ Normalize โ†’ Store โ†’ Deliver

โš™๏ธ System Behavior

This project follows a controlled AI execution approach:

๐Ÿ”น Controlled Processing

  • Input is structured before sending to AI
  • AI output is treated as untrusted data
  • Validation layers refine and filter output

๐Ÿ”น Asynchronous Execution

  • Requests are queued using BullMQ
  • Workers process jobs independently
  • Helps handle multiple requests efficiently

๐Ÿ”น Fault Handling

  • Retry mechanism for failures
  • Invalid outputs are rejected
  • Basic fallback strategies applied

๐Ÿ”น Real-Time Updates

  • WebSockets provide live updates
  • Reduces polling
  • Improves responsiveness

๐Ÿ› ๏ธ Tech Stack

Layer Technologies
Frontend Next.js, TypeScript, Tailwind CSS
Backend Node.js, Express, TypeScript
Database MongoDB Atlas
Queue/Cache Redis + BullMQ
Real-Time WebSockets
AI Gemini / LLM APIs
Deployment Vercel, Render, Upstash

โœจ Features

  • AI-based question paper generation
  • Structured input with difficulty control
  • Validation pipeline for output quality
  • Background job processing (BullMQ)
  • Real-time updates via WebSockets
  • Basic credit-based usage system

Assignly โ€“ System Architecture

๐Ÿ”— Architecture Diagram

Assignly Architecture


๐Ÿ”„ System Flow

1. ๐Ÿ” User Authentication

  • Users log in via Google OAuth
  • Backend generates a JWT token
  • Token is used for all protected API requests

2. ๐Ÿ“ฉ Request Submission

  • Users submit assignment requests from the frontend
  • Request passes through:
    • Auth Middleware
    • Validation Middleware (Zod)

3. ๐ŸŽฏ Controller & Credit Check

  • Controller receives validated request
  • System verifies user credits:
    • โŒ No credits โ†’ Prompt upgrade/login
    • โœ… Credits available โ†’ Proceed

4. โš™๏ธ Service Layer Processing

  • Creates a pending assignment in MongoDB
  • Pushes job to Bull Queue (Redis-based)

5. ๐Ÿงต Queue & Worker Execution

  • Worker consumes job asynchronously
  • Heavy processing handled outside request-response cycle

6. ๐Ÿค– AI Generation Engine

  • AI (Gemini with fallback) generates the assignment
  • Built-in retry mechanism on failure

7. ๐Ÿ” Processing Pipeline

  • Parsing โ†’ Converts raw AI output into structured JSON
  • Validation โ†’ Ensures correctness & completeness
  • Distribution Logic โ†’ Verifies marks distribution & difficulty balance

8. ๐Ÿ’พ Data Persistence

  • Final assignment stored in MongoDB
  • Cached in Redis for fast retrieval

9. โšก Real-Time Updates

  • Worker emits events via Socket.io
  • Frontend receives live updates:
    • processing
    • completed

10. โœ… Final Response

  • Frontend fetches final assignment
  • Displays the generated paper to the user

โšก Key Highlights

  • Queue-based async processing with Bull + Redis
  • AI fallback mechanism for reliability
  • Real-time updates via Socket.io
  • Credit-based access control
  • Clean layered architecture (Controller โ†’ Service โ†’ Worker)
  • Designed to be scalable and production-ready

๐Ÿง  AI Processing Pipeline

  • Prompt Builder โ†’ structured input
  • AI Generation โ†’ raw output
  • Parser โ†’ JSON extraction
  • Validator โ†’ removes invalid data
  • Normalizer โ†’ formatting & deduplication

โš ๏ธ Raw AI output is not shown directly.


๐Ÿ“Š Marks Engine

  • Difficulty-based distribution
  • Weighted marks allocation
  • Maintains total marks consistency

๐Ÿ›Ÿ Reliability

  • Retry mechanism (up to 3 attempts)
  • Invalid output rejection
  • Basic fallback generation
  • Duplicate removal

โšก Performance

  • Redis caching
  • Asynchronous processing
  • Cache-first fetching

๐Ÿš€ Deployment

Service Platform
Frontend Vercel
Backend Render
Redis Upstash
Database MongoDB Atlas

๐Ÿ”ฎ Future Improvements

  • Improve AI validation and consistency
  • Add export formats (PDF, DOCX)
  • Better difficulty balancing
  • Answer key validation system

๐Ÿค Contributing

  1. Fork the repository
  2. Create a new branch
  3. Commit your changes
  4. Open a Pull Request

๐Ÿ“„ License

MIT License


Made with โค๏ธ by Nikhil Gupta
โšก Learning, building, and improving systems step by step

About

AI-powered Assessment Creator with Structured Generation, Validation & Real-Time Processing

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages