Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/saadarazzaq/product-reviews-api
Dockerized Amazon Product Reviews CRUD API with MongoDB ⚡️🛢
https://github.com/saadarazzaq/product-reviews-api
beanie-odm crud docker fastapi mongo-jamie mongodb
Last synced: 1 day ago
JSON representation
Dockerized Amazon Product Reviews CRUD API with MongoDB ⚡️🛢
- Host: GitHub
- URL: https://github.com/saadarazzaq/product-reviews-api
- Owner: SaadARazzaq
- Created: 2024-06-30T10:49:40.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-30T11:54:55.000Z (7 months ago)
- Last Synced: 2024-11-23T09:29:55.925Z (2 months ago)
- Topics: beanie-odm, crud, docker, fastapi, mongo-jamie, mongodb
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Product-Reviews 📝
This project demonstrates a FastAPI application using Beanie ODM (Object Document Mapper) for MongoDB. The project is containerized using Docker and Docker Compose for easy setup and deployment.
## Project Demonstration 📹
[![Product Reviews API](https://github.com/SaadARazzaq/Product-Reviews-API/assets/123338307/7960274c-5ac1-4726-96d2-367c99bf0896)](https://www.loom.com/share/bd94945efe2242eb8bbeda4b5ff4ec7a?sid=25e23587-d6e6-4b2e-b681-113c20004a93)
## Project Structure 🧱
- **app/server/models/product_review.py**: Defines the `ProductReview` and `UpdateProductReview` models using `Beanie` and `Pydantic`.
- **app/server/routes/product_review.py**: Contains the `API routes` for handling product reviews.
- **app/server/app.py**: The main `FastAPI` application setup, including `route inclusion` and `database initialization`.
- **app/server/database.py**: Contains the `database initialization logic`.
- **main.py**: The entry point for running the `Uvicorn server`.
- **Dockerfile**: The `Dockerfile` for building the FastAPI application image.
- **docker-compose.yml**: `Docker Compose file` for setting up the `FastAPI` and `MongoDB services`.
- **requirements.txt**: Python dependencies required for the project.## Getting Started 🏃
### Prerequisites 📋
- `Docker Desktop` installed and up and running on your machine.
### Installation 🛠️
1. Clone the repository:
```sh
git clone https://github.com/SaadARazzaq/Product-Reviews-API
cd fastapi-beanie
```2. Build and start the Docker containers:
```sh
docker-compose up --build
```3. The FastAPI application will be available at `http://localhost:8000`.
### API Endpoints ⚡
### Example Product Review Model Schema 🧩
```json
{
"name": "Saad Abdur Razzaq",
"title": "MacBook Air M2",
"rating": 5.0,
"review": "Best Laptop in the world",
"date": "2023-06-30T12:34:56.789Z"
}
```### Example Update Product Review Model Schema 🧩
```json
{
"name": "Taha Abdur Razzaq",
"title": "HP Victus 16",
"rating": 5.0,
"review": "Worst Laptop in the world",
"date": "2023-06-30T12:34:56.789Z"
}
```### Notes 📒
- Ensure MongoDB is running and accessible for the FastAPI application to function correctly.
- The mongo_url in app/server/database.py is set to connect to a MongoDB instance at host.docker.internal.---
```bash
This project was made with 💖 by Saad Abdur Razzaq
```