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.
- Language: Python 3.10+
- Framework: FastAPI
- Database: MongoDB
- Async Driver: Motor
- Data Validation: Pydantic
Create a .env file in the root directory of your project and configure your MongoDB connection URL:
mongodb+srv://<username>:<password>@<cluster-address>/
git clone https://github.com/TherealArithmeticProgression/FAST-API-backend-demonstration.git
cd FAST-API-backend-demonstration
python -m venv venvvenv\Scripts\activate
source venv/bin/activate
pip install fastapi uvicorn motor pymongo python-dotenv pydanticuvicorn app.main:app --reloadThe 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
{
"title": "Your Post Title",
"content": "Your post content goes here..."
}