Git Product home page Git Product logo

alexk1919 / fastapi-motor-mongo-template Goto Github PK

View Code? Open in Web Editor NEW
50.0 2.0 15.0 377 KB

High-performance FastAPI backend boilerplate for real-world production, with mongo and pytest. Suitable for microservices.

License: MIT License

Dockerfile 2.66% Makefile 3.28% Python 75.79% JavaScript 0.56% CSS 17.37% Shell 0.34%
fastapi mongodb motor pytest docker fastapi-boilerplate fastapi-template poetry python3 restful

fastapi-motor-mongo-template's Introduction

Boilerplate for FastAPI, MongoDB, Motor Projects

Python3.11.2 MongoDB FastAPI Motor

Features

A new backend project created with this boilerplate provides:

  • Asynchronous high-performance RESTful APIs built upon FastAPI framework.
  • Asynchronous CRUD operations for a sample resource built upon Motor driver for MongoDB, providing high performance and efficiency.
  • API documentation with Swagger UI.
  • API testing with pytest and pytest-asyncio.
  • Dockerfile for containerization and docker-compose support.
  • Easy creation of new backend services with cookiecutter.
  • Easy package menagement with Poetry.
  • Health API for service health checking.
  • Easy configuration with environment variables.
  • Easy testing, develop running, docker build, docker-compose up and down with Makefile.
  • Proper logging with ID masking.

Prerequisites

  • Python 3.11+
  • Poetry installed
  • Docker installed
  • GNU Make

Getting Started

Edit Environment Variables

Edit the .env file within the project folder.

Run Tests

make test

(This may not work at this time. Please use docker-compose instead.)

Build Docker Image

make docker-build

Docker-compose

make docker-compose-up
make docker-compose-down

Run Service Locally

make dev

This will create a MongoDB container as well. (This may not work at this time. Please use docker-compose instead.)

Check Swagger API Document

Go to http://localhost:8888/docs.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you.

Credit:

Forked from https://github.com/klee1611/cookiecutter-fastapi-mongo

fastapi-motor-mongo-template's People

Contributors

alexk1919 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.