• Stars
    star
    354
  • Rank 117,446 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created 9 months ago
  • Updated 19 days ago

Reviews

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

Repository Details

Full stack, modern web application generator. Using FastAPI, MongoDB as database, Docker, automatic HTTPS and more.

Full Stack FastAPI, React, MongoDB (FARM) Base Project Generator

Show your love for this project by starring our repo 🌟, so we can continue to innovate 🙂

Accelerate your next web development project with this FastAPI/React/MongoDB base project generator.

This project is for developers looking to build and maintain full-feature progressive web applications using Python on the backend / Typescript on the frontend, and want the complex-but-routine aspects of auth 'n auth, and component and deployment configuration, taken care of, including interactive API documentation.

This is an experimental fork of Sebastián Ramírez's Full Stack FastAPI and PostgreSQL Base Project Generator and Whythawk's Full Stack FastAPI and PostgreSQL Base Project Generator. FastAPI is updated to version 0.103.2, MongoDB Motor 3.4, ODMantic ODM 1.0.0, and the frontend to React.

Landing page

Index

Requirements

Please make sure you have these installed before proceeding!

QuickStart

NOTE This will generate a local application that is not yet production-ready. Please go through all of the README information linked before creating a version to deploy to a production host

For those that want to dive in and play around with the generated code, here's a quick start guide on how to do it. It is advised, though, once you have run through generating this app the first time, that you circle back and check out the more fleshed out Building a generated app section.

// Make sure cookiecutter and python are installed on the device
// This will generate a full-stack app in the directory ./example
cookiecutter https://github.com/mongodb-labs/full-stack-fastapi-mongodb --no-input project_name="example"

// Move into that directory.
cd example

// Make sure that you've opened the Docker Desktop app before this step.
// build
docker compose build --no-cache

// start the container in the background
docker compose up -d 

Now you can view the site by going to localhost:3000. You can also see all the logs of the running containers in your Docker Desktop app.

There will only be one user on the site: [email protected]. If you choose a different project name, then the email domain changes. For example, if you create your project usingproject_name=fullstackexample the user email will be [email protected]. The default password will be set to changethis but that can be changed.

Here are all the local development URLS:

See Building a generated app for examples of what these pages look like.

Key features

This FastAPI, React, MongoDB repo will generate a complete web application stack as a foundation for your project development.

  • Docker Compose integration and optimization for local development.
  • Authentication user management schemas, models, crud and apis already built, with OAuth2 JWT token support & default hashing. Offers magic link authentication, with password fallback, with cookie management, including access and refresh tokens.
  • FastAPI backend with Inboard one-repo Docker images:
  • Nextjs/React frontend:
    • Authorization route-based authentication, including support for detecting if a user is logged in or is a superuser.
    • Form validation with React useForm
    • State management with Redux
    • CSS and templates with TailwindCSS, HeroIcons, and HeadlessUI.
  • Celery worker that can import and use models and code from the rest of the backend selectively.
  • Flower for Celery jobs monitoring.
  • Load balancing between frontend and backend with Traefik, so you can have both under the same domain, separated by path, but served by different containers.
  • Traefik integration, including Let's Encrypt HTTPS certificates automatic generation.
  • GitLab CI (continuous integration), including frontend and backend testing.

How to use the template

More details

After using this generator, your new project (the directory created) will contain an extensive README.md with instructions for development, deployment, etc. You can pre-read the project README.md template here too.

This current release is for FastAPI version 0.103 and introduces support for Pydantic 2. Since this is intended as a base stack on which you will build complex applications, there is no intention of backwards compatability between releases, and the objective is to ensure that each release has the latest long-term-support versions of the core libraries so that you can rely on your application core for as long as possible.

To align with Inboard, Poetry has been deprecated in favour of Hatch. This will also, hopefully, sort out some Poetry-related Docker build errors.

Help needed

This project is currently experimental, so bugs or issues may occur. Please open an issue ticket against this repository to make us aware of issues and we will do our best to respond to them in a timely manner. Please leave feedback on features that would be very beneficial for developers who often leverage MongoDB in their FastAPI stack.

Release Notes

NOTE: There is no intention to have backwards compatibility between releases.

See notes:

