Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pvfarooq/fastapi-simple-ecommerce-microservice
A straightforward e-commerce backend built with a microservices architecture using FastAPI.
https://github.com/pvfarooq/fastapi-simple-ecommerce-microservice
fastapi microservice postgresql pydantic python rabbitmq sqlalchemy
Last synced: 2 days ago
JSON representation
A straightforward e-commerce backend built with a microservices architecture using FastAPI.
- Host: GitHub
- URL: https://github.com/pvfarooq/fastapi-simple-ecommerce-microservice
- Owner: pvfarooq
- Created: 2024-12-31T12:10:58.000Z (9 days ago)
- Default Branch: main
- Last Pushed: 2025-01-01T19:53:20.000Z (8 days ago)
- Last Synced: 2025-01-01T20:31:25.495Z (8 days ago)
- Topics: fastapi, microservice, postgresql, pydantic, python, rabbitmq, sqlalchemy
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Simple e-commerce backend service using microservices
A learning-focused implementation of a microservices-based e-commerce backend system. This project demonstrates microservices architecture, message queuing, and containerization principles using modern Python technologies.## Technology Stack
#### Backend Framework & Tools
FastAPI: Modern, fast web framework for building APIs
SQLAlchemy: SQL toolkit and ORM
Alembic: Database migration tool
Pydantic: Data validation using Python type annotations#### Data Storage & Messaging
PostgreSQL: Primary database for all services
RabbitMQ: Message broker for inter-service communication#### Infrastructure
Docker: Containerization of services
Docker Compose: Multi-container orchestration###Project Structure
```
├── main_service/ # User and Product management service
│ ├── alembic/ # Database migrations
│ ├── messaging/ # RabbitMQ communication handlers
│ ├── user/ # User module
│ │ ├── models.py # SQLAlchemy models
│ │ ├── schemas.py # Pydantic schemas
│ │ └── crud.py # Database operations
│ ├── product/ # Product module
│ │ ├── models.py
│ │ ├── schemas.py
│ │ └── crud.py
│ ├── core/ # Core configurations
│ │ ├── db.py # Database configuration
│ │ └── config.py # Service configuration
│ ├── Dockerfile
│ ├── main.py # FastAPI application entry point
│ ├── requirements.txt
│ └── .env
│
├── order_service/ # Order management service
│ ├── alembic/
│ ├── messaging/
│ ├── order/
│ │ ├── models.py
│ │ ├── schemas.py
│ │ └── crud.py
│ ├── core/
│ │ ├── db.py
│ │ └── config.py
│ ├── Dockerfile
│ ├── main.py
│ ├── requirements.txt
│ └── .env
│
├── docker-compose.yml # Service orchestration configuration
├── Makefile # Development automation commands
└── README.md
```### API Documentation
Once the services are running, access the API documentation:Main Service: http://localhost:8000/docs
Order Service: http://localhost:8001/docs
#### Note
This project is intended for learning purposes and demonstrates microservices architecture concepts. It may not be suitable for production use without additional security and performance considerations.