Case Study · WIP

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.

RoleCreator & Maintainer
StackNext.js, PostgreSQL+Prisma, Auth.js, Tailwind CSS 3.4, Framer Motion, Recharts, Lucide React, Zod, Sonner
TimelineMar 2026 – Present
Study Nexus Dashboard
Study Nexus Dashboard

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/*).

Workspace UI (App Router) /dashboard · /roadmaps /builder · /analytics /logs · /timetable /settings · /admin dnd-kit · Recharts · Tailwind Persistent Deep Focus Timer Core Engines & APIs parseMarkdownTable() updateUserStreak() node-ical Calendar Sync Zod Validation & Auth.js v5 /api/entries · /api/export /api/cron · /api/admin PostgreSQL + Prisma User · Subject · Tracker RoadmapItem · Field Entry · OneOffTask ClassSchedule · ExternalCal SharedRoadmap · Release GlobalStats · TaskCompletion
High-level StudyNexus workspace architecture across App Router routes, domain engines, and PostgreSQL models.

Core Workspace Pillars

PillarPrimary Route(s)Key Capabilities
Roadmap Architect/roadmaps, /builderDrag-and-drop curriculum builder (@dnd-kit), Markdown table import, per-lesson progress tracking
Deep Focus EngineGlobal across (app)Persistent timer across navigation, scratchpad + mood session logs, Space start/pause & Ctrl+Enter commit
Learning Intelligence/analytics, /logsGitHub-style activity heatmaps, focus breakdowns, and velocity tracking via Recharts
Momentum System/dashboardTimezone-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/exportFull JSON export, additive imports, and factory reset
Instance Control/admin, /api/adminOpen 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).

ts
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: When autoConsumeFreeze is enabled, the engine automatically consumes diffDays - 1 freezes to bridge short breaks instead of wiping out long-running momentum.

3. Focus Persistence, Validation, and Instance Governance

  • User-configurable focus guardrails: The User model stores defaultTimerStyle, strictFocusMode, timerIncrement, and autoStartNextPomodoro, while each Tracker retains its own scratchpad, config, targetDays, and status.
  • Schema-first validation & hygiene: API inputs are validated with zod, signups screen against disposable-email-domains, and passwords are hashed with bcrypt.
  • Self-hostable access control: The /admin console 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.

NEWSLETTER

Stay synced with AI systems, research logs, and engineering build notes.