Code Monkey home page Code Monkey logo

fastapi-bigger-application's Introduction

FastAPI for Car Shop ERP

coverage

This rest api is a kind of ERP of car shop.
App is available on cloud by https://car-shop-fastapi.herokuapp.com/docs.

Requirements

You'll must have installed:


Setup Project

Create virtual environment

python3 -m venv env

Activating created virtual environment

source env/bin/activate 

Install app dependencies

pip install -r requirements-local.txt 

Running Application

Starting database (postgres:alpine3.14)

docker-compose up

Starting application, run:

uvicorn app.main:app --reload
Obs: It's possible to configure the database by environment variable as:
export DB_URL="postgresql://user-name:password@host-name/database-name"

Acessing on local

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

Testing

For run tests

pytest

For run tests with coverage report

pytest --cov=app app/test/

Development

For update dependencies on requirements.txt, run:
Obs: For production must have extra changes.

  1. Remove version of dataclasses
pip freeze > requirements.txt

Deploy On Heroku

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

Source Documentation

fastapi-bigger-application's People

Contributors

skatesham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.