A small Flask web application to store and share recipes.
Key features
- User registration and login (passwords hashed with Werkzeug).
- Add recipes with optional image upload (stored in
static/uploads/). - View recipe with author and date (date shown as
DD.MM.YYYY). - Safe search endpoint
/search_safeusing parameterized queries (ORM). - Local educational demo of a vulnerable search endpoint
/search_vuln(SQL injection) β disabled by default and only enabled when the environment variableENABLE_DEMO_SQLI=1is set.
Security note: The vulnerable endpoint is included for educational/portfolio demonstration only. Do not enable
ENABLE_DEMO_SQLIon any public or production server.
Licence & contact: This project is for learning/portfolio purposes. If you want to try improvements or have questions β open an issue/contact me.
Include screenshots in docs/ (examples):
docs/home.pngβ Home page listing recipesdocs/add_recipe.pngβ Add recipe form with image uploaddocs/recipe.pngβ Recipe page showing author, date and imagedocs/safe_search.pngβ Safe search resultsdocs/sql_injection_search_2.pngβ Demo showing SQLi on/search_vulnlocally
- Clone repo:
git clone https://github.com/satanieremii/recipe_app.git
cd recipe_app- Create virtual environment and install:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Prepare environment variables (example):
# generate a secure key and paste it
export SECRET_KEY='paste_a_generated_secret_here'
# enable demo vulnerable route only locally when you want to test
export ENABLE_DEMO_SQLI=0You can create a local .env (NOT committed) and then source .env if preferred.
- Run the app:
python app.py
# open http://127.0.0.1:5000- To enable the local SQLi demo (ONLY on your machine):
export ENABLE_DEMO_SQLI=1
python app.py
# then open /search_vuln and test payload like: %' OR '1'='1Project structure
recipe_app/
ββ app.py
ββ models.py
ββ forms.py
ββ templates/
ββ static/
β ββ css/
β ββ uploads/
ββ docs/
ββ requirements.txt
ββ .gitignore
ββ .env.example
ββ README.md