• Stars
    star
    476
  • Rank 92,280 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Template for building FastAPI applications with MongoDB.

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.

More Repositories

1

async-fastapi-mongo

Repository housing code for the Testdriven article.
Python
104
star
2

buycoins-python

This package allows interactions with the BuyCoins API.
Python
46
star
3

favico-generator

JavaScript
17
star
4

treasure-hunter

Find the treasures hidden in the graph maze 👽
Python
14
star
5

fastapi-notes-app

Python
14
star
6

svelte-continent-app

Demo app built to demonstrate API consumption in svelte.
JavaScript
11
star
7

fastapi-beanie

Python
9
star
8

react-query-app

Recipe App showcasing react-query's feature
JavaScript
9
star
9

NgBanks

NgBanks module implementation in simple-lang
7
star
10

tcli

Twitter user data retrieval cli
JavaScript
6
star
11

storeon-app

A simple app demonstrating the Storeon state manager
JavaScript
6
star
12

graphql-firebase-react

TodoList built with React + Express + Firebase + GraphQL
JavaScript
5
star
13

python-ds-algos

Repo for my data structure and algorithm classes.
Python
5
star
14

ng-banks-go

Bolaji's NgBank implementation in Go.
Go
5
star
15

useswr-recipe-app

A rebuild of a formerly react-query powered app.
JavaScript
4
star
16

quidax-api

Backend for the Quidax book club app.
Python
3
star
17

NgNews

Top Nigerian Headlines API implemented in simple-lang
3
star
18

vue-review-app

A vue-review-app
JavaScript
3
star
19

reactjs-auth0

Repo that contains the app I used in learning how to use Auth0 with React.
JavaScript
3
star
20

key-value-db-go

Messing around and Idk if this'll work. But well, e go be 👍
Go
3
star
21

go-data-structures

Code exercises and learnings from Christian Fox's book.
Go
3
star
22

book-finder

A Book Finder PWA App built with Choo exploring the Google Books API
JavaScript
3
star
23

exercism

Exercism solutions repo.
Go
2
star
24

unstated-next-todo

JavaScript
2
star
25

quiz

simple quiz app
JavaScript
2
star
26

learning-java

All the code, tips, lessos and my progress will be documented here.
Java
2
star
27

choo-todo

Sorta Notes or quick todo app. Messing around as usual.
JavaScript
2
star
28

mongoose-scaffold

A simple CLI tool to generate mongoose schemas for lazy developers.
JavaScript
1
star
29

fastapi-todo-convoy

Python
1
star
30

modules

this repo host all the simple modules and dynamic libraries
C
1
star
31

abdul

first npm module
JavaScript
1
star
32

react

React task by sugar labs
CSS
1
star
33

choo-backend

Actually, trying to use this seperatre repo to handle the backend. I'll be deploying this to heroku.
JavaScript
1
star
34

livecoding-todo-app

Repository for my first live coding with multiple people.
1
star
35

learning-clojure

Repository accompanying code from lessons and activities from PacktPubs' Clojure workshop
Clojure
1
star