using FastAPI, SQLAlchemy, PostgreSQL, Alembic, Docker
git clone <this-repo>
python -V
python3 -m venv venv
Important: check the correct way of activation depending on your shell. Consult here. (I use fish shell)
source ./venv/bin/activate
python -m pip install -r requirements.txt
# generate SQL
alembic revision --autogenerate -m "Create users, posts, votes tables"
# run SQL
alembic revision upgrade head
uvicorn app.main:app --reload
Run app with Docker
# build container
docker build -t social-media-platform-api .
# start container
docker run social-media-platform-api
# build & start services
docker-compose -f docker-compose-dev.yaml up -d
# stop services
docker-compose -f docker-compose-dev.yaml down -d
pytest tests/ -v -s