Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DevLog

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.

Features

  • 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

Project Structure

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

Setup

Create and activate a virtual environment if you do not already have one:

python3 -m venv venv
source venv/bin/activate

Install dependencies:

pip install -r requirements.txt

Run

Start the development server:

venv/bin/python run.py

Open 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.

Stop The Server

Press Ctrl + C in the terminal running Flask.

If the terminal is gone, stop the process on port 5001:

kill $(lsof -ti:5001)

Tests

Run the automated tests:

venv/bin/python -m unittest discover

The tests use a temporary SQLite database and do not modify your local app database.

Database Migrations

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 upgrade

Create 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.py

Environment Variables

  • SECRET_KEY: Flask secret key
  • JWT_SECRET_KEY: JWT signing key, use at least 32 bytes
  • DATABASE_URL: SQLAlchemy database URL, defaults to sqlite:///devlog.db
  • AUTO_CREATE_TABLES: defaults to true for local convenience

About

A Flask-based developer activity tracker with JWT auth, CRUD logs and tags, live productivity stats, and a polished dark dashboard UI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages