Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FAST-API Backend Demonstration

Project Banner

A asynchronous RESTful API backend built with FastAPI and MongoDB (using Motor for async database operations). This project demonstrates complete CRUD functionality for managing blog posts along with custom application lifecycle management.


🛠 Tech Stack


⚙️ Prerequisites & Configuration

Create a .env file in the root directory of your project and configure your MongoDB connection URL:

mongodb+srv://<username>:<password>@<cluster-address>/

Getting Started

Clone the Repository

git clone https://github.com/TherealArithmeticProgression/FAST-API-backend-demonstration.git
cd FAST-API-backend-demonstration

Set Up Virtual Environment & Install Dependencies

Create virtual environment

python -m venv venv

Activate virtual environment

On Windows:

venv\Scripts\activate

On macOS/Linux:

source venv/bin/activate

Install required packages

pip install fastapi uvicorn motor pymongo python-dotenv pydantic

Run the Server

uvicorn app.main:app --reload

The app will launch at http://127.0.0.1:8000. You can test interactive API docs directly at http://127.0.0.1:8000/docs

Request Body Schema

When creating or updating a post, supply the following JSON body:

{
  "title": "Your Post Title",
  "content": "Your post content goes here..."
}

About

FAST API web framework, built to work with REST architectural style is especially compatible with asynchronous requests and functions. This sample code performs CRUD (create, read, update, delete) operations on a MongoDB collection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages