Skip to content
All projects

AI Learning Platform

PrepForge Academic Hub

A personal AI learning environment: curriculum and study plans, a document library processed into a personal knowledge base, and a cited AI tutor in development.

Type
Personal
Availability
Private repository, in active development. No public demo yet.

Overview

PrepForge Academic is a personal AI learning environment for students. It organises programmes, courses and sessions, turns uploaded study material into a personal knowledge base, and is building towards a cited AI tutor and exam preparation.

Problem

Students in work-integrated programmes juggle slides, PDFs and notes across many courses. Generic chatbots don't know their syllabus or their material, and answers without citations can't be trusted for exam preparation.

Solution

A configurable curriculum catalog (seeded with the BITS Pilani WILP M.Tech AI & ML programme from public information), a personal study plan, and a document library whose files are parsed and chunked in the background as the first stage of a retrieval pipeline. The AI tutor will answer only from the student's own material, with citations.

What exists today

  • Accounts: sign-up, email verification, password reset, sessions

    Implemented
  • Configurable curriculum catalog with admin preview, diff and publish

    Implemented
  • Personal study plan: programmes, courses, sessions

    Implemented
  • Document library: upload, versions, downloads, deletion

    Implemented
  • Background parsing and chunking (PDF, DOCX, PPTX, XLSX, TXT)

    Implemented
  • Embeddings and hybrid retrieval

    In progress
  • AI tutor (structured teaching, cited Q&A)

    Clearly labelled demo prototype; no AI calls yet

    Experimental
  • Exam preparation, flashcards and progress analytics

    Planned

Architecture

  1. Client

    • Next.js 16 (App Router, Cache Components)
    • React Hook Form + Zod
  2. API

    • FastAPI modular monolith
    • auth · academic · subjects · documents · rag
  3. Background jobs

    • Celery worker: parse → chunk → embed
    • Email delivery
  4. Data

    • PostgreSQL 17 + pgvector
    • Redis (rate limits, broker)
    • File storage
PrepForge Academic: modular monolith. Simplified from the project's own design docs.

Technology stack

Frontend
  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • shadcn/ui
  • React Hook Form
  • Zod
Backend
  • Python 3.12
  • FastAPI
  • Pydantic v2
  • SQLAlchemy 2 (async)
  • Alembic
Data & jobs
  • PostgreSQL 17
  • pgvector
  • Redis
  • Celery
Testing
  • Pytest
  • Vitest
  • Testing Library
  • Playwright
  • GitHub Actions

My contribution

  • Sole designer and developer across product, frontend, backend, data model and infrastructure.
  • Designed the curriculum definition format so a new university programme is a JSON file, not a code change.
  • Built the ingestion pipeline and its failure handling: idempotent tasks, retries with backoff and user-readable failure reasons.

Engineering challenges

Untrusted uploads

Files are validated by extension, size and actual content (PDF magic bytes, OOXML structure, UTF-8), stored under opaque keys and hashed for de-duplication and versioning.

Concurrent document versions

Processing tasks act only on the document's current version, write under a row lock and discard results if a newer version was uploaded or the document was deleted meanwhile.

Structure-aware chunking

Chunks follow headings and never cross slide boundaries, and tables are kept whole where possible, so later retrieval returns coherent passages.

Design decisions

Modular monolith, not microservices
One deployable until a module needs independent scaling; document processing is already isolated behind Celery.
pgvector in PostgreSQL instead of a separate vector database
One system of record for documents, chunks and embeddings, with owner-scoped queries.
Labelled demo content for the tutor
The UI can be designed and tested now without presenting unvalidated AI answers as real.

Security

  • The server is the only authorization boundary; private study materials never leave the backend.
  • Argon2id password hashing; short-lived JWT access tokens with the algorithm pinned.
  • Rotating refresh tokens in HttpOnly cookies with replay detection that revokes the whole token family.
  • Email verification and reset tokens are single-use, hashed at rest and kept in the URL fragment so they stay out of logs.
  • Automated isolation tests check that one student can't access another's documents.

Testing approach

  • make check runs ruff, mypy, ESLint, tsc, Pytest (unit and integration), Vitest and a production build.
  • Playwright end-to-end tests on desktop and mobile, plus an acceptance journey against the real API and database in CI.

Results and lessons

  • Defining acceptance criteria per phase before building made 'done' unambiguous.
  • Shipping the ingestion pipeline before any AI keeps the tutor grounded in real, processed material.