Skip to content

tayyabmughal676/fastapi_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI Template with MongoDB

This repository provides a FastAPI template with MongoDB setup using Docker Compose.

Getting Started

Prerequisites

Make sure you have Docker and Docker Compose installed on your machine.

Start the services:

docker-compose up -d

Verify the services:

docker-compose ps

Stopping the Services

docker-compose down

The database will be accessible on localhost:27017 with the specified root username and password.

Run App

fastapi dev
 ╭────────── FastAPI CLI - Development mode ───────────╮                                                                                                                                                  
 │                                                     │                                                                                                                                                  
 │  Serving at: http://127.0.0.1:8000                  │                                                                                                                                                  
 │                                                     │                                                                                                                                                  
 │  API docs: http://127.0.0.1:8000/docs               │                                                                                                                                                  
 │                                                     │                                                                                                                                                  
 │  Running in development mode, for production use:   │                                                                                                                                                  
 │                                                     │                                                                                                                                                  
 │  fastapi run                                        │                                                                                                                                                  
 │                                                     │                                                                                                                                                  
 ╰─────────────────────────────────────────────────────╯ 

Project Requirements

  • Python 3.11
  • FastAPI
  • Mongodb
  • Pydantic
  • Pymongo
  • Beanie