Skip to content

ajtran303/study-tracker

Repository files navigation

Study Tracker

Personal study tracker with per-card spaced repetition, syllabus import, and study session tracking. Built for mobile-first use across devices.

Features

  • Syllabus Import — POST a JSON payload to create a course with all topics, assignments, and exams in one call. Designed to pair with Claude: give Claude your syllabus PDF + the import template, get back ready-to-upload JSON.
  • Per-Card SM-2 Flashcards — Spaced repetition at the individual card level (not per-topic). Cards activate for review only when linked to an upcoming exam, so you're always studying what matters.
  • Study Timer — Persistent timer with course selection and notes. Tracks study time across sessions with auto-save.
  • Daily Overview — Prioritized view of upcoming deadlines, in-progress topics, and SRS due cards with study stats (today's minutes, 7-day average, streak).
  • Deadlines — Consolidated view of all assignments and exams across courses, grouped by timeframe.
  • Calendar — Week list (mobile) and month grid (desktop) showing topic dates, assignment due dates, and exam dates.
  • Analytics — Study time by course (donut), by day of week (bar), and monthly heat map (GitHub-style grid).
  • Course Archiving — Archive completed courses to keep focus on active semesters.

Tech Stack

  • Framework: Next.js 15 (App Router) + React 19 + TypeScript
  • Database: PostgreSQL + Prisma 7
  • Auth: NextAuth v5 (single-user registration lock + JWT for API access)
  • Styling: Tailwind CSS v4 + shadcn/ui
  • Charts: Recharts
  • Testing: Vitest (289 tests)

Getting Started

Prerequisites

  • Node.js 20+
  • PostgreSQL database

Setup

# Install dependencies
npm install

# Set environment variables
cp .env.example .env
# Edit .env with your DATABASE_URL and NEXTAUTH_SECRET

# Run database migrations
npx prisma migrate dev

# Start development server
npm run dev

Environment Variables

DATABASE_URL=postgresql://user:password@localhost:5432/study_tracker
NEXTAUTH_SECRET=your-secret-here
NEXTAUTH_URL=http://localhost:3000

Usage

First Run

  1. Visit the app and register (only one user can register — single-user lock)
  2. Import a syllabus via the API (see Syllabus Import Template)
  3. Start studying!

Workflow

  1. Import syllabus — Give Claude your syllabus PDF + the template from docs/syllabus-import-template.md. POST the resulting JSON to /api/v1/import.
  2. Create flashcards — Take notes, give them to Claude + the template from docs/flashcard-upload-template.md. POST to /api/v1/flashcards/upload.
  3. Study — Use the timer to track sessions. Review flashcards when they're due (exam-scoped SRS). Check deadlines and daily overview.
  4. After exams — Mark exams as completed. Their linked flashcards go dormant. Archive courses when the semester ends.

API Documentation

Visit /docs for the interactive Swagger UI, or see public/openapi.json for the raw spec.

Project Structure

src/
  app/
    (auth)/login/       # Login/register page
    (app)/              # Authenticated app pages
      courses/          # Course list + detail
      timer/            # Study timer
      flashcards/       # SRS review + browse
      deadlines/        # Consolidated deadlines
      calendar/         # Week/month calendar
      analytics/        # Charts and heat map
    api/v1/             # REST API endpoints
    docs/               # Swagger UI
  components/           # React components
  contexts/             # Study timer context
  lib/                  # Utilities, schemas, SRS algorithm
  generated/prisma/     # Generated Prisma client
prisma/
  schema.prisma         # Database schema
docs/
  syllabus-import-template.md
  flashcard-upload-template.md

Testing

npm test              # Run all tests
npm run test:watch    # Watch mode

289 tests covering:

  • SM-2 algorithm correctness
  • Zod schema validation
  • All API endpoints (auth, CRUD, aggregations)
  • Multi-step integration workflows

About

A mobile-first study tracker built with Next.js 15, Prisma, and NextAuth. Features per-card SM-2 spaced repetition scoped to upcoming exams, a study timer, syllabus import API, deadlines, calendar, and a 90-day activity heatmap. Improves upon and replaces cyberstudy-scheduler.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages