A small web app for collecting and reviewing user feedback. It uses Flask for the web layer, SQLAlchemy as the ORM, SQLite for storage, and Bcrypt for password hashing. The code aims to be clear and minimal, showing practical CRUD over a relational schema.
- User signup and login
- Submit feedback
- Admin page to review or clear all feedback
- Lightweight CLI viewer to inspect the database
- Python, Flask, SQLAlchemy, Bcrypt
- SQLite (file-backed database)
- Python 3.9+
- Virtual environment
python -m venv venv # Windows venv\Scripts\activate # macOS/Linux source venv/bin/activate
pip install Flask Flask_SQLAlchemy Flask_Bcrypt tabulatepython app.pyOpen: http://127.0.0.1:5000
The database is created on first run at
instance/feedback.db(a sample file may already exist).
user:id(PK),username(UNIQUE),password(bcrypt hash)feedback:id(PK),username,message
Inspect data from the terminal:
python view_db.py(Uses sqlite3 + tabulate to print table contents.)
/signup– create a user (username + password)/login– authenticate and start a session/logout– clear the session/feedback– submit feedback (logged-in users)/admin– list all feedback (admin only)/delete_feedback– clear all feedback (admin only)
“Admin” is treated by username: create a user named admin via signup, then log in to access
/admin.
SECRET_KEY: currently set in code for simplicity. For production, export an env var and read it inapp.py:app.secret_key = os.getenv("SECRET_KEY", "dev-secret")
app.py
instance/
feedback.db
static/
style.css
templates/
login.html
signup.html
feedback.html
admin.html
view_db.py
- Passwords are hashed with Bcrypt; ORM queries go through SQLAlchemy.
- For a stricter schema,
feedbackcan referenceuser.id(FK) instead of storingusernamedirectly.


