Git Product home page Git Product logo

fastapi-mongo's Introduction

FastAPI and MongoDB Boilerplate

A simple starter for building RESTful APIs with FastAPI and MongoDB.

Features

  • Python FastAPI backend.
  • MongoDB database.
  • Authentication
  • Deployment

Using the applicaiton

To use the application, follow the outlined steps:

  1. Clone this repository and create a virtual environment in it:
$ python3 -m venv venv
  1. Install the modules listed in the requirements.txt file:
(venv)$ pip3 install -r requirements.txt
  1. You also need to start your mongodb instance either locally or on Docker as well as create a .env.dev file. See the .env.sample for configurations.

    Example for running locally MongoDB at port 27017:

    cp .env.sample .env.dev
  2. Start the application:

python main.py

The starter listens on port 8000 on address 0.0.0.0.

FastAPI-MongoDB starter

Testing

To run the tests, run the following command:

(venv)$ pytest

You can also write your own tests in the tests directory.
The test follow by the official support FastAPI testing guide, pytest, anyio for async testing application.

Deployment

This application can be deployed on any PaaS such as Heroku or Okteto and any other cloud service provider.

Contributing ?

Fork the repo, make changes and send a PR. We'll review it together!

License

This project is licensed under the terms of MIT license.

fastapi-mongo's People

Contributors

youngestdev avatar qitpy avatar ingeniousambivert avatar dependabot[bot] avatar treemp3 avatar davidkimdy avatar ivanmotorniy avatar rakovskij-stanislav avatar darixsamani 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.