Giter Club home page Giter Club logo

realworld-fastapi-gino-template's Introduction

๐Ÿ›  Status: WIP

Under developement, WIP. Be patient.

Build Status codecov

A real wolrd template project using Fastapi framework as well as a full implementation of CI/CD.

Introduction to many of FastAPI's features, including pydantic models, dependency injection, and Gino (Async ORM) integration, using hexagonal architecture.

Overview

This repository contains a skeleton app which can be used to speed-up your next project.

  • Fast-API: Asynchronous RESTful API Framework
  • Gino: Async ORM used with AsyncPG and postgreSQL
  • Alembic: Database migrations
  • hexagonal architecture: Bettre code organisation
  • Pipenv: Package manager (Also creating virtual environement)
  • Pytest: Run unit test with code coverage
  • JWT: Token authentication.
  • PGAdmin4: Client for postgreSQL
  • Makefile: Building project
  • SonarQube: Analysing code and interpreting pytest and cov report
  • Flake8, Mypy: Lint code
  • Isort, Black, Autoflake: Formating code
  • Bandit: Check for vulnerabilities
  • Docker: Packaging and deployment
  • Jenkins: CI/CD

Quickstart

for running the server locally

  • first install pipenv
pip install pipenv
  • setup a local environnement
source setup/scripts/setEnv.sh
  • install the dependencies locally
pipenv run make install-dev-deps

The command above will install for you a separate environnement and installing all dependencies

  • run unit test
pipenv run make test
  • run the local server with localhost:8080
pipenv run make run

Deployment with Docker

You must have docker and docker-compose tools installed in your system. Then just run:

make build-dev
make run-dev-containers

This will build the images and run 3 containers (Fastapi application, PostgreSQL, PGAdmin 4) in developement environnement.

If you want to run the containers in production environnement, you can do the following:

make build-prod
make run-prod-containers

Your can find the files to configure each environnement in the root directory:

  • env-develop.env
  • env-production.env

Application will be available on localhost in your browser.

All routes are available on /docs paths with Swagger

Sonar Qube

TODO

Jenkins

TODO

Project structure

Files related to application are in the src or tests directories. Application parts are:

src
โ”œโ”€โ”€ api                     - web related stuff.
โ”œโ”€โ”€ core                    - application configuration, server management, logging.
โ”œโ”€โ”€ domain                  - Business logic.
โ”œโ”€โ”€ infrastructure          - external services of the application like db.
โ””โ”€โ”€ main.py                 - FastAPI application entry point.

Contributing

Contributions, issues and feature requests are welcome!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/YourFeature)
  3. Commit your Changes (git commit -m 'Add My Feature')
  4. Push to the Branch (git push origin feature/YourFeature)
  5. Open a Pull Request

Contact

Release Notes

TODO

realworld-fastapi-gino-template's People

Contributors

slimovich avatar dependabot[bot] 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.