• Stars
    star
    282
  • Rank 146,549 (Top 3 %)
  • Language
    Python
  • Created almost 4 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

Example of using MongoDB with FastAPI

MongoDB with FastAPI

This is a small sample project demonstrating how to build an API with MongoDB and FastAPI. It was written to accompany a blog post - you should go read it!

TL;DR

If you really don't want to read the blog post and want to get up and running, activate your Python virtualenv, and then run the following from your terminal (edit the MONGODB_URL first!):

# Install the requirements:
pip install -r requirements.txt

# Configure the location of your MongoDB database:
export MONGODB_URL="mongodb+srv://<username>:<password>@<url>/<db>?retryWrites=true&w=majority"

# Start the service:
uvicorn app:app --reload

(Check out MongoDB Atlas if you need a MongoDB database.)

Now you can load http://localhost:8000/docs in your browser ... but there won't be much to see until you've inserted some data.

If you have any questions or suggestions, check out the MongoDB Community Forums!

More Repositories

1

GenAI-Showcase

GenAI Cookbook
Jupyter Notebook
353
star
2

mern-stack-example

Mern Stack code for the Mern Tutorial
JavaScript
311
star
3

nodejs-quickstart

This repository contains code samples for the Node.js Quick Start blog post series
JavaScript
227
star
4

pymongo-fastapi-crud

PyMongo with FastAPI CRUD application
Python
133
star
5

mongodb-express-rest-api-example

Example for the article on MongoDB and Express JS web REST API tutorial
JavaScript
132
star
6

jumpstart-series

102
star
7

java-spring-boot-mongodb-starter

MongoDB Blog Post: REST APIs with Java, Spring Boot and MongoDB
Java
70
star
8

java-quick-start

This repository contains code samples for the Java Quick Start blog post series
Java
62
star
9

WhatsCooking

Restaurant Finder application for NYC demonstrating Atlas Search Features. Uses React and Tailwind.
JavaScript
61
star
10

flask-pymongo-example

Implementation of flask and pymongo using mflix sample data set and mflix python UI
Python
52
star
11

cloudflare-worker-rest-api-atlas

This project explains how to build a REST API in a Cloudflare worker using MongoDB Realm Web JS and a MongoDB Atlas cluster to store the data.
TypeScript
51
star
12

mean-stack-example

Sample CRUD application built with the MEAN stack.
TypeScript
49
star
13

nextjs-with-mongodb

nextjs-with-mongodb
TypeScript
41
star
14

library-management-system

Sample App used in the hands-on labs during Developer Days
TypeScript
40
star
15

social-app-demo

39
star
16

service-tests

Correctness test runner for MongoDB API endpoint and instructions for performance testing
Python
37
star
17

rewrite-it-in-rust

Rust
28
star
18

mongodb-dotnet-example

MongoDB and .NET CRUD example project
C#
27
star
19

mongodb-typescript-example

TypeScript
26
star
20

prisma-mongodb-nextjs-example

TypeScript
26
star
21

FARM-Auth

Adding authentication to FARM stack
Python
22
star
22

open-data-covid-19

Open Data Repository for the Covid-19 dataset.
Python
21
star
23

atlas-vector-search-rag

Python
21
star
24

LangGraph.js-MongoDB-Example

TypeScript
17
star
25

angular-realm-graphql

Angular and GraphQL API Demo - Movie Catalog
TypeScript
17
star
26

LiveTutorialChat

Kotlin
17
star
27

SocialStats

JavaScript
17
star
28

mongodb-next-todo

JavaScript
16
star
29

Google-Cloud-Semantic-Search

Vector search with MongoDB Atlas and Google Cloud
JavaScript
16
star
30

django-pymongo

To show how we can connect django projects to mongodb using pymongo driver
Python
16
star
31

simple-ms-rust

Microservice written in Rust from scratch.
Rust
16
star
32

atlas-search-soccer

JavaScript
15
star
33

laravel-mongodb-tutorial

This repository illustrates a tutorial article about how to use MongoDB with Laravel 9 and the Laravel MongoDB package
PHP
15
star
34

Google-Cloud-RAG-Langchain

RAG Chat Assistant with MongoDB Atlas, Google Cloud and Langchain
TypeScript
14
star
35

leafsteroids

This repository contains the MongoDB Leafsteroids Game
C#
14
star
36

docbridge

A (currently experimental) Object-Document Mapping library.
Python
14
star
37

rust-quickstart-code

Rust
13
star
38

MongoDB-SuperDuperDB

MongoDb/SuperDuperDB demo - just cut and paste!
Python
13
star
39

mongodb-ecommerce

JavaScript
12
star
40

read-it-later-maybe

Offline-First React Native Mobile App with Expo and Realm
JavaScript
12
star
41

mongodb-kmip-fle-queryable

How to setup Hashicorp Vault KMIP Secrets Engine with MongoDB CSFLE and Queryable encryption to
Python
12
star
42

Google-Cloud-Sentiment-Chef

Sentiment Analysis, Summarization, Tagging with MongoDB Atlas and Gemini — Google Cloud's AI model
TypeScript
12
star
43

liberate-data

Learn how data trapped in an RDBMS can be liberated using MongoDB's Developer Data Platform (DDP) by migrating to Atlas, powering with search, and expose to API and mobile clients. This demo was created for AWS re:Invent 2023 and presented at the MongoDB booth theater at the Venetian expo hall.
Swift
12
star
44

HouseMovingAssistant

A sample demo, showing the use of .NET MAUI with Realm
C#
11
star
45

remix

TypeScript
11
star
46

mongodb-springboot3-kotlin

