A command-line rostering application built with Flask, SQLAlchemy, and Click.
Admins can schedule staff shifts, track attendance, and generate weekly shift reports.
Designed for simplicity, database best practices, and beginner-friendly usage.
- Python3 / pip3
- Packages listed in
requirements.txt
$ pip install -r requirements.txtConfiguration such as database URL/port, credentials, and secrets should not be committed to public repositories.
Provide configuration via a default_config.py file for development or environment variables in production.
By default, the app uses a SQLite database stored locally:
default_config.py
SQLALCHEMY_DATABASE_URI = "sqlite:///temp-database.db"
SECRET_KEY = "secret key"
ENV = "DEVELOPMENT"These values are loaded inside config.py.
Pass configuration through environment variables on your hosting platform (e.g., Render, Heroku).
The project uses wsgi.py as a utility script for CLI commands.
Commands are grouped into three categories:
system– Database setup and maintenanceadmin– Manage staff and schedule shiftsstaff– Staff functions like viewing rosters and recording attendance
$ flask run$ gunicorn wsgi:appOn a fresh setup, seed the database with demo data:
$ flask system init-dbThis seeds:
- 2 Admins
- 6 Staff
- 5 Rosters (current + 4 past weeks)
- Randomized Shifts & Attendance Records
Rollback any uncommitted changes:
$ flask system rollback-dbUse Flask-Migrate if models change:
$ flask db init
$ flask db migrate
$ flask db upgrade$ flask system init-db # Initialize DB with demo data
$ flask system rollback-db # Rollback uncommitted changes$ flask admin add-staff # Add staff interactively
$ flask admin delete-staff 2 # Delete staff by ID
$ flask admin list-staff # List all staff
$ flask admin schedule-shift # Interactive shift scheduling
$ flask admin list-shifts # List all shifts
$ flask admin view-shift-report # Select roster, generate report$ flask staff view-roster --week-start 2025-09-29
$ flask staff time-in 2 5 # Staff 2 time-in for shift 5
$ flask staff time-out 2 5 # Staff 2 time-out for shift 5flask system init-db
flask admin list-staff
flask admin schedule-shift
flask staff view-roster --week-start 2025-09-29
flask staff time-in 2 5
flask staff time-out 2 5
flask admin view-shift-reportCurrently, the app supports manual testing via CLI commands.
Automated tests can be added under App/test.
To run all tests:
$ pytestFor coverage:
$ coverage report
$ coverage htmlAdd staff first:
flask admin add-staffSchedule shifts:
flask admin schedule-shiftRollback or reset DB:
flask system rollback-db
flask system init-db