DevLog is a small Flask app for tracking developer activity logs, moods, hours, and tags. It includes a browser dashboard, JWT-backed API routes, and SQLite storage with optional auto-created tables for local development.
- Register and login pages
- JWT-protected dashboard API
- Create, edit, delete, and filter activity logs
- Create and select tags for logs
- Stats for streak, total logs, total hours, and mood distribution
- Responsive dashboard UI with Chart.js mood chart
app/
app.py Flask app factory, routes, API endpoints
models.py SQLAlchemy models
static/
css/style.css Frontend styles
js/app.js Dashboard interactions
templates/ Frontend HTML pages
tests/ unittest test suite
run.py Local development entry point
Create and activate a virtual environment if you do not already have one:
python3 -m venv venv
source venv/bin/activateInstall dependencies:
pip install -r requirements.txtStart the development server:
venv/bin/python run.pyOpen the frontend pages:
http://127.0.0.1:5001/register
http://127.0.0.1:5001/login
http://127.0.0.1:5001/dashboard
Register first, then the app stores your token in browser local storage and opens the dashboard.
Press Ctrl + C in the terminal running Flask.
If the terminal is gone, stop the process on port 5001:
kill $(lsof -ti:5001)Run the automated tests:
venv/bin/python -m unittest discoverThe tests use a temporary SQLite database and do not modify your local app database.
The app is wired for Flask-Migrate, but this repository does not currently include a migrations/ directory or checked-in Alembic revision files.
If you add migrations later, you can initialize and apply them with:
venv/bin/flask --app run.py db init
venv/bin/flask --app run.py db upgradeCreate a new migration after model changes:
venv/bin/flask --app run.py db migrate -m "Describe the schema change"For production-style migration workflows, set AUTO_CREATE_TABLES=false so tables are only created when migrations are applied:
AUTO_CREATE_TABLES=false venv/bin/flask --app run.py db upgrade
AUTO_CREATE_TABLES=false venv/bin/python run.pySECRET_KEY: Flask secret keyJWT_SECRET_KEY: JWT signing key, use at least 32 bytesDATABASE_URL: SQLAlchemy database URL, defaults tosqlite:///devlog.dbAUTO_CREATE_TABLES: defaults totruefor local convenience