Giter VIP home page Giter VIP logo

arashi87 / fastapi-template Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 118 KB

This is a simple RESTful FastAPI template that uses PostgreSQL as the database and Redis as the cache. It's deployed on Kubernetes with Helm and features a complete CI/CD pipeline, testing, and various other tools for implementation.

License: MIT License

Dockerfile 0.88% Python 91.71% Makefile 2.08% Smarty 3.95% Mako 1.37%

fastapi-template's Introduction

FastAPI Template

CI CD Coverage

A simple restful fastapi template, using PostgreSQL as database and Redis as cache, deployed on Kubernetes with Helm. There is a full CI/CD pipeline, testing and other more tools to implement it.

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

  • Python 3.8
  • Poetry 1.1.12
  • Docker 20.10.12
  • Make 3.81

Installation

  1. Init environment, which will help you init poetry and install dependencies, it will also copy a new .env file.
make init
  1. Install pre-commit hook, it will run make ci-bundle to ensure code quality when you commit.
poetry run pre-commit install
  1. Run migrate command to use alembic upgrade database.
make migrate
  1. Enter the environment and start developing
poetry shell
  1. Start related components of API service
make service_up
  1. run test to make sure project work correctly, this project use pytest and pyytest-cov for testing
make test
  1. Start development API service, the service will run at http://localhost:8000
cd api && poetry run uvicorn app:APP --reload --host 0.0.0.0

Formatting & Linting

  1. This project uses black, isort, flake8, pylint for formatting and linting, you can customize these settings in the setup.cfg file.
make format
make lint

Roadmap

  • Add Redis cache
  • User Docker multiple stage build

Contribution

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.