A web application built with Flask that allows users to create accounts, manage their profiles and publish posts.
The project was developed as a practical exercise in web development, database integration, authentication, file storage and containerization.
- User registration and authentication
- Login and logout
- User profiles
- Profile editing
- Profile image upload
- Automatic image resizing
- Post creation
- Post editing
- Post deletion
- User listing
- Contact page
- Python
- Flask
- Flask-SQLAlchemy
- Flask-Login
- Flask-Bcrypt
- Flask-WTF
- PostgreSQL
- MinIO
- boto3
- Pillow
- Docker
- Docker Compose
The application runs in containers using Docker Compose.
┌───────────────┐
│ Browser │
└───────┬───────┘
│
▼
┌───────────────┐
│ Flask │
│ app │
└───────┬───────┘
│
┌────────────┴────────────┐
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ PostgreSQL │ │ MinIO │
│ database │ │ object store │
└───────────────┘ └───────┬───────┘
│
▼
┌───────────────┐
│ Bucket │
└───────────────┘
The docker-compose.yaml defines four containers:
Runs the Flask application.
The application is built from the Dockerfile located at:
app/Dockerfile
The application is exposed on port 5000.
Runs PostgreSQL 18 and stores the application's relational data.
PostgreSQL data is persisted using the postgres_data Docker volume.
Runs MinIO as an S3-compatible object storage service.
It is used to store uploaded files such as profile images.
MinIO data is persisted using the minio_data Docker volume.
The MinIO API is exposed on port 9000 and its web console on port 9001.
Initializes the MinIO environment after the MinIO server becomes healthy.
The initialization script:
minio/init_minio.sh
is responsible for configuring the bucket and its initial contents.
This container is an initialization container rather than part of the application's runtime.
Profile images are stored in MinIO instead of being stored directly in the Flask container.
The application communicates with MinIO through the S3 API using boto3.
User
│
│ uploads image
▼
Flask
│
│ Pillow
│ resize/process image
▼
boto3
│
│ S3 API
▼
MinIO
│
▼
Bucket
This separates uploaded files from the application container and provides an S3-compatible storage layer.
The entire development environment can be started with Docker Compose.
The project uses named Docker volumes to persist data:
postgres_data
minio_data
Therefore, stopping the containers does not remove the database or stored objects.
To run the project locally, you need:
- Docker
- Docker Compose
- Git
No local PostgreSQL or MinIO installation is required.
Clone the repository:
git clone <repository-url>
cd communityCreate the environment file with the variables required by the application:
POSTGRES_DB=community
POSTGRES_USER=community
POSTGRES_PASSWORD=change-me
DATABASE_URL=postgresql://community:change-me@db:5432/community
SECRET_KEY=change-me
MINIO_ROOT_USER=minioadmin
MINIO_ROOT_PASSWORD=change-me
MINIO_ENDPOINT=http://minio:9000
MINIO_BUCKET=profile-imagesThen start the project with:
makeThis runs:
docker compose up -d --buildThe application will be available at:
http://localhost:5000
Start the application:
make upStop the containers:
make downRemove containers and locally built images:
make cleanRemove containers, images, volumes and orphan containers:
make fclean
make fcleanremoves the Docker volumes containing PostgreSQL and MinIO data.
community/
├── app/
│ ├── Dockerfile
│ ├── forms.py
│ ├── __init__.py
│ ├── models.py
│ ├── routes.py
│ ├── static/
│ │ ├── main.css
│ │ └── profile_imgs/
│ │ └── default.jpg
│ └── templates/
│ ├── base.html
│ ├── contact.html
│ ├── create_post.html
│ ├── edit_profile.html
│ ├── home.html
│ ├── login.html
│ ├── navbar.html
│ ├── post.html
│ ├── profile.html
│ └── users.html
│
├── images/
│ ├── 01.png
│ ├── 02.png
│ ├── 03.png
│ └── 04.png
│
├── minio/
│ └── init_minio.sh
│
├── docker-compose.yaml
├── .env.example
├── LICENSE
├── main.py
├── Makefile
├── README.md
└── requirements.txt
The application uses environment variables for configuration and credentials.
The following services require environment configuration:
- Flask
- PostgreSQL
- MinIO
Sensitive values such as passwords and secret keys should not be committed to the repository.
This project was built to practice the development of a complete web application, including:
- Flask application development
- User authentication
- Database modeling with SQLAlchemy
- Form handling
- File uploads
- Image processing
- S3-compatible object storage
- Docker containerization
- Service orchestration with Docker Compose
- Persistent storage using Docker volumes
Future improvements may include:
- Production deployment
- Automated tests
- CI/CD
- Improved error handling
- Additional user interactions
- Production-ready configuration
- HTTPS
This project is licensed under the terms of the license included in this repository.
The application is deployed on Railway and available online:



