A small social application used to explore Flask application structure, user-owned content and HTML/JSON endpoints.
- Register and sign in with hashed passwords and CSRF-protected forms.
- Create posts, comments and profiles, with ownership checks for edits.
- Store images under generated names after content, format, upload-size and decoded-pixel checks.
- Search and paginate the feed; query
/api/postsas JSON.
python -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-dev.txt
cp .env.example .env
# Set a locally generated SECRET_KEY in .env before running the app.
flask --app manage.py init-db
flask --app manage.py runpython -m pytest
ruff check .
black --check .Local UI: http://127.0.0.1:5000. Use python -c "import secrets; print(secrets.token_hex(32))" to generate a secret for your local .env. SQLite is the default; Docker Compose uses PostgreSQL. This is a portfolio app; upload validation does not replace a production malware-scanning service.
Image validation is shared by forms and persistence. MAX_IMAGE_PIXELS defaults to 16 million; oversized or invalid images are rejected before saving. Python 3.11+ is required.