A complete company database web app built with Flask + SQLite (no external DB server needed).
- Authentication β hashed passwords (PBKDF2-SHA256, 200k iterations), session login, "Remember me" (2 weeks)
- Role-based access β
adminvsstaff; deletes and user management are admin-only - Dashboard β headcount, payroll totals, per-department breakdown, recent hires
- Employees β full CRUD, search, sortable columns, department assignment
- Customers β full CRUD, search, notes
- Departments β add / rename / delete (employees unassigned, not lost)
- SQL Database Tools (admin) β phpMyAdmin-style: SQL console (SELECT free, writes need confirm), browse any table with pagination, CSV export per table, CSV bulk import, full .db backup download
- MySQL ready β import
schema.mysql.sqland setDATABASE_URL=mysql+pymysql://user:pass@localhost/dream_chaserto run on MySQL instead of SQLite - User management (admin) β create/edit/delete users, reset passwords, promote to admin; protects against deleting yourself or the last admin
- Interactive UI β live table filtering, click-to-sort tables, auto-dismiss flash messages, double-submit guard, pagination, custom 404/500 error pages
pip install -r requirements.txt
python app.pyOpen http://127.0.0.1:5000 β default account: admin / admin123 (change it from the π button in the top bar).
app.py # Flask app: routes, schema, auth, hashing
company.db # SQLite database (auto-created on first run)
templates/ # Jinja2 templates (base + per-page)
static/style.css # site design
static/main.js # interactivity (sort, filter, toasts)
- Passwords are never stored in plain text
- All input is parameterized (no SQL injection)
- Jinja2 auto-escapes output (no XSS)
- Delete actions are POST-only, with CSRF-style confirm dialogs