- Python: 3.7~3.8
Install with poetry:
pip install poetry
poetry install
Run MongoDB with docker:
sudo docker pull mongo
sudo docker run --name some-mongo -p 27017:27017 -d mongo
Docker build and run with Dockerfile:
sudo docker pull mongo
sudo docker run --name some-mongo -p 27017:27017 -d mongo
sudo docker build -t gym-trainer .
sudo docker run -it -d gym-trainer
Deployment with docker-compose:
docker-compose up -d
- Server backend - docs: http://0.0.0.0:8088/docs
- Api backend: http://0.0.0.0:8088/redoc
- Server frontend: http://0.0.0.0:8088
Tests for this project are defined in the tests/
folder.
pytest
Auto format:
poetry run app/utils/format
Auto lint:
poetry run app/utils/lint
Auto test:
poetry run app/utils/test
app
├── api - web related stuff.
│ ├── database - config database.
│ │ ├── models - definition of error handlers.
│ │ ├── excute - sql handling, CRUD.
│ │ ├── connect.py - connect to database.
│ ├── errors - definition of error handlers.
│ └── routes - web routes.
│ └── services - logic that is not just crud related.
│ └── responses - response for api request corresponding.
├── core - application configuration, startup events, logging.
├── logger - export log for server process.
├── tests - test api, code.
├── utils - tools format, lint, test, etc.
├── resources - image, audio, csv, etc. (ignore)
├── pyproject.toml - dependencies and package.
└── main.py - FastAPI application creation and configuration.