Version 0.6.0
BloomIQ is an AI-driven question paper generation platform for academic institutions. It uses Bloom's Taxonomy to produce educationally rigorous examination questions from uploaded course materials (PDFs), with a multi-level approval workflow, role-based access control, and support for both cloud (Google Gemini) and local (Ollama) AI processing.
For a deep technical reference, see ARCHITECTURE.md.
- AI-Powered Analysis: Deep material analysis using Gemini or Ollama via the Vercel AI SDK
- Bloom's Taxonomy Alignment: Questions mapped to cognitive levels (Remember → Create)
- Multiple Question Types: Direct, problem-based, and scenario-based questions
- Marks Distribution: 2, 8, and 16 mark questions with appropriate depth
- Real-World Grounding: Optional web search (Tavily / Serper) for scenario context
- Validation: AI-powered checks of a paper against course outcomes and Bloom's distribution
- Paper Patterns: Define exam structure (Part A / Part B, marks, units) with its own approval workflow
- Paper Assembly: Controller of Examinations selects approved questions to assemble final papers
- PDF Export: Export question banks and papers with LaTeX math (KaTeX) and Mermaid diagram support
- Faculty can chat with uploaded course materials for context-aware Q&A
- Embeddings via Google
text-embedding-004(cloud) ornomic-embed-text(local)
| Role | Code | Responsibility |
|---|---|---|
| Admin | ADMIN |
User and course management, system administration |
| Course Coordinator | COURSE_COORDINATOR |
Upload materials, generate questions, create patterns, first-level review |
| Module Coordinator | MODULE_COORDINATOR |
Second-level question review, pattern approval |
| Program Coordinator | PROGRAM_COORDINATOR |
Third-level question review, pattern approval |
| Controller of Examination | CONTROLLER_OF_EXAMINATION |
Final pattern approval, paper assembly and finalization |
- Dual AI Support: Gemini (cloud) or Ollama (local)
- Round-Robin API Keys: Rotates through multiple Gemini keys (
GEMINI_API_KEY,GEMINI_API_KEY_1, …) to avoid rate limits - Intelligent Chunking: Automatic handling of large PDF documents (parsed in memory)
- Semantic Search: Vector embeddings stored as PostgreSQL
Float[]columns, cosine similarity computed in application code - Vercel Ready: Deployable to Vercel with Neon DB
| Layer | Technology |
|---|---|
| Runtime / Package Manager | Bun |
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | TypeScript 5 (strict) |
| API | tRPC v11 + TanStack React Query v5 (superjson transformer) |
| Database | PostgreSQL 16 (Docker for dev, Neon DB for production) |
| ORM | Prisma v7 with @prisma/adapter-pg |
| Authentication | Better Auth v1.4 (email/password, session cookies) |
| AI SDK | Vercel AI SDK v6 |
| AI (Cloud) | Google Gemini (gemini-2.5-flash) via @ai-sdk/google |
| AI (Local) | Ollama (mistral:7b) via ollama-ai-provider-v2 |
| Vector Storage | PostgreSQL Float[] — cosine similarity in app code |
| UI | shadcn/ui + Radix UI, Tailwind CSS v4 |
| Data Tables | TanStack Table v8 |
| Forms | React Hook Form v7 + Zod v4 |
| PDF Processing | pdf-parse + custom chunking |
- Bun runtime installed
- Docker (for local development) or a Neon DB account (for production)
- Minimum 8 GB RAM (16 GB recommended when running Ollama locally)
git clone https://github.com/your-org/bloom-iq.git
cd bloom-iq
bun installcp .env.example .envThen edit .env. For a local Docker database the DATABASE_URL / DIRECT_URL defaults work as-is — you only need to set:
BETTER_AUTH_SECRET— any random 32+ char string (openssl rand -base64 32)GEMINI_API_KEY— a free key from Google AI Studio
.env.example documents every other variable, including the Ollama block if you prefer running the model locally (AI_PROVIDER=OLLAMA).
Local development:
docker compose -f docker-compose.dev.yml up -d(The container has no restart policy — run this again after a reboot.)
Production: use Neon DB.
One command generates the Prisma client, applies migrations, and seeds test data:
bun run setup...or run the steps individually
bunx prisma generate # generate the Prisma client into src/generated/prisma
bunx prisma migrate deploy # apply migrations
bun run prisma/seed.ts # seed test data (100 users, 25 courses, materials)The seed creates a ready-to-use admin account:
| Password | |
|---|---|
admin@bloomiq.com |
Password@123 |
All other seeded accounts (course/module/program coordinators, COE) use the same password. Their emails are printed at the end of the seed output in the form first.lastN@bloomiq.com.
bun run devThe app runs at http://localhost:3000. Sign in with admin@bloomiq.com / Password@123.
- Get an API key from Google AI Studio.
- Set
AI_PROVIDER=GEMINI. - Add one or more API keys.
Rate-limit avoidance — add multiple keys for automatic round-robin rotation:
GEMINI_API_KEY=key1
GEMINI_API_KEY_1=key2
GEMINI_API_KEY_2=key3- Install Ollama: https://ollama.com/download
- Pull the models:
ollama pull mistral:7b ollama pull nomic-embed-text:v1.5
- Set
AI_PROVIDER=OLLAMAand theOLLAMA_*variables.
- Sign up at https://neon.tech and create a project.
- Copy the pooled and direct connection strings.
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL |
Yes | Neon pooled connection string |
DIRECT_URL |
Yes | Neon direct connection string (migrations) |
BETTER_AUTH_SECRET |
Yes | Secure random string (32+ chars) |
BETTER_AUTH_URL |
Yes | Your Vercel app URL |
AI_PROVIDER |
Yes | GEMINI or OLLAMA |
GEMINI_API_KEY |
If Gemini | Primary API key |
GEMINI_API_KEY_1..N |
Optional | Additional keys for round-robin |
GEMINI_MODEL |
Optional | Default: gemini-2.5-flash |
TAVILY_API_KEY / SERPER_API_KEY |
Optional | Web-search grounding |
vercel --prodThe build script runs prisma generate before next build, so the Prisma client is generated on every deploy.
bloom-iq/
├── src/
│ ├── actions/ # Server actions (auth, etc.)
│ ├── app/ # Next.js App Router
│ │ ├── (auth)/ # sign-in, sign-up
│ │ ├── (home)/ # marketing / landing
│ │ ├── admin/ # Admin dashboard
│ │ ├── coordinator/ # Coordinator dashboard
│ │ ├── coe/ # Controller of Examinations dashboard
│ │ └── api/ # auth, trpc, upload, coordinator routes
│ ├── components/ # React components (ui/, auth/, data-table/)
│ ├── services/
│ │ └── ai/ # AI engine (index.ts, parsers/, prompts/)
│ ├── trpc/routers/ # tRPC routers (_app, admin, coordinator,
│ │ # paper, pattern, question-approval,
│ │ # question-bank, user)
│ ├── lib/ # auth, prisma, utilities
│ ├── hooks/ # React hooks
│ ├── validators/ # Zod schemas
│ ├── types/ # Shared types
│ └── generated/prisma/ # Generated Prisma client (git-ignored)
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.ts # Database seeding
├── prisma.config.ts # Prisma v7 CLI config
├── docker-compose.dev.yml # Local PostgreSQL
└── ARCHITECTURE.md # Full technical reference
| Level | Cognitive Process | Difficulty | Marks |
|---|---|---|---|
| REMEMBER | Recall facts, definitions | EASY | 2 |
| UNDERSTAND | Explain concepts | EASY | 2 |
| APPLY | Apply theory to examples | MEDIUM | 8 |
| ANALYZE | Compare, contrast, examine | MEDIUM | 8 |
| EVALUATE | Justify, critique, assess | HARD | 16 |
| CREATE | Design, formulate, produce | HARD | 16 |
- DIRECT — definition-based, explanatory, list/identify
- PROBLEM_BASED — apply theory, solve problems, step-by-step
- SCENARIO_BASED — real-world situations, multi-step reasoning
Questions flow through Course Coordinator → Module Coordinator → Program Coordinator. Paper patterns are approved by Module Coordinator → Program Coordinator → Controller of Examination before a paper can be assembled.
# Development
bun run dev # Start dev server (Turbopack)
bun run build # prisma generate && next build
bun run start # Start production server
# Database
bun run setup # generate + migrate deploy + seed (first-time setup)
bun run generate # prisma generate
bun run migrate # prisma migrate dev (create a new migration)
bun run db:migrate # prisma migrate deploy (apply existing migrations)
bun run db:reset # prisma migrate reset --force (drop, re-migrate, re-seed)
bun run seed # bun run prisma/seed.ts
bunx prisma studio # Open the database GUI
# Code Quality
bun run lint # Run ESLint
bun run lint:fix # Run ESLint with --fixAdd multiple API keys for round-robin rotation (GEMINI_API_KEY, GEMINI_API_KEY_1, GEMINI_API_KEY_2, …).
# Local PostgreSQL
docker compose -f docker-compose.dev.yml ps
docker compose -f docker-compose.dev.yml logs postgresFor Neon, make sure the connection string includes ?sslmode=require and that DIRECT_URL points at the non-pooled endpoint.
- Confirm
AI_PROVIDERand the matching provider variables are set - Check API key validity
- Verify the PDF has extractable text (not scanned images)
- Check the application logs for detailed error messages
This project is licensed under GNU Affero General Public License (GNU AGPL)
Leave a start if you felt the repo was useful ⭐