{"id":31190502,"url":"https://github.com/notyusheng/taob4o","last_synced_at":"2026-06-17T20:34:12.523Z","repository":{"id":309162459,"uuid":"1035264427","full_name":"NotYuSheng/Taob4o","owner":"NotYuSheng","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-10T07:48:53.000Z","size":135,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-19T22:31:18.416Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NotYuSheng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-10T02:36:53.000Z","updated_at":"2025-08-10T07:48:56.000Z","dependencies_parsed_at":"2025-08-10T09:22:41.596Z","dependency_job_id":"e7e36c30-2819-4420-814d-a9d4b08551ca","html_url":"https://github.com/NotYuSheng/Taob4o","commit_stats":null,"previous_names":["notyusheng/taob4o"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NotYuSheng/Taob4o","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2FTaob4o","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2FTaob4o/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2FTaob4o/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2FTaob4o/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NotYuSheng","download_url":"https://codeload.github.com/NotYuSheng/Taob4o/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NotYuSheng%2FTaob4o/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000708,"owners_count":26082862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-19T21:34:14.514Z","updated_at":"2025-10-08T23:54:05.341Z","avatar_url":"https://github.com/NotYuSheng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Taobao Clone - Microservices with Istio\n\nA full-stack e-commerce platform clone built with modern microservices architecture, designed as a learning project to explore **Istio service mesh** capabilities on Kubernetes.\n\n![Architecture Diagram](architecture-diagram.png)\n\n## 🏗️ Architecture Overview\n\nThis project implements a **microservices architecture** with the following components:\n\n### Frontend\n- **React** application with modern UI\n- **Nginx** reverse proxy for API routing\n- Containerized for consistent deployment\n\n### Backend Services (FastAPI)\n- **User Service** - Authentication and user management\n- **Product Service** - Product catalog management  \n- **Cart Service** - Shopping cart operations\n- **Order Service** - Order processing and workflow\n- **Payment Service** - Payment processing and validation\n- **Inventory Service** - Stock management and reservations\n\n### Infrastructure\n- **PostgreSQL** database with separate schemas per service\n- **Kubernetes** orchestration with service discovery\n- **Istio** service mesh for advanced traffic management\n- **Docker** containerization for all services\n\n## 🚀 Getting Started\n\n### Prerequisites\n- **Docker** and **Docker Compose**\n- **Kubernetes** cluster (minikube for local development)\n- **kubectl** CLI tool\n- **istioctl** CLI tool (for service mesh features)\n\n### Quick Start\n\n#### 1. Local Development (Docker Compose)\n```bash\n# Build and start all services\nmake build\nmake up\n\n# Access the application\n# Frontend: http://localhost:3000\n# API services: http://localhost:8001-8006\n\n# View logs\nmake logs\n\n# Stop services\nmake down\n```\n\n#### 2. Kubernetes Deployment\n```bash\n# Start minikube cluster\nminikube start\n\n# Deploy to Kubernetes\nmake k8s-deploy\n\n# Check deployment status\nkubectl get pods\nkubectl get services\n\n# Access frontend\nminikube service frontend-service --url\n```\n\n#### 3. Istio Service Mesh (Advanced)\n```bash\n# Install Istio\nmake istio-install\n\n# Deploy Istio configurations\nmake istio-deploy\n\n# Access Istio features\n# - Traffic management\n# - Security policies (mTLS)\n# - Observability and tracing\n```\n\n## 📋 Available Commands\n\nAll commands are available through the **Makefile**:\n\n### Docker Compose\n- `make build` - Build all containers\n- `make up` - Start all services locally\n- `make down` - Stop all services  \n- `make logs` - View service logs\n- `make clean` - Clean up containers and volumes\n\n### Kubernetes  \n- `make k8s-deploy` - Deploy to Kubernetes\n- `make k8s-delete` - Remove from Kubernetes\n\n### Istio Service Mesh\n- `make istio-install` - Install Istio and enable injection\n- `make istio-deploy` - Deploy Istio configurations\n\n### Development\n- `make dev-frontend` - Start React development server\n- `make dev-user-service` - Start user service in dev mode\n- `make dev-product-service` - Start product service in dev mode\n\n## 🛠️ Project Structure\n\n```\nTaobao/\n├── frontend/                 # React frontend with Nginx\n│   ├── src/                 # React source code  \n│   ├── nginx/               # Nginx configuration\n│   ├── package.json         # Frontend dependencies\n│   └── Dockerfile          # Frontend container build\n├── services/                # FastAPI microservices\n│   ├── user-service/        # User authentication \u0026 management\n│   ├── product-service/     # Product catalog\n│   ├── cart-service/        # Shopping cart\n│   ├── order-service/       # Order processing\n│   ├── payment-service/     # Payment handling\n│   └── inventory-service/   # Inventory management\n├── k8s/                     # Kubernetes configurations\n│   ├── deployments/         # Service deployments\n│   ├── services/           # Service definitions\n│   ├── istio/              # Istio configurations\n│   └── configmaps/         # Configuration maps\n├── docker-compose.yml       # Local development setup\n├── Makefile                # Build and deployment commands\n└── architecture-diagram.png # Project architecture\n```\n\n## 🔧 Service Details\n\n### API Endpoints\n\nEach service exposes RESTful APIs:\n\n- **User Service** (`localhost:8001`) - `/health`, `/users`, `/users/register`, `/users/login`\n- **Product Service** (`localhost:8002`) - `/health`, `/products`, `/products/{id}`  \n- **Cart Service** (`localhost:8003`) - `/health`, `/cart/{user_id}`, `/cart/{user_id}/items`\n- **Order Service** (`localhost:8004`) - `/health`, `/orders`, `/orders/{id}`\n- **Payment Service** (`localhost:8005`) - `/health`, `/payments`\n- **Inventory Service** (`localhost:8006`) - `/health`, `/inventory/{product_id}`\n\n### Database Schema\n\nPostgreSQL with dedicated schemas:\n- `userdb` - User accounts and authentication\n- `productdb` - Product catalog and details\n- `cartdb` - Shopping cart sessions  \n- `orderdb` - Order history and transactions\n\n## 🌐 Service Communication\n\nThe architecture implements several communication patterns:\n\n### Frontend → Backend\n- React app calls REST APIs via Nginx proxy\n- Routes: `/api/users`, `/api/products`, `/api/cart`, `/api/orders`\n\n### Inter-Service Communication  \n- **Cart Service** ↔ Product Service (product validation)\n- **Cart Service** ↔ Inventory Service (stock management)\n- **Order Service** → Payment Service (payment processing)\n- **Order Service** → Inventory Service (item reservation)\n- **Order Service** → User Service (user validation)\n\n## 🔒 Istio Features\n\nWhen deployed with Istio, the project demonstrates:\n\n### Traffic Management\n- **Virtual Services** for advanced routing rules\n- **Destination Rules** for load balancing strategies\n- **Gateway** for external traffic management\n- **Circuit breakers** and fault injection\n\n### Security\n- **Mutual TLS (mTLS)** between all services\n- **Authorization policies** for access control\n- **JWT validation** for user authentication\n\n### Observability  \n- **Distributed tracing** with Jaeger\n- **Metrics collection** with Prometheus\n- **Service mesh visualization** with Kiali\n- **Access logging** and monitoring\n\n## 📊 Learning Outcomes\n\nThis project helps you learn:\n\n1. **Microservices Architecture** - Service decomposition, communication patterns\n2. **Containerization** - Docker best practices, multi-stage builds  \n3. **Kubernetes Orchestration** - Deployments, services, configuration management\n4. **Istio Service Mesh** - Traffic management, security, observability\n5. **DevOps Practices** - CI/CD patterns, infrastructure as code\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**Frontend crashes in Kubernetes:**\n```bash\n# Check if all services are deployed\nkubectl get services\n\n# Verify service endpoints are available\nkubectl get pods\n```\n\n**Service connection issues:**\n```bash\n# Check service logs\nkubectl logs deployment/user-service\n\n# Test service connectivity  \nkubectl port-forward service/user-service 8001:8000\ncurl http://localhost:8001/health\n```\n\n**Istio sidecar not injecting:**\n```bash\n# Ensure namespace has Istio injection enabled\nkubectl label namespace default istio-injection=enabled\n\n# Restart deployments to inject sidecars\nkubectl rollout restart deployment --all\n```\n\n## 📚 References\n\n- [Istio Documentation](https://istio.io/latest/docs/)\n- [Kubernetes Documentation](https://kubernetes.io/docs/)\n- [FastAPI Documentation](https://fastapi.tiangolo.com/)\n- [React Documentation](https://react.dev/)\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🤝 Contributing\n\nThis is a learning project, but contributions are welcome! Please feel free to submit issues and enhancement requests.\n\n---\n\n**Built with ❤️ for learning Istio and microservices architecture**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Ftaob4o","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotyusheng%2Ftaob4o","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotyusheng%2Ftaob4o/lists"}