This demonstrates using Minio (Amazon S3 clone) to upload images
Minio is an open source clone of Amazon S3, it uses the same API.
This uses the python boto3 library to upload images
There is a React frontend and a FastAPI backend
To set this up:
Inside the backend folder:
First, start up the two docker containers (postgres and minio) with
docker compose up -dCreate your database
docker compose exec postgres psql -U postgres photos
psql# \i data/photos.sqlLogin to the minio web interface with u: minioadmin p: minioadmin
Create a new bucket named "photos"
Copy the .env.sample file to .env in the backend folder
cp .env.sample .env
Finally create a new virtual environment, pip install, and start up FastAPI.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
fastapi devVisit http://localhost:8000/docs
Inside the frontend folder:
npm install
npm run dev
Visit http://localhost:5173