Your second brain for CP & DSA
Track every problem you solve: notes, solutions, revisions, mistakes, contests and progress.
Local-first. Your data stays on your machine in a single SQLite file.
Features · Quick start · Your data · Scripts · Tech stack
| 🧩 Problems | Paste a link from LeetCode, Codeforces, CodeChef, AtCoder, GFG, CSES and more; the platform and title fill in. Tag difficulty, patterns and topics. |
| 📝 Notes & solutions | Markdown notes with math and syntax highlighting. Several solutions per problem, each with its time and space complexity. |
| 📈 Attempt history | Log every solve, revision and re-solve with its outcome (alone / hint / editorial) and the mistakes you made. |
| 🗂️ Revision board | Drag cards from To Revise → Revising → Confident, then run focused revision sessions. |
| 🏆 Contests | Rank, problems solved in the contest, and an upsolve queue so nothing is left behind. |
| 📊 Dashboard | Streaks, a GitHub-style activity heatmap, pattern and difficulty breakdowns, your most common mistakes. |
| ⚡ Keyboard-first | Full-text search across titles, notes and code (Ctrl K). Shortcuts for everything (?). |
| 🛡️ Safe by default | Daily automatic backups with one-click restore, JSON export / import, Markdown export of every problem. |
Requirements: Node.js 22+ and pnpm (corepack enable or npm i -g pnpm).
git clone https://github.com/RAJDEEKSHITH/cortex.git
cd cortex
pnpm install
pnpm devOpen http://localhost:5173. The database is created and migrated on first start.
Tip
Want to look around first? Run pnpm db:seed to load sample problems, contests and history.
The seed refuses to run when you already have data.
| What | Where |
|---|---|
| Database | server/data/cortex.db |
| Daily backups (newest 14 kept) | server/data/backups/ |
| Markdown exports | server/exports/ |
All of it is git-ignored. To keep a copy off your machine, use Settings → Download JSON now and then; Import on any machine restores it.
| Variable | Default | Purpose |
|---|---|---|
CORTEX_DB_PATH |
server/data/cortex.db |
Custom database file (its backups go next to it) |
PORT |
3001 |
API port |
Warning
pnpm db:reset and pnpm db:seed --force delete your data. They're meant for development.
| Command | Does |
|---|---|
pnpm dev |
Runs the app (UI on 5173, API on 3001) |
pnpm build |
Builds the client for production |
pnpm test |
Runs the server and shared tests |
pnpm typecheck · pnpm lint |
Type-checks all packages · lints the client |
pnpm db:seed |
Loads sample data |
pnpm db:studio |
Opens Drizzle Studio to browse the database |
pnpm db:reset |
Deletes the database and recreates it empty |
Client: React 19 · TypeScript · Vite · Tailwind CSS v4 · shadcn/ui (Base UI) · TanStack Query · CodeMirror · Shiki · dnd-kit
Server: Express 5 · SQLite (better-sqlite3) · Drizzle ORM · FTS5 full-text search
Shared: Zod schemas and constants used by both sides
cortex/
├─ client/ React app
├─ server/ Express API + SQLite database
└─ shared/ Zod schemas, constants, utilities
Issues and pull requests are welcome. Before opening a PR, run:
pnpm typecheck && pnpm lint && pnpm testIMPLEMENTATION.md holds the full spec (data model, API, UI) and
PROGRESS.md the build log and design decisions.
Built for the long grind of competitive programming and DSA. Happy solving! 🧠