CalVer 2024.01.10

  • Replaced Beanie usage with ODMantic
  • Fixed TOTP login
  • Added Page-Level route authentication
  • Fixed issued with logged in user being unable to access /settings page
  • Throw errors on every non-ok auth.ts response
  • Fixed Poject Named generation in Footer.tsx
  • Removed unused CORS routes
  • Updated README
    • Added QuickStart
    • Added Requirements
    • Added Container URL Information
  • Updated docs/
    • Placed docker_example.png
    • Removed lingering Nuxt and Beanie references
    • Updated Indexing

CalVer 2023.11.10

  • Replaced Next/Vue.js frontend framework with entirely React/Redux
  • Replaced Backend native connection of PostgreSQL/SQLAlchemy with MongoDB Motor/Beanie ODM
  • Removed Neo4j plugin
  • Removed Alembic Usage
  • Introduced new cookiecutter environment variables mongodb_uri, and mongo_database
  • Introduced support for Pydantic 2

Historic changes from whythawk Historic changes from original

License

This project is licensed under the terms of the MIT license.

More Repositories

1

sleepy.mongoose

[Archive] A REST interface for MongoDB - This Repository is NOT a supported MongoDB product
Python
385
star
2

mongo-rust-driver-prototype

This is superseded by the official MongoDB Rust Driver
Rust
380
star
3

socialite

Social Data Reference Architecture - This Repository is NOT a supported MongoDB product
Java
291
star
4

edda

A log visualizer for MongoDB - This Repository is NOT a supported MongoDB product
Python
231
star
5

mongo-perl-driver

Perl driver for the MongoDB
Perl
203
star
6

hvdf

[Archive] High Volume Data Feed (HDVF) framework for time series data - This Repository is NOT a supported MongoDB product
Java
84
star
7

mongoproxy

A server that speaks the MongoDB wire protocol and can analyze/transform requests and responses - This Repository is NOT a supported MongoDB product
Go
79
star
8

mongo-arrow

MongoDB integrations for Apache Arrow. Export MongoDB documents to numpy array, parquet files, and pandas dataframes in one line of code.
Python
77
star
9

mongo-web-shell

[Archive] An interactive MongoDB shell in a web browser - This Repository is NOT a supported MongoDB product
JavaScript
64
star
10

YCSB

This Repository is NOT a supported MongoDB product
Java
57
star
11

mongo-hhvm-driver-unsupported

[Archive] Experimental MongoDB driver for HHVM - This Repository is NOT a supported MongoDB product
Hack
56
star
12

mongorover

Intern project - MongoDB driver for the Lua programming language - This Repository is NOT a supported MongoDB product
C
55
star
13

big-data-exploration

[Archive] Intern project - Big Data Exploration using MongoDB - This Repository is NOT a supported MongoDB product
JavaScript
43
star
14

mongo-mockup-db

MockupDB - Simulate a MongoDB server.
Python
42
star
15

python-bsonjs

A fast BSON to MongoDB Extended JSON converter for Python - This Repository is NOT a supported MongoDB product
C
40
star
16

shard-viz

[Archive] An experimental Chrome plugin for visualizing sharded MongoDB clusters - This Repository is NOT a supported MongoDB product
JavaScript
36
star
17

py-tpcc

MongoDB Adaptation of PyTPCC
Python
36
star
18

mangrove

Mangrove: the MongoDB C++ ODM - This Repository is NOT a supported MongoDB product
C++
33
star
19

mongo-fsharp-driver-prototype

[Archive] FSharp.MongoDB - F# driver prototype for MongoDB - This Repository is NOT a supported MongoDB product
F#
29
star
20

mongosh-snippets

An experimental plugin feature for mongosh
JavaScript
26
star
21

storage-viz

[Archive] An experimental Chrome plugin for visualizing MMAP storage and indexes - This Repository is NOT a supported MongoDB product
JavaScript
24
star
22

mms-api-examples

This Repository is NOT a supported MongoDB product
Python
21
star
23

ledger

An implementation of a ledger using MongoDB
Python
18
star
24

mongo-csharp-search

C# driver extension providing support for Atlas Search
C#
16
star
25

mongoreplay

Go
13
star
26

jaeger-mongodb