Getting started App with Spring Boot 3 in Kotlin using MongoDB
Kotlin
11
star
47

location-tracking

TypeScript
11
star
48

Google-Cloud-Generative-AI-Chatbot

Generative AI Customer Service Chatbot with MongoDB Atlas and Google Cloud Vertex AI PaLM API
HTML
11
star
49

farm-stack-to-do-app

A sample to-do application built as a teaching tool.
Python
11
star
50

SplashScreen-Android

Learn how to build Splash Screen natively using Android 12 API
Kotlin
10
star
51

MongoRx

TypeScript
10
star
52

bidding-app-angular

Web App demonstrating Real-time event delivery with MongoDB Atlas App Services and Realm Web SDK
TypeScript
10
star
53

RealmDemo

Demo app for data collection using Realm Sync
Kotlin
10
star
54

AtlasForms

Forms Based UI for MongoDB Atlas
JavaScript
10
star
55

beanie-example

Python
10
star
56

java-spring-apps

Example MongoDB Applications using Java and Spring
HTML
10
star
57

image-search-vector-demo

A Jupyter Notebook demonstrating how to use a multi-modal embedding model to build an image search engine.
Jupyter Notebook
10
star
58

kotlin-driver-quick-start

Kotlin
10
star
59

mern-k8s

Simple demo app using the MongoDB Atlas Operator on k8s
JavaScript
9
star
60

IntroToRust

Code of the Intro to Rust workshop
Rust
9
star
61

python-quickstart-code

Python
9
star
62

workshop

MongoDB Developer Workshops
9
star
63

plummeting-people-game

A tribute to "Fall Guys: Ultimate Knockout"
C#
8
star
64

atlas-vector-search-langchain

This Repo shows how to integrate LangChain, Open AI and store embeddings in the MongoDB Atlas and run a similarity search using MongoDB Atlas Vector Search.
Jupyter Notebook
8
star
65

get-started-aws-cfn

Get started using MongoDB Atlas with AWS CloudFormation today!
Shell
8
star
66

Conference-Queries-App

App for managing session queries in real time using KMM with MongoDB & Realm.
Kotlin
8
star
67

golang-quickstart

Go
7
star
68

mern-stack-azure-deployment-example

A demo repo showing a simple MERN stack application that can be deployed to Azure Web Apps using GitHub Actions
JavaScript
7
star
69

nodejs-aws-lambda-iam

JavaScript
7
star
70

mongodb-sprint-zero

Contains reusable code artifacts that can be used in Sprint Zero engagements
Java
7
star
71

Google-Cloud-Natural-Language-MongoDB-Query-API

Kotlin
6
star
72

mongodb-codeigniter

MongoDB & CodeIgniter CRUD Tutorial
PHP
6
star
73

laravel-example

Laravel and MongoDB example main files
PHP
6
star
74

datasets

Python
6
star
75

search-nextjs

JavaScript
6
star
76

lucene-search-analysis

Java
6
star
77

data-federation-tutorial

This repo contains some code samples for DevHub blog posts.
Python
6
star
78

quickstart-rag-python

This Python project demonstrates semantic search using MongoDB and two different LLM frameworks: LangChain and LlamaIndex. The goal is to load documents from MongoDB, generate embeddings for the text data, and perform semantic searches using both LangChain and LlamaIndex frameworks.
Jupyter Notebook
6
star
79

dream

MongoDB DREAM: Developer Relation Engagement & Activity Metrics
JavaScript
6
star
80

hr_agentic_chatbot

Agentic chatbot built using a chainlit interface
Python
6
star
81

back-to-basics-2019

Content for Back to Basics 2019 Webinar Series
Python
6
star
82

kotlin-driver-atlas-search

This repository demonstrates how to integrate MongoDB Atlas Search with the Kotlin Sync driver using a Spring Boot REST application. The goal is to create a solution for exploring and discovering an ideal Airbnb, leveraging the advanced search capabilities of MongoDB Atlas.
Kotlin
6
star
83

PassKeeper

Password Manager App based on KMM
Kotlin
5
star
84

community-resources

MongoDB Community resources
5
star
85

celeb-matcher-farm

A sample FARM stack app that allows you to find your celebrity lookalike!
Python
5
star
86

e2e-game-offers

JavaScript
5
star
87

mongo-conference

Demo application for conference management, built using Flexible Sync and Realm.
Kotlin
5
star
88

microservices-architecture-mongodb

Templates to create a Java Spring Boot microservices architecture with MongoDB
Java
5
star
89

VectorSearch-VideoText

Learn how to search video within text using SDDB and Vector embeddings
Python
5
star
90

getting-started-deno-mongodb

TypeScript
5
star
91

get-started-readme

Repository for meta files related to the quickstart code example series
5
star
92

mdb-spring-boot-reactive

Reactive Java Spring Boot with Spring Data MongoDB
Java
5
star
93

mongo-resilient-evolvability-demo

Demonstrates MongoDB best practices for building resilient yet evolvable shared data applications, using Rust as an example
Rust
5
star
94

BlackJackTrainer

Swift
5
star
95

meeting-mate

MVP to showcase how MongoDB can be used to implement an end-to-end user-facing app
Python
4
star
96

SemanticKernel_With_CSharp_And_Atlas

C#
4
star
97

Travic-CI-to-Atlas-IP-Access-Lister

Python
4
star
98

mongodb-node-crud-example

Code samples for the MongoDB and npm article.
JavaScript
4
star
99

RTicket

A very simple issue ticket system built using Realm and SwiftUI
Swift
4
star
100

EmojiGarden

Kotlin
4
star