This monorepo contains DEMO projects
[TOC]
- Backend Framework : FastAPI (async)
- Unit Test : pytest
- GitHub Actions : lint、test
- ORM : SQLAlchemy
- DB Migration : Alembic
- lint : ruff、isort
- Git Hook : pre-commit
- python 3.11+
- poetry
-
Clone the repo
git clone git@github.com:Xiao75896453/DEMO.git
-
Create
.env
.env.prod
.env.docker
file inprojects/account_password_management
and set value..env
exampleSTAGE="stg" SERVICE_PORT=3000 DB_HOST="localhost" DB_PORT="5432" DB_USER="postgres" DB_PASSWORD="password" DB_DATABASE="account_password_management" DB_POOL_SIZE=10 DB_MAX_OVERFLOW=5 DB_POOL_RECYCLE=300
.env.prod
# override .env if you need
.env.docker
PROJECT_PATH="projects/account_password_management" PROJECT_IMAGE_NAME="account-password-management" DOCKER_HOST_DB_PORT=5432
-
Startup the services
docker compose -f docker-compose.postgresql.yml -f projects/account_password_management/docker-compose.yml --env-file projects/account_password_management/.env --env-file projects/account_password_management/.env.docker -f docker-compose.prod.yml --env-file projects/account_password_management/.env.prod up
- Startup the services
- Open a browser to http://localhost:3000/docs#
-
Clone the repo
git clone
-
Install Python packages
poetry install
-
Install PostgreSQL
-
Set PostgreSQL account
-
Create DB
-
Create
.env
.env.prod
.env.docker
file inprojects/account_password_management
and set value..env
exampleSTAGE="stg" SERVICE_PORT=3000 DB_HOST="localhost" DB_PORT="5432" DB_USER="postgres" DB_PASSWORD="password" DB_DATABASE="account_password_management" DB_POOL_SIZE=10 DB_MAX_OVERFLOW=5 DB_POOL_RECYCLE=300
.env.prod
# override .env if you need
.env.docker
PROJECT_PATH="projects/account_password_management" PROJECT_IMAGE_NAME="account-password-management" DOCKER_HOST_DB_PORT=5432
-
Create DB schema
- migration
alembic -c 'projects/account_password_management/alembic.ini' upgrade head
- migration
-
Startup the services
python projects/account_password_management/app.py
-
Test
pytest projects/account_password_management
- Fork the Project
- Create New Issue (Optional)
- Create your Feature Branch
git checkout -b {project}/{type}/{description}
- Commit your Changes
git commit
(use .gitmessage.txt as format template for commit) - Push to the Branch
git push origin {your feature branch}
- Open a Pull Request
- Wait for review and merge
TingYi Xiao - a75896453@gmail.com