BrainMap is a diagnostic-first learning app that builds a live concept map from real student performance.
Instead of suggesting what to study by fixed curriculum order, it recommends what to repair next based on:
- weak mastery
- concept bottleneck impact (prerequisite graph)
- recent mistakes
Current vertical: AP Physics 1.
- 5-screen MVP flow:
- onboarding
- diagnostic / drill / daily question flow
- brain map + next 3 nodes
- concept node page with micro-lesson
- session results with mastery deltas
- Evidence-based mastery updates (confidence-aware)
- Prerequisite graph and bottleneck recommender
- Mistake bank with review scheduling
- AI helpers (OpenAI):
- contextual hint
- wrong-answer explanation
- isomorphic similar-question generation
- Backend: TypeScript + Express + Postgres
- Frontend: Vanilla JS/CSS SPA served by Express
- AI: OpenAI API (
chat.completionsJSON mode)
flowchart LR
U["Student"] --> FE["Vanilla SPA (app.js)"]
FE --> API["Express API (index.ts)"]
API --> D["Domain Logic (mastery/recommender/session selection/AI)"]
D --> DB["Postgres (schema.sql)"]
D --> OAI["OpenAI API (optional features)"]
DB --> API
API --> FE
src/backend API + domain logicpublic/frontend SPAdb/schema.sqlschemadb/seed.tsanddb/seed-data.tsseed pipeline and starter datadocs/API contracts and demo workflowscompose.yamllocal Postgres helper
- Node.js 20+
- npm 10+
- Docker Desktop (recommended) or local Postgres
- OpenAI API key (optional unless you want AI endpoints/features)
- Clone and enter project.
git clone https://github.com/MaruthiV/brainmap.git
cd brainmap- Install dependencies.
npm install- Create env file.
cp .env.example .env- Edit
.env.
PORT=3000
DATABASE_URL=postgres://postgres:postgres@localhost:5432/brainmap
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o-mini- Start Postgres.
Option A (recommended):
npm run db:upOption B: use your own Postgres and keep DATABASE_URL aligned.
- Seed database.
npm run seed- Run app.
npm run devOpen the URL printed in logs. If 3000 is busy, BrainMap auto-falls back to the next free port.
- Enter email, choose track, set goal date, click Continue.
- Complete the 15-question diagnostic (required before map access).
- Review your brain map and the next 3 nodes.
- Start drills from weak nodes.
- Run daily repair sessions to keep weak areas improving.
- Use AI controls in question flow when needed:
AI HintAI: Why I Missed ThisAI: Similar Question
npm run devstart dev servernpm run buildcompile TypeScriptnpm run typechecktype checking onlynpm run seedcreate/update schema and seed datanpm run db:upstart Postgres via Dockernpm run db:downstop Postgres and remove volume
- See
docs/api.mdfor endpoint contracts. - See
docs/demo-workflow.mdfor cURL workflow.
- 1 track:
ap-physics-1 - 20 concepts + prerequisite edges
- 20 concept micro-lessons
- 40 starter MCQs with concept tags
No license file is currently included. Add one before public/commercial distribution.