Study Nexus: Building a High-Performance Learning Tracker for Ambitious Learners
StudyNexus is a minimalist operating system for serious learners. Build structured curriculums, track deep focus sessions, maintain momentum streaks, and measure your progress with real analytics — all in a single, distraction-free environment.

Overview
Self-directed learners often split their workflow across three disconnected tools: a static syllabus in Markdown, a standalone Pomodoro timer, and a spreadsheet or habit tracker that loses context the moment a schedule slips.
StudyNexus (internally architected as DPTS — Dynamic Personal Tracker System) unifies curriculum design, timed deep-work execution, and longitudinal analytics inside a single PostgreSQL-backed workspace. Rather than forcing learners into rigid course templates, it treats each learning track as a structured Tracker with custom boolean fields, day-by-day RoadmapItem milestones, a persistent focus timer, and portable JSON backups.
Architecture & Data Model
StudyNexus runs on Next.js 15 (App Router) and React 19, using Prisma 6 over PostgreSQL for relational persistence and Auth.js v5 (next-auth beta with @auth/prisma-adapter) for session management. Route groups separate authenticated workspace views ((app)), public roadmap sharing ((public)/share), marketing pages ((marketing)), and API endpoints (/api/*).
Core Workspace Pillars
| Pillar | Primary Route(s) | Key Capabilities |
|---|---|---|
| Roadmap Architect | /roadmaps, /builder | Drag-and-drop curriculum builder (@dnd-kit), Markdown table import, per-lesson progress tracking |
| Deep Focus Engine | Global across (app) | Persistent timer across navigation, scratchpad + mood session logs, Space start/pause & Ctrl+Enter commit |
| Learning Intelligence | /analytics, /logs | GitHub-style activity heatmaps, focus breakdowns, and velocity tracking via Recharts |
| Momentum System | /dashboard | Timezone-aware daily streaks, monthly streak freezes, and weekly goals |
| External Calendar Sync | /timetable | .ics iCal ingestion via node-ical alongside class schedules |
| Data Vault | /settings, /api/export | Full JSON export, additive imports, and factory reset |
| Instance Control | /admin, /api/admin | Open vs. invite-only registration, roadmap limits, hero configuration, auto-assigned OWNER role |
Key Engineering Highlights
1. Universal Markdown Curriculum Parser
Writing a multi-week study plan in Markdown is fast; converting it into relational database rows shouldn't require manual form entry. In src/lib/parser.ts, parseMarkdownTable(markdown) inspects Markdown tables whose headers contain day or milestone, extracts custom boolean tracking fields, and normalizes each row into structured roadmap items (dayNumber, title, objective, checkbox/list topics, and durationDays).
export interface ParsedRoadmap {
fields: { name: string; type: string }[];
roadmap: {
dayNumber: number;
title: string;
objective: string;
topics: string[];
durationDays: number;
}[];
}This lets learners paste an existing syllabus directly into /builder and immediately generate a trackable, reorderable curriculum.
2. Timezone-Aware Streak & Freeze Engine
Naive UTC day comparisons break daily habit streaks for users logging sessions late at night in their local timezone. In src/lib/streak.ts, updateUserStreak(userId) formats timestamps against the user's configured timezone via Intl.DateTimeFormat("en-CA", { timeZone: tz }), resets currentFreezes lazily to 3 at the start of each new month, and evaluates day deltas (diffDays):
diffDays === 0: Same-day activity preserves the active streak without double-counting.diffDays === 1: Consecutive-day activity increments the streak.2 <= diffDays <= 4: WhenautoConsumeFreezeis enabled, the engine automatically consumesdiffDays - 1freezes to bridge short breaks instead of wiping out long-running momentum.
3. Focus Persistence, Validation, and Instance Governance
- User-configurable focus guardrails: The
Usermodel storesdefaultTimerStyle,strictFocusMode,timerIncrement, andautoStartNextPomodoro, while eachTrackerretains its ownscratchpad,config,targetDays, andstatus. - Schema-first validation & hygiene: API inputs are validated with
zod, signups screen againstdisposable-email-domains, and passwords are hashed withbcrypt. - Self-hostable access control: The
/adminconsole governs whether an instance runs in open or invite-only mode (/api/invite), enforces per-user roadmap limits, and manages community/hero metadata—making StudyNexus usable both as a personal tracker and a private cohort tool.
Outcome
StudyNexus brings curriculum authoring, distraction-free session timing, streak resilience, and calendar awareness into a single typed full-stack application. By keeping data portable via JSON export/import and shareable via /share, learners retain full ownership of their study plans and session history.