Code Monkey home page Code Monkey logo

fastapi-docker's Introduction

Test license Profile

Features โœจ

  • FastAPI framework.
  • Interactive API documentation
  • Full Docker integration.
  • Docker Compose integration.
  • Production ready Python web server using Uvicorn.
  • Secure password hashing by default.
  • JWT token authentication.
  • SQLAlchemy models
  • CORS (Cross Origin Resource Sharing).
  • Small utility to paginate SqlAlchemy queries.

Requirements ๐Ÿ“Œ

  • Docker ๐Ÿณ
  • docker-compose ๐Ÿณ
  • Python 3.6+ ๐Ÿ To use without docker

Quick Start ๐ŸŒฑ

Run FastAPI Docker โšก Local Development

  1. git clone https://github.com/JeremyAndress/fastapi-docker.git
  2. Create .env files cp .env.example .env

You should now have a directory structure like:

.
โ”œโ”€โ”€ compose
โ”‚ย ย  โ”œโ”€โ”€ local
โ”‚ย ย  โ”œโ”€โ”€ production
โ”‚ย ย  โ”œโ”€โ”€ scripts
โ”‚ย ย  โ””โ”€โ”€ stage
โ”œโ”€โ”€ nginx
โ”‚ย ย  โ””โ”€โ”€ site.conf
โ”œโ”€โ”€ requirements
โ”‚ย ย  โ”œโ”€โ”€ local.txt
โ”‚ย ย  โ”œโ”€โ”€ migrations.txt
โ”‚ย ย  โ”œโ”€โ”€ mysql.txt
โ”‚ย ย  โ”œโ”€โ”€ postgre.txt
โ”‚ย ย  โ”œโ”€โ”€ production.txt
โ”‚ย ย  โ””โ”€โ”€ test.txt
โ”œโ”€โ”€ screenshots
โ”‚ย ย  โ””โ”€โ”€ ui.png
โ”œโ”€โ”€ src
โ”‚ย ย  โ”œโ”€โ”€ alembic
โ”‚ย ย  โ”œโ”€โ”€ api
โ”‚ย ย  โ”œโ”€โ”€ core
โ”‚ย ย  โ”œโ”€โ”€ db
โ”‚ย ย  โ”œโ”€โ”€ logs
โ”‚ย ย  โ”œโ”€โ”€ models
โ”‚ย ย  โ”œโ”€โ”€ __pycache__
โ”‚ย ย  โ”œโ”€โ”€ schemas
โ”‚ย ย  โ”œโ”€โ”€ tests
โ”‚ย ย  โ”œโ”€โ”€ utils
โ”‚ย ย  โ”œโ”€โ”€ alembic.ini
โ”‚ย ย  โ”œโ”€โ”€ main.py
โ”‚ย ย  โ”œโ”€โ”€ pre_start.py
โ”‚ย ย  โ””โ”€โ”€ prestart.sh
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ LICENSE
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ .flake8
โ”œโ”€โ”€ local.yml
โ”œโ”€โ”€ production.yml
โ”œโ”€โ”€ pytest.ini
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ stage.yml
  1. docker-compose -f local.yml build
  2. docker-compose -f local.yml up -d
  3. That's just all, api server is listen at http://localhost:8030/docs now

You will see the automatic interactive API documentation (provided by Swagger UI): Swagger UI

Testing ๐Ÿšจ

    pytest -vvs src/tests/

fastapi-docker's People

Contributors

dependabot[bot] avatar jeremyandress avatar

Watchers

 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.