A high-performance RESTful API built to manage product inventory and pricing. This project demonstrates modern backend development practices using FastAPI connected to a PostgreSQL database.
- Framework: FastAPI (Python)
- Database: PostgreSQL
- ORM: SQLAlchemy
- Validation: Pydantic
- Server: Uvicorn
- RESTful CRUD: Complete Create, Read, Update, and Delete operations for products.
- Database Integration: Persistent storage using PostgreSQL with SQLAlchemy ORM.
- Data Validation: Automatic request validation using Pydantic models.
- Interactive Documentation: Auto-generated Swagger UI and ReDoc.
| Method | Endpoint | Function |
|---|---|---|
| GET | / |
API Health Check / Welcome |
| GET | /products/ |
Retrieve all products |
| GET | /products/{id} |
Retrieve a specific product |
| POST | /products/ |
Add a new product to inventory |
| PUT | /products/{id} |
Update existing product details |
| DELETE | /products/{id} |
Remove a product |
To run this project locally:
- Clone the repository and navigate to the project folder.
- Install dependencies:
pip install fastapi uvicorn sqlalchemy psycopg2-binary
- Configure Database: Update the connection string in
database.py. - Run the Server:
uvicorn main:app --reload
- View Documentation:
Open your browser to
http://localhost:8000/docsto test the API interactively.
Likhith Gowda M Built for learning and demonstrating Backend Engineering skills.