A mongodb based storage backend for the jaeger collector
Go
12
star
27

pymongo-stubs

Experimental stub files for PyMongo
Python
12
star
28

field-level-encryption-sandbox

sample code for the client-side field level encryption project
JavaScript
11
star
29

migration-verifier

A public tool for validating the correctness of a migration
Go
11
star
30

mongodb-redpanda-example

JavaScript
10
star
31

drivers-evergreen-tools

Scripts for MongoDB drivers to bootstrap their Evergreen configuration file - This Repository is NOT a supported MongoDB product
Python
10
star
32

mindexer

Experimental tool to recommend indexes for MongoDB
Python
10
star
33

pubsub

[Archive] Intern project - Publish/subscribe within MongoDB v2.6.3 using ZeroMQ - This Repository is NOT a supported MongoDB product
C++
9
star
34

mongodb-wp-proxy

A logging mongodb wire protocol proxy
TypeScript
7
star
35

repl-trace-checker

Check that a replica set's execution trace is a valid TLA+ spec behavior
Python
6
star
36

symfony-mongodb

(Experimental) Bundle to provide a lightweight integration of MongoDB in Symfony
PHP
6
star
37

drivers-atlas-testing

Drivers Atlas Testing
Python
5
star
38

agg_edsl

A simple eDSL for aggregation in Python
Python
5
star
39

benchmarks

Lua
4
star
40

cobra2snooty

Generate cobra docs compatible with the snooty docs tooling
Go
4
star
41

terraform-provider-mongodb

Terraform Provider for MongoDB Cloud resources (This repository is NOT a supported MongoDB product)
Go
4
star
42

mongo-perl-bson-xs

Perl XS implementation of the BSON Specification -- http://bsonspec.org
C
4
star
43

cubes

Creating OLAP Cubes with MongoDB's Aggregation Framework
JavaScript
4
star
44

labs-modules

Labs modules for MongoDB.
Python
3
star
45

pymongoexplain

Explainable CRUD API for PyMongo
Python
3
star
46

omida

Ops Manager in Docker (arm64) WARNING: THIS IS NOT A PRODUCTION-GRADE IMAGE !!!
Shell
3
star
47

PyMongoAgg

Transpile Python functions to MongoDB Aggregations
Python
3
star
48

powerbi-connector-prototype

Prototype Custom Connector for PowerBI
3
star
49

ego

A non-production provisioning tool for installing MongoDB Ops Manager
Shell
3
star
50

swift-mongodb-tensorflow

Swift
2
star
51

ai-ml-pipeline-testing

Repository Dedicated to testing our third-party AI/ML integrations
Shell
2
star
52

mongodbmobile

This Repository is NOT a supported MongoDB product
Swift
2
star
53

django-mongodb

MongoDB Backend for Django
Python
2
star
54

mongo-ebpf-tools

Python
2
star
55

helium-ti-poc

Repo for UI prototype of TI-Helium POC
TypeScript
1
star
56

icecream

Icecream package repository for developer workstations
C++
1
star
57

python-service-tools

A repository to share common tools for working with python services.
Python
1
star
58

driver-performance-test-data

Datasets for MongoDB's internal driver benchmarking experiments - This Repository is NOT a supported MongoDB product
1
star
59

mongo-netopo

[Archive] Intern project - Network Topology Mapper for MongoDB - This Repository is NOT a supported MongoDB product
C++
1
star
60

mongodb-aem-course

Adobe Experience Manager and MongoDB Online Education Course - This Repository is NOT a supported MongoDB product
Shell
1
star
61

mpc-cli

Go
1
star
62

mongodb-cloudloads

Cloud-native MongoDB sample apps and workloads.
1
star
63

mgobson

Housing a wrapper around mgo's BSON library - This Repository is NOT a supported MongoDB product
Go
1
star
64

mongo-recsys

[Archive] Intern project - Recommendation system using MongoDB - This Repository is NOT a supported MongoDB product
Java
1
star
65

mongoid-fle-sample-app

Ruby on Rails Application that uses Mongoid/MongoDB to demonstrate Client-Side Field Level Encryption
Ruby
1
star
66

slogger

Go logging library - This Repository is NOT a supported MongoDB product
Go
1
star