AI-powered study tool — upload notes, ask questions with RAG retrieval, and generate practice quizzes.
| Layer | Technology |
|---|---|
| Frontend | React + Vite + Tailwind CSS |
| Backend | Node.js + Express |
| Database | PostgreSQL + Prisma |
| Vector Search | pgvector |
| Embeddings | Xenova/all-MiniLM-L6-v2 (local) |
| LLM | Groq (Llama 3.3 70B) |
| Auth | JWT + bcryptjs |
- Node.js 18+
- PostgreSQL with pgvector extension (Supabase, Neon, Railway, or local with
CREATE EXTENSION vector)
# Backend
cd backend
npm install
# Frontend
cd ../frontend
npm install# Backend — copy and edit
cp backend/.env.example backend/.env
# Set your DATABASE_URL, GROQ_API_KEY, and JWT_SECRET
# Frontend — copy and edit
cp frontend/.env.example frontend/.envMake sure your PostgreSQL has pgvector enabled:
CREATE EXTENSION IF NOT EXISTS vector;Then run Prisma migrations:
cd backend
npx prisma migrate dev --name initThis creates all tables and the vector column.
Note: If Prisma migration doesn't create the embedding column (due to
Unsupportedtype), run this SQL manually:ALTER TABLE "NoteChunk" ADD COLUMN IF NOT EXISTS embedding vector(384); CREATE INDEX IF NOT EXISTS note_chunk_embedding_idx ON "NoteChunk" USING hnsw (embedding vector_cosine_ops);
# Terminal 1 — Backend
cd backend
npm run dev
# Terminal 2 — Frontend
cd frontend
npm run dev- Frontend: http://localhost:5173
- Backend: http://localhost:5000
- API Health: http://localhost:5000/api/health
- Auth: Signup, login, JWT-based session, protected routes
- Upload: PDF and TXT files, auto-chunked and embedded
- RAG Q&A: Ask questions, get answers from your notes with source citations
- Quiz Generator: MCQ quizzes with adjustable difficulty, interactive answer reveal
- Dashboard: View all notes, status tracking, auto-refresh during processing
| Method | Route | Description |
|---|---|---|
| POST | /api/auth/signup |
Create account |
| POST | /api/auth/login |
Login |
| GET | /api/auth/me |
Get current user |
| GET | /api/notes |
List user notes |
| POST | /api/notes/upload |
Upload file |
| GET | /api/notes/:id |
Get note |
| DELETE | /api/notes/:id |
Delete note |
| POST | /api/chat/:noteId/ask |
Ask question (RAG) |
| GET | /api/chat/:noteId/history |
Chat history |
| POST | /api/quiz/:noteId/generate |
Generate quiz |
| GET | /api/quiz/:noteId/history |
Quiz history |
- Build:
npm run build - Output:
dist/ - Set
VITE_API_URLto your backend URL
- Build:
npm install - Start:
npm start - Set all env vars from
.env.example - Ensure PostgreSQL addon with pgvector support
ai-notes/
├── frontend/ # React + Vite + Tailwind
│ └── src/
│ ├── api/ # API client layer
│ ├── components/# UI, layout, notes, chat, quiz
│ ├── contexts/ # Auth context
│ └── pages/ # Landing, Login, Signup, Dashboard, NoteWorkspace
├── backend/ # Express + Prisma
│ ├── prisma/ # Schema & migrations
│ └── src/
│ ├── config/ # Environment config
│ ├── controllers/
│ ├── lib/ # Prisma, Groq, file parser
│ ├── middleware/ # Auth, upload, validation, errors
│ ├── routes/
│ └── services/ # Core business logic
└── README.md