A privacy-aware Flask journaling and miniblogging application for writing short reflections and sharing them publicly, privately, or with selected registered users.
- User registration and login with Werkzeug password hashing
- Public, private, and selectively shared journal entries
- Personal journal dashboard
- Many-to-many sharing between posts and users
- Author-only post deletion
- Server-side input validation
- Session cookies configured with
HttpOnlyandSameSite=Lax - Environment-based application secrets and database configuration
- Backend: Python, Flask
- Database: SQLite, SQLAlchemy, Flask-SQLAlchemy
- Authentication: Werkzeug password hashing + Flask sessions
- Frontend: HTML, Jinja2, Tailwind CSS
happiness_project/
├── app.py
├── requirements.txt
├── .env.example
├── .gitignore
└── templates/
├── index.html
├── login.html
├── register.html
├── create.html
└── my_journal.html
The SQLite database is generated at runtime and intentionally excluded from version control.
git clone https://github.com/Thatweirdguy1/happiness_project.git
cd happiness_project
python -m venv .venvActivate the virtual environment, then install dependencies:
pip install -r requirements.txtSet a local secret before running the app:
# macOS/Linux
export FLASK_SECRET_KEY="replace-with-a-long-random-secret"
# PowerShell
$env:FLASK_SECRET_KEY="replace-with-a-long-random-secret"Then start the server:
python app.py- Never commit
.env, SQLite databases, or real user data. - Use a strong random
FLASK_SECRET_KEYin deployment. - Set
FLASK_SECURE_COOKIE=truewhen the application is served over HTTPS. - Debug mode is disabled by default and should not be enabled in production.
This project focuses on authentication, authorization, relational data modelling, many-to-many relationships, privacy-aware application logic, and secure session handling in a compact Flask application.