Skip to content

Cletrix-Labs/Study-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Study Analytics Dashboard — Flask Edition

A full-stack study tracking app: user accounts, subjects, a live study timer, session history, analytics charts, a calendar heatmap, goals, streaks, achievements, notes, a Pomodoro focus mode, and PDF/CSV reports.

Tech stack

  • Backend: Python 3, Flask, Flask-SQLAlchemy, Flask-Login, Flask-WTF, Werkzeug password hashing
  • Database: SQLite by default, swappable to PostgreSQL via DATABASE_URL
  • Frontend: server-rendered Jinja2 templates + vanilla CSS/JS, Chart.js for charts
  • Reports: ReportLab (PDF), Python's csv module (CSV)

Setup

cd study_tracker_flask
python3 -m venv venv
source venv/bin/activate      # Windows: venv\Scripts\activate
pip install -r requirements.txt

cp .env.example .env          # then edit SECRET_KEY to something random

python app.py

Visit http://127.0.0.1:5000, register an account, and you're in. The database (instance/study_tracker.db) and all tables are created automatically on first run.

Switching to PostgreSQL

Install psycopg2-binary (pip install psycopg2-binary) and set in .env:

DATABASE_URL=postgresql://user:password@host:5432/study_tracker

No code changes needed — config.py reads this automatically.

What's simplified vs. a production system

  • Forgot password generates a real reset token and link, but since no mail server is configured, the link is shown directly on the page instead of emailed. Wire up Flask-Mail (or any SMTP/email API) in blueprints/auth.pyforgot_password() to send it for real.
  • One user session at a time per browser via Flask-Login's cookie session — there's no separate "active sessions" management UI, though Flask-Login's session cookie is secure and signed by SECRET_KEY.
  • Notifications (study/break/goal reminders) are stored as a per-user preference toggle but don't yet trigger browser push or email — that needs a background scheduler (e.g. APScheduler) plus a delivery channel.

Project structure

study_tracker_flask/
├── app.py                # app factory + entrypoint
├── config.py             # env-based configuration
├── extensions.py         # db, login_manager, csrf singletons
├── models.py              # User, Subject, StudySession, ActiveTimer, Goal, Note, PasswordResetToken
├── forms.py               # Flask-WTF forms with validation
├── blueprints/
│   ├── auth.py            # register/login/logout/password reset/profile
│   ├── main.py             # dashboard/subjects/timer/sessions/analytics/calendar/goals/achievements/notes/focus/settings
│   └── reports.py          # PDF + CSV report generation
├── templates/              # Jinja2 templates (one per page)
├── static/css/style.css    # shared design system
└── requirements.txt

A friendly note

This app supports serious study tracking, but please set realistic goals for yourself in the Goals tab — sustainable daily/weekly targets (not 14+ hours/day) are what actually stick long-term.

About

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors