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.
- 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
csvmodule (CSV)
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.pyVisit 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.
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.
- 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) inblueprints/auth.py→forgot_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.
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
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.