TryHackFit is a lightweight Flask-based web application designed as an educational password manager demo. The app shows basic flows for user roles, password testing, and ephemeral storage behavior. It is container-ready and can be run locally or with Docker.
Important: This project is a demo. Do not use real or sensitive credentials with this app. Demo data may be visible or cleared automatically. See the Security section.
- Simple Flask backend with templated UI and static assets.
- Role-based UI: two demonstration roles (Role 1, Role 2) with different permissions.
- Demo storage for passwords (ephemeral) β intended for testing only.
- Background watcher that periodically clears the
Passwordtable to keep demo data transient. - Docker Compose & Dockerfile for easy deployment.
- Clear privacy/disclaimer pages included.
- Backend: Python, Flask, Gunicorn
- Frontend: HTML, CSS, Vanilla JavaScript
- Database: SQL (configurable via
get_db_connection()inapp.py) - Deployment: Docker & Docker Compose
This project includes two sample roles to demonstrate how the UI and permissions change for different users.
-
Role 1 β Regular User
- Typical demo user.
- Can log in, store and retrieve demo passwords in the testing area.
- Intended for showing the per-user flows and UI of the app.
- WARNING: Do not store your real credentials β demo passwords are ephemeral and considered public for the demo.
-
Role 2 β Admin
- Elevated demo role with additional UI features (management pages, overview).
- Can view aggregated demo data and perform admin-only demo actions (for testing).
- Admin accounts are for demonstration β do not use real accounts or admin credentials in public demos.
These role labels are for demo/learning only. Implementations for production must include proper authentication, MFA, logging, and least-privilege DB accounts.
C:.
βββ .env
βββ app.py
βββ docker-compose.yml
βββ Dockerfile
βββ README.md
βββ requirements.txt
βββ sql-db-1.sql
βββ sql-db-2.sql
βββ db/
β βββ init.sql
βββ media/
βββ static/
β βββ css/
β β βββ common_admin.css
β β βββ common_user.css
β β βββ index_admin.css
β β βββ index_user.css
β β βββ login.css
β β βββ password_test.css
β β βββ privacy.css
β β βββ signin.css
β βββ imgs/
β β βββ logo.png
β β βββ site1.png
β β βββ site2.png
β βββ js/
β βββ common_admin.js
β βββ index_user.js
β βββ login.js
β βββ password_test.js
β βββ signin.js
βββ templates/
βββ common.html
βββ common_admin.html
βββ common_user.html
βββ index_admin.html
βββ index_user.html
βββ login.html
βββ password_test.html
βββ privacy.html
βββ signin.html
- Python 3.9+ (3.10 recommended)
- pip
- (Optional) Docker & Docker Compose
- A SQL-compatible DB (MySQL/Postgres/SQLite). Configure connection inside
app.pyviaget_db_connection().
git clone https://github.com/MattiaPasti/TryHackFit.git
cd TryHackFit
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt# from project root
python app.py
# Open http://localhost:5000docker compose up --build -d
# Open http://localhost:8000 (or the port defined in docker-compose)To keep demo data transient, a simple watcher runs in a background thread that periodically deletes all rows from the Password table.
-
Default interval (public demo commit): 3600 seconds (1 hour).
You can change it via the environment variableWIPE_INTERVAL(seconds) or edit the watcher block inapp.py. -
To disable the watcher:
- Remove or comment out the watcher block located before the
if __name__ == "__main__":block inapp.py.
OR - Configure the watcher guard (if present) β e.g.,
WIPE_ENABLED=falseβ and restart the app.
- Remove or comment out the watcher block located before the
WARNING: The watcher executes
DELETE FROM Password;. This is destructive and irreversible. Only use it in demo/test environments.
- Do NOT enter real passwords, personal accounts, or sensitive data into this demo.
- Demo data is ephemeral and intended for testing β assume it is publicly visible or will be removed.
- The repository is not production-ready. If you plan to make a production version:
- Use secure secret management (do not commit
.env). - Use least-privileged DB users.
- Protect admin actions with authentication & audit trails.
- Replace destructive background jobs with scheduled, auditable tasks or protected admin endpoints.
- Add HTTPS, strong auth, and monitoring.
- Use secure secret management (do not commit
You can try the public demo at: https://tryme.mattiapasti.com
Contributions are welcome for:
- improving security and separating demo code from production code,
- adding configuration flags for the watcher (enable/disable, token-based triggers),
- adding tests and CI for non-destructive behavior.
Please file issues or pull requests with clear descriptions.
MIT License β see LICENSE for details.
Author: Mattia Pasti β pastimattia772@gmail.com
β‘ Built with β€οΈ for educational purposes and portfolio demonstrations.