A full-stack web application using the FARM stack — FastAPI, React, and MongoDB — demonstrating a modern, decoupled architecture with a Python async backend, React frontend, and NoSQL database.
- Async REST API with FastAPI + Motor (async MongoDB driver)
- Auto-generated Swagger UI at
/docs - React frontend consuming the FastAPI backend
- MongoDB Atlas for cloud-hosted NoSQL storage
- Full CRUD operations
| Layer | Technology |
|---|---|
| Backend | Python, FastAPI, Uvicorn |
| Database | MongoDB (Atlas) + Motor (async driver) |
| Frontend | React |
| API Docs | Swagger / OpenAPI (built into FastAPI) |
| Package mgmt | pipenv |
- Python 3.9+
- Node.js 16+
- A MongoDB Atlas free cluster
cd backend
# Install pipenv
pip install pipenv
# Create virtual environment and install dependencies
pipenv install -r requirements.txt
# Activate virtual environment
pipenv shell
# Start the API server
uvicorn main:app --reloadBackend runs at http://localhost:8000
Swagger UI at http://localhost:8000/docs
cd frontend
npm install
npm startFrontend runs at http://localhost:3000
farmstack_project/
├── backend/
│ ├── main.py # FastAPI app entry point
│ ├── models.py # MongoDB document models
│ ├── routes/ # API route handlers
│ └── requirements.txt
└── frontend/
├── src/
│ ├── components/
│ └── App.js
└── package.json
Run the entire stack with Docker Compose:
# docker-compose.yml
version: '3.8'
services:
backend:
build: ./backend
ports:
- "8000:8000"
environment:
MONGODB_URL: mongodb+srv://<user>:<pass>@cluster.mongodb.net/farmdb
frontend:
build: ./frontend
ports:
- "3000:3000"
depends_on:
- backenddocker-compose up --buildVignesh Joshi — github.com/joshivignesh