Skip to content
项目

关于

用于构建基于 MongoDB 的 FastAPI 应用的模板。

网站与应用开发

这些数字如何统计

可以做什么

  • Python FastAPI backend.
  • MongoDB database.

实测星标增长

24小时
+1
7天
-1
15天
-2
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

FastAPI and MongoDB Boilerplate

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

image

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:

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

探索相关项目

加载中…