ari-hacks / fastapi-boilerplate

A Boilerplate FastApi project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastApi Skeleton

A Boilerplate FastApi project

MIT license Build Status

Features

  • Boilerplate project structure
  • Asynchronous API
  • User login and Authentication
  • MongoDb
  • CRUD endpoints
  • Travis CI configuration before deploy
  • API testing with pytest
  • Pipenv dependency management
  • Docker containerization and deploy to Heroku

Set up

Requirements

Running Locally

  1. Clone this repository and cd into it

        → git clone https://github.com/ari-hacks/fastapi-skeleton.git
        → cd fastapi-skeleton
  2. Pipenv dependency management

        #run pipenv 
        → pipenv shell
        #install dependencies  
        → pipenv install
        #run locally
        → uvicorn app.main:app --reload 
  3. Install & Run in docker

  4. Build Docker Image

        ➜ docker build -t app .
  5. Start Docker container

        ➜ docker run -d --name fastapi-skeleton-container -p 5000:5000 app
  6. Run the application

     Uvicorn running on http://0.0.0.0:5000/users/health-check 
     #or 
     http://localhost:5000/users/health-check
  7. Check the logs

    ➜ docker container logs -f fastapi-skeleton-container

Deploy pre-configured (Docker Deploy)

Please Sign up before Deploying.

Deploy

About

A Boilerplate FastApi project

License:MIT License


Languages

Language:Python 77.5%Language:Dockerfile 22.5%