A demo that use the async web frame work: FastAPI, async orm: Tortoise-ORM, the database: MySQL
# test
make test
CODE_ENV=test pytest --rootdir ./tests -s
# run
make run
- MIT LICENSE
- A Global Config File
- Dir or File for Using Cython cythonize
- The Program Entry File
- Dockerfile
- Makefile
- The Conf File of Aerich
- The Change Log of Different Version for This Project
- The Script of Create Blank migration SQL File
- The Script of Find Target in some Dirs
- The Script of Insert Some Data Into Database
- The Extend uvicorn Worker
# download docker and docker-compose
# create docker network: example
docker network create --driver bridge --subnet xxxxxx --gateway xxxxx xxxxxxxx
# mkdir project dir
mkdir /srv/project && cd /srv/project && mkdir conf/fastapi_tm_api conf/fastapi_tm_db conf/fastapi_tm_redis -p
# clone source code
git clone this api fastapi_tm_api
## edit config settings
# reference resources ./docs/deploy/docker-compose.yaml
touch docker-compose.yaml
# reference resources ./docs/deploy/my.cnf
touch conf/fastapi_tm_db/my.cnf
# reference resources ./conf/product.toml ./conf/test.toml
touch conf/fastapi_tm_api/product.local.toml
touch conf/fastapi_tm_api/test.local.toml
# reference resources ./docs/deploy/gunicorn_settings_example.py
touch conf/fastapi_tm_api/gunicorn_config.py
# reference resources ./docs/deploy/docker-entrypoint.sh
touch conf/fastapi_tm_api/docker-entrypoint.sh
# build and start
docker-compose up -d --build
.
├── api
├── conf
│ ├── fastapi_tm_api
│ │ ├── product.local.toml
│ │ ├── test.local.toml
│ │ ├── docker-entrypoint.sh
│ │ └── gunicorn_config.py
│ ├── fastapi_tm_db
│ │ └── my.cnf
│ └── fastapi_tm_redis
│ └── redis.conf
├── data
│ ├── fastapi_tm_db
│ │ └── data
│ └── fastapi_tm_redis
│ └── data
│ └── dump.rdb
├── docker-compose.yaml
└── logs
├── fastapi_tm_api
│ └── x.log
└── fastapi_tm_celery