Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Happiness Project

A privacy-aware Flask journaling and miniblogging application for writing short reflections and sharing them publicly, privately, or with selected registered users.

Features

  • 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 HttpOnly and SameSite=Lax
  • Environment-based application secrets and database configuration

Tech stack

  • Backend: Python, Flask
  • Database: SQLite, SQLAlchemy, Flask-SQLAlchemy
  • Authentication: Werkzeug password hashing + Flask sessions
  • Frontend: HTML, Jinja2, Tailwind CSS

Project structure

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.

Run locally

git clone https://github.com/Thatweirdguy1/happiness_project.git
cd happiness_project
python -m venv .venv

Activate the virtual environment, then install dependencies:

pip install -r requirements.txt

Set 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

Security notes

  • Never commit .env, SQLite databases, or real user data.
  • Use a strong random FLASK_SECRET_KEY in deployment.
  • Set FLASK_SECURE_COOKIE=true when the application is served over HTTPS.
  • Debug mode is disabled by default and should not be enabled in production.

What this project demonstrates

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.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages