This rest api is a kind of ERP of car shop.
App is available on cloud by https://car-shop-fastapi.herokuapp.com/docs.
You'll must have installed:
Create virtual environment
python3 -m venv env
Activating created virtual environment
source env/bin/activate
Install app dependencies
pip install -r requirements-local.txt
Starting database (postgres:alpine3.14)
docker-compose up
Starting application, run:
uvicorn app.main:app --reload
The application will get started in http://127.0.0.1:8000
Swagger Documentation: http://127.0.0.1:8000/docs
Redoc Documentation: http://127.0.0.1:8000/redoc
Database Adminer: http://127.0.0.1:9000
- credentials tinnova/tinnova123(user/password).
If required authentication on routes add headers:
- token = my-jwt-token
- x_token = fake-super-secret-token
For run tests
pytest
For run tests with coverage report
pytest --cov=app app/test/
For update dependencies on requirements.txt
, run:
Obs: For production must have extra changes.
- Remove version of
dataclasses
pip freeze > requirements.txt
Requirements
Install Heroku Cli
sudo snap install --classic heroku
Deploy
Case is activated automatic deploy for master
branch, just commit on master
branch,
instead make manual deploy from Heroku Cli, like below
heroku login
heroku git:remote -a car-shop-fastapi
git add .
git commit -m "Deploy on heroku"
git push origin master
git push heroku master