Skip to content
DavinchighPublic

About

Study planner that turns deadlines into a realistic weekly plan. React, Three.js, FastAPI, Postgres.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

StudyFlow

A study planner that turns upcoming deadlines into a realistic weekly plan.

StudyFlow helps a student see what is due, how much estimated work remains, and which task to start next. A focus timer records completed study blocks separately from estimates, so progress insights distinguish planned effort from time actually spent.

Live test version: https://studyflow-kappa-ashen.vercel.app

StudyFlow's Now screen in dark mode: the next task, a 25 minute focus timer and the week's study totals

Portfolio project built with React, React Three Fiber (three.js), ShaderGradient and FastAPI. Hosted on Vercel with Neon Postgres; runs locally on SQLite or with Docker Compose. Each browser gets a private workspace, and signing in is optional. The 3D layers are lazy-loaded with CSS fallbacks. See DEPLOY.md.

The story

Students often have assignments spread across subjects and deadlines, but a task list alone does not show whether the week is manageable. StudyFlow brings each task's subject, due date, and estimated effort together, then turns those details into a short-horizon workload view. A focus timer makes actual study time visible without treating an estimate as completed work.

What you can do

  • Add, edit, complete, filter, and delete study tasks.
  • See today's plan, overdue work, near-term deadlines, and the next seven days.
  • Start a focus timer for a task and save a completed session.
  • Review weekly recorded focus time and completed sessions, separately from estimated remaining work.
  • Use the responsive interface on desktop or mobile, with light and dark themes.
  • Keep a timetable: weekly classes, tests and academic-calendar dates, added by hand or imported from an .ics calendar export (Google Calendar, Outlook, most university timetables).
  • Get study sessions planned automatically on the days before each test.
  • Get reminders while StudyFlow is open: before classes and events, the evening before and morning of a test, short and long breaks after focus blocks, and a bedtime nudge. Desktop notifications are optional.
  • See the next class or test, with a live countdown, above the Now panel.
  • Update the plan by typing to the assistant, e.g. test Statistics on Friday 2pm, my stats exam is on the 28th or move SQL practice to Monday. Type undo, or tap Undo, to reverse the last change.
  • Get a morning summary of today's classes, tests and what's due.
  • Load a fresh sample week from the profile menu, so the demo always opens on current dates.

Architecture

flowchart LR
    U[Student] --> W[React + Vite web app]
    W -->|HTTPS JSON /api/*<br/>X-Workspace header| A[FastAPI service]
    W -->|optional sign-in| N[Neon Auth]
    A -->|hosted: one schema per workspace| P[(Neon Postgres)]
    A -->|local: one file per workspace| S[(SQLite)]
    A -->|checks sign-in tokens| N
Loading

The frontend owns interaction and presentation. FastAPI validates requests. When DATABASE_URL is set, each workspace is its own Postgres schema; otherwise it is its own SQLite file. A small adapter (backend/app/pg.py) lets the same queries run on both. The focus timer submits a session only when it reaches completion, and a unique session key makes a retry safe from duplicate recording. Insights keep estimated workload and recorded focus time as different measures.

A new visitor's first page load sends several requests at once. On Postgres, setup takes an advisory lock first, then checks whether the schema exists, creates it only if needed and only then switches to it. If two requests still collide, it retries in a new transaction and logs a warning.

Run it locally

Docker Compose

Install Docker Desktop, then run this from the project folder:

docker compose up --build

Open http://localhost:5173. The API's interactive documentation is at http://localhost:8000/docs. A few sample tasks are created on first run. Compose stores data in the study_data volume.

Stop the foreground services with Ctrl+C, then run:

docker compose down

If the web app is already running but its API does not yet expose /api/sessions or the weekly focus metrics, rebuild and restart only the API:

docker compose up --build -d api

This updates the API container and keeps the Compose database volume.

Run without Docker

In one terminal:

cd backend
python -m venv .venv
# Activate the virtual environment, then:
pip install -r requirements.txt
uvicorn app.main:app --reload

In a second terminal:

cd frontend
npm ci
npm run dev

API overview

Method Endpoint Purpose
GET /api/tasks List study tasks
POST /api/tasks Create a task
PUT /api/tasks/{id} Update task details
PATCH /api/tasks/{id}/complete Toggle task completion
DELETE /api/tasks/{id} Delete a task
POST /api/sessions Record a completed focus session idempotently
GET /api/insights Return workload, completion, subject, deadline, and focus summaries
GET /api/events List classes, tests and calendar events
POST /api/events Add a class (weekly), test or event; a test gets study sessions planned before it
PUT /api/events/{id} Edit a class, test or event; a moved test gets its study sessions re-planned
DELETE /api/events/{id} Remove a class, test or event (and a test's unfinished study sessions)
POST /api/events/import Import an iCalendar (.ics) export: weekly classes, tests, events
GET /api/agenda?days=7 Dated agenda for the next N days (weekly classes expanded)
POST /api/assistant Plain-text commands that update the plan (rule-based, no AI service); undo reverses the last change
POST /api/demo/reset Replace all data with a sample week dated relative to today
GET /api/health Check API availability

Tests

cd backend
python -m unittest discover -s tests

These cover workspace setup, sample data, separation between workspaces, the main task, focus session and study planning routes, calendar parsing, saved-plan access, claiming a plan, the rate limit and error handling. Sign-in token verification itself, the plain-text assistant and the web app have no automated tests yet.

Locally the tests run on SQLite and the three Postgres tests are skipped. GitHub Actions runs the suite twice, once with a real Postgres so those tests run, and also builds the web app and the API's Docker image. A Postgres service in CI is not the same as Neon's connection pooler.

Security boundary

  • Workspaces: a random 32-character id kept in the browser. Until a plan is saved to an account, anyone holding that id can open and change it.
  • Saved plans: after optional sign-in, the API verifies the Neon Auth token and opens a saved plan only for its owner.
  • Limits: a per-address request limit (counted per server instance), a cap on the number of workspaces, request validation and a 2 MB limit on calendar imports.

This is a test version. Use sample data. See DEPLOY.md for what is needed before a wider launch. REVIEW.md records an earlier design, accessibility and security review.

Demo guide

For a short walkthrough, see the portfolio demo guide.


Built by Benedict Frimpong Boateng, with AI coding assistants (Claude Code) helping with parts of the implementation and review. Design decisions, testing and verification are mine.

About

Study planner that turns deadlines into a realistic weekly plan. React, Three.js, FastAPI, Postgres.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages