https://github.com/coding4deep/ecommerce-microservice
https://github.com/coding4deep/ecommerce-microservice
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/coding4deep/ecommerce-microservice
- Owner: Coding4Deep
- Created: 2025-06-28T03:12:53.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T14:38:58.000Z (7 months ago)
- Last Synced: 2025-06-28T15:36:04.410Z (7 months ago)
- Language: JavaScript
- Size: 8.48 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ποΈ Enterprise E-Commerce Microservices Platform
A comprehensive, production-ready e-commerce platform built with modern microservices architecture, featuring real-time notifications, advanced user management, product reviews, inventory tracking, and responsive web interfaces.
## ποΈ Architecture Overview
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Web App (React) β Admin Panel (React) β
β Port: 3000 β Port: 3001 β
β - User Interface β - Admin Dashboard β
β - Product Catalog β - User Management β
β - Shopping Cart β - Analytics β
β - User Dashboard β - System Monitoring β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API GATEWAY (Nginx) β
β Port: 8080 β
β - Load Balancing - Rate Limiting - Health Checks β
β - Request Routing - SSL Termination - CORS Handling β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MICROSERVICES LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β User Service β Product Service β Cart Service β
β (Python/FastAPI) β (Java/Spring) β (Node.js/Express) β
β Port: 8001 β Port: 8002 β Port: 8003 β
β - Authentication β - Product CRUD β - Shopping Cart β
β - User Profiles β - Categories β - Session Management β
β - JWT Tokens β - Search/Filter β - Cart Persistence β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Notification β Review Service β Inventory Service β
β Service β (Node.js) β (Node.js) β
β (Node.js) β Port: 8006 β Port: 8007 β
β Port: 8005 β - Product Reviewsβ - Stock Management β
β - Email/SMS/Push β - Rating System β - Stock Reservations β
β - Real-time β - Review Moderationβ - Low Stock Alerts β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Admin Service β β
β (Go/Gin) β β
β Port: 8009 β β
β - Admin Panel APIβ β
β - User Managementβ β
β - System Analyticsβ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DATA LAYER β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β MongoDB β Redis Cache β HashiCorp Vault β
β Port: 27017 β Port: 6379 β Port: 8200 β
β - Primary DB β - Session Store β - Secrets Management β
β - Document Store β - Cache Layer β - API Keys β
β - Replica Sets β - Pub/Sub β - Certificates β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## π Features
### π **E-Commerce Core**
- **Product Management**: 32+ sample products across 5 categories
- **Shopping Cart**: Persistent cart with session management
- **User Authentication**: JWT-based auth with refresh tokens
- **Order Processing**: Complete order lifecycle management
- **Payment Integration**: Ready for Stripe/PayPal integration
### π₯ **User Experience**
- **Responsive Design**: Mobile-first, works on all devices
- **User Dashboard**: Personal stats, order history, profile management
- **Product Reviews**: 5-star rating system with image uploads
- **Real-time Notifications**: Email, SMS, and push notifications
- **Advanced Search**: Filter by category, price, brand, ratings
### π§ **Admin Features**
- **Admin Dashboard**: Real-time analytics and system monitoring
- **User Management**: CRUD operations on user accounts
- **Product Management**: Add, edit, delete products and categories
- **Order Management**: Track and update order statuses
- **System Health**: Monitor all microservices health
### π **Enterprise Features**
- **Microservices Architecture**: Scalable, maintainable, fault-tolerant
- **Real-time Updates**: WebSocket connections for live data
- **Inventory Management**: Stock tracking with automatic reservations
- **Notification System**: Multi-channel communication
- **Security**: JWT tokens, rate limiting, input validation
- **Monitoring**: Health checks, logging, error tracking
## π οΈ Technology Stack
### **Frontend**
- **React 18**: Modern UI library with hooks
- **React Router**: Client-side routing
- **Axios**: HTTP client for API calls
- **CSS3**: Custom responsive styling
- **Socket.IO Client**: Real-time communication
### **Backend Services**
- **Python/FastAPI**: User service with async support
- **Java/Spring Boot**: Product service with JPA
- **Node.js/Express**: Cart, notification, review, inventory services
- **Go/Gin**: Admin service for high performance
- **Nginx**: API Gateway and load balancer
### **Databases & Storage**
- **MongoDB**: Primary database for all services
- **Redis**: Caching and session storage
- **HashiCorp Vault**: Secrets management
### **DevOps & Infrastructure**
- **Docker**: Containerization for all services
- **Docker Compose**: Local development orchestration
- **Kubernetes**: Production deployment (configs included)
- **Health Checks**: Built-in monitoring for all services
## π Quick Start
### Prerequisites
- Docker & Docker Compose
- Node.js 18+ (for development)
- Git
### 1. Clone Repository
```bash
git clone
cd ecommerce-microservices
```
### 2. Start All Services
```bash
docker-compose up -d
```
### 3. Initialize Sample Data
```bash
node create-sample-products.js
```
### 4. Access Applications
- **Web App**: http://localhost:3000
- **Admin Panel**: http://localhost:3001
- **API Gateway**: http://localhost:8080
### 5. Default Credentials
**Admin User:**
- Email: `admin@example.com`
- Password: `admin123`
**Demo User:**
- Email: `demo@example.com`
- Password: `demo12345`
## π Project Structure
```
ecommerce-microservices/
βββ frontend/
β βββ web-app/ # React customer app
β βββ admin-app/ # React admin panel
βββ services/
β βββ user-service/ # Python/FastAPI
β βββ product-service/ # Java/Spring Boot
β βββ cart-service/ # Node.js/Express
β βββ notification-service/ # Node.js/Express
β βββ review-service/ # Node.js/Express
β βββ inventory-service/ # Node.js/Express
β βββ admin-service/ # Go/Gin
β βββ api-gateway/ # Nginx
βββ k8s/ # Kubernetes manifests
βββ data/ # Database initialization
βββ docker-compose.yml # Development setup
βββ README.md # This file
```
## π§ Development
### Running Individual Services
```bash
# User Service
cd services/user-service
python -m uvicorn src.main:app --reload --port 8001
# Product Service
cd services/product-service
./mvnw spring-boot:run
# Cart Service
cd services/cart-service
npm install && npm run dev
```
### Environment Variables
Each service uses environment variables for configuration. See individual service README files for details.
### Database Setup
MongoDB is automatically initialized with sample data. To reset:
```bash
docker-compose down -v
docker-compose up -d
node create-sample-products.js
```
## π§ͺ Testing
### Manual Testing
1. **User Flow**: Register β Login β Browse Products β Add to Cart β Checkout
2. **Admin Flow**: Login β Dashboard β Manage Users β Manage Products
3. **API Testing**: Use Postman collection (included in `/docs`)
### Health Checks
```bash
# Check all services
curl http://localhost:8080/health
# Individual services
curl http://localhost:8001/health # User Service
curl http://localhost:8002/products/health # Product Service
curl http://localhost:8003/health # Cart Service
```
## π Production Deployment
### Kubernetes
```bash
# Apply all manifests
kubectl apply -f k8s/
# Check deployment status
kubectl get pods -n ecommerce
```
### Docker Swarm
```bash
# Initialize swarm
docker swarm init
# Deploy stack
docker stack deploy -c docker-compose.yml ecommerce
```
### Environment Configuration
- Set production environment variables
- Configure external databases
- Set up SSL certificates
- Configure monitoring and logging
## π Monitoring & Observability
### Health Endpoints
- All services expose `/health` endpoints
- API Gateway aggregates health status
- Built-in service discovery
### Logging
- Structured JSON logging
- Centralized log aggregation ready
- Error tracking and alerting
### Metrics
- Performance metrics collection
- Business metrics tracking
- Real-time dashboards ready
## π Security
### Authentication & Authorization
- JWT-based authentication
- Role-based access control (RBAC)
- Secure password hashing
- Session management
### API Security
- Rate limiting on all endpoints
- Input validation and sanitization
- CORS configuration
- SQL injection prevention
### Infrastructure Security
- Secrets management with Vault
- Network isolation
- Container security scanning
- Regular security updates
## π€ Contributing
1. Fork the repository
2. Create feature branch (`git checkout -b feature/amazing-feature`)
3. Commit changes (`git commit -m 'Add amazing feature'`)
4. Push to branch (`git push origin feature/amazing-feature`)
5. Open Pull Request
### Development Guidelines
- Follow service-specific coding standards
- Write comprehensive tests
- Update documentation
- Ensure backward compatibility
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Support
### Documentation
- [API Documentation](docs/api.md)
- [Deployment Guide](docs/deployment.md)
- [Troubleshooting](docs/troubleshooting.md)
### Getting Help
- Create an issue for bugs
- Use discussions for questions
- Check existing documentation first
## π― Roadmap
### Phase 1 (Current)
- β
Core e-commerce functionality
- β
Microservices architecture
- β
Admin panel
- β
Real-time notifications
### Phase 2 (Planned)
- [ ] Payment gateway integration
- [ ] Advanced analytics
- [ ] Mobile app (React Native)
- [ ] AI-powered recommendations
### Phase 3 (Future)
- [ ] Multi-tenant support
- [ ] Advanced reporting
- [ ] Third-party integrations
- [ ] Machine learning features
---
**Built with β€οΈ for modern e-commerce needs**
*This platform demonstrates enterprise-grade microservices architecture with real-world features and production-ready code.*