{"id":30621888,"url":"https://github.com/yemresalcan/e-commerceapi","last_synced_at":"2026-04-16T10:01:50.490Z","repository":{"id":308605748,"uuid":"1024515839","full_name":"Yemresalcan/E-commerceAPI","owner":"Yemresalcan","description":"🛒 .NET 9 E-Commerce API - Enterprise Level Microservices Architecture","archived":false,"fork":false,"pushed_at":"2025-08-06T19:56:10.000Z","size":917,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T15:04:22.489Z","etag":null,"topics":["api","docker","ecommerce","elasticsearch","net9","rabittmq","redis"],"latest_commit_sha":null,"homepage":"","language":"C#","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/Yemresalcan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-07-22T20:29:54.000Z","updated_at":"2025-08-25T18:26:06.000Z","dependencies_parsed_at":"2025-08-06T21:46:47.954Z","dependency_job_id":null,"html_url":"https://github.com/Yemresalcan/E-commerceAPI","commit_stats":null,"previous_names":["yemresalcan/e-commerceapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Yemresalcan/E-commerceAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yemresalcan%2FE-commerceAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yemresalcan%2FE-commerceAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yemresalcan%2FE-commerceAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yemresalcan%2FE-commerceAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yemresalcan","download_url":"https://codeload.github.com/Yemresalcan/E-commerceAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yemresalcan%2FE-commerceAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","docker","ecommerce","elasticsearch","net9","rabittmq","redis"],"created_at":"2025-08-30T15:01:52.715Z","updated_at":"2026-04-16T10:01:50.484Z","avatar_url":"https://github.com/Yemresalcan.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛒 E-Commerce API - Enterprise Level Microservices Architecture\n\n[![.NET](https://img.shields.io/badge/.NET-9.0-blue.svg)](https://dotnet.microsoft.com/)\n[![C#](https://img.shields.io/badge/C%23-12.0-green.svg)](https://docs.microsoft.com/en-us/dotnet/csharp/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-16-blue.svg)](https://www.postgresql.org/)\n[![Elasticsearch](https://img.shields.io/badge/Elasticsearch-8.0-yellow.svg)](https://www.elastic.co/)\n[![Redis](https://img.shields.io/badge/Redis-7.0-red.svg)](https://redis.io/)\n[![RabbitMQ](https://img.shields.io/badge/RabbitMQ-3.12-orange.svg)](https://www.rabbitmq.com/)\n[![Docker](https://img.shields.io/badge/Docker-Supported-blue.svg)](https://www.docker.com/)\n[![CI/CD](https://img.shields.io/badge/CI%2FCD-GitHub%20Actions-green.svg)](https://github.com/features/actions)\n[![Monitoring](https://img.shields.io/badge/Monitoring-Prometheus%20%2B%20Grafana-orange.svg)](https://prometheus.io/)\n\n\u003e **Modern, scalable, and production-ready E-Commerce API built with .NET 9, implementing Clean Architecture, CQRS, Event Sourcing, and Microservices patterns.**\n\n[🇹🇷 Türkçe Dokümantasyon](README.tr.md) | [📖 English Documentation](#english-documentation)\n\n---\n\n## 🚀 **Live Demo Screenshots**\n\n\u003cdiv align=\"center\"\u003e\n\n### 📊 **Enterprise Monitoring Stack**\n![Monitoring Overview](assets/grafana.png)\n\n### 🎯 **Production-Ready Infrastructure**\n![Infrastructure Monitoring](assets/prometeus.png)\n\n\u003c/div\u003e\n\n## 🌟 **Key Features**\n\n### 🏗️ **Architecture \u0026 Design Patterns**\n- **Clean Architecture** with clear separation of concerns\n- **CQRS (Command Query Responsibility Segregation)** for optimal read/write operations\n- **Event-Driven Architecture** with real-time synchronization\n- **Domain-Driven Design (DDD)** principles\n- **Repository Pattern** with Unit of Work\n- **Mediator Pattern** using MediatR\n- **Specification Pattern** for complex queries\n\n### 🚀 **Technology Stack**\n- **.NET 9** - Latest framework with performance improvements\n- **Entity Framework Core 9** - Advanced ORM with change tracking\n- **PostgreSQL** - Primary database for ACID transactions\n- **Elasticsearch** - High-performance search and analytics\n- **Redis** - Distributed caching and session management\n- **RabbitMQ** - Message broker for event-driven communication\n- **AutoMapper** - Object-to-object mapping\n- **FluentValidation** - Input validation with fluent interface\n- **Serilog** - Structured logging with multiple sinks\n\n### 🔧 **Advanced Features**\n- **Real-time Stock Management** with event synchronization\n- **Advanced Product Search** with faceted filtering\n- **Distributed Caching** with Redis\n- **Health Checks** for all services\n- **API Versioning** with backward compatibility\n- **Comprehensive Logging** with correlation IDs\n- **Exception Handling** with global middleware\n- **Performance Monitoring** with custom metrics\n- **Swagger/OpenAPI** documentation\n\n---\n\n## 📊 **System Architecture**\n\n```mermaid\ngraph TB\n    subgraph \"Presentation Layer\"\n        API[Web API Controllers]\n        MW[Middleware Pipeline]\n    end\n    \n    subgraph \"Application Layer\"\n        MED[MediatR]\n        CMD[Commands]\n        QRY[Queries]\n        VAL[Validators]\n        BEH[Behaviors]\n    end\n    \n    subgraph \"Domain Layer\"\n        ENT[Entities]\n        VO[Value Objects]\n        AGG[Aggregates]\n        DOM[Domain Services]\n    end\n    \n    subgraph \"Infrastructure Layer\"\n        REPO[Repositories]\n        CACHE[Cache Service]\n        MSG[Message Bus]\n        EXT[External Services]\n    end\n    \n    subgraph \"Data Stores\"\n        PG[(PostgreSQL)]\n        ES[(Elasticsearch)]\n        RD[(Redis)]\n        RMQ[RabbitMQ]\n    end\n    \n    API --\u003e MW\n    MW --\u003e MED\n    MED --\u003e CMD\n    MED --\u003e QRY\n    CMD --\u003e VAL\n    QRY --\u003e VAL\n    VAL --\u003e BEH\n    BEH --\u003e DOM\n    DOM --\u003e ENT\n    DOM --\u003e REPO\n    REPO --\u003e PG\n    CACHE --\u003e RD\n    MSG --\u003e RMQ\n    EXT --\u003e ES\n```\n\n---\n\n## 🗄️ **Database Schema**\n\n```mermaid\nerDiagram\n    CUSTOMERS {\n        uuid id PK\n        string email UK\n        string first_name\n        string last_name\n        string phone\n        timestamp created_at\n        timestamp updated_at\n        boolean is_active\n    }\n    \n    CUSTOMER_ADDRESSES {\n        uuid id PK\n        uuid customer_id FK\n        string address_line1\n        string address_line2\n        string city\n        string state\n        string postal_code\n        string country\n        boolean is_default\n        timestamp created_at\n    }\n    \n    CATEGORIES {\n        uuid id PK\n        string name UK\n        string description\n        uuid parent_category_id FK\n        int level\n        boolean is_active\n        timestamp created_at\n        timestamp updated_at\n    }\n    \n    PRODUCTS {\n        uuid id PK\n        string name\n        string description\n        string sku UK\n        decimal price\n        string currency\n        int stock_quantity\n        int minimum_stock_level\n        uuid category_id FK\n        boolean is_active\n        boolean is_featured\n        decimal average_rating\n        int review_count\n        timestamp created_at\n        timestamp updated_at\n    }\n    \n    PRODUCT_REVIEWS {\n        uuid id PK\n        uuid product_id FK\n        uuid customer_id FK\n        int rating\n        string comment\n        timestamp created_at\n    }\n    \n    ORDERS {\n        uuid id PK\n        string order_number UK\n        uuid customer_id FK\n        string status\n        decimal total_amount\n        string currency\n        string shipping_address\n        string billing_address\n        timestamp created_at\n        timestamp updated_at\n    }\n    \n    ORDER_ITEMS {\n        uuid id PK\n        uuid order_id FK\n        uuid product_id FK\n        string product_name\n        int quantity\n        decimal unit_price\n        string currency\n        decimal total_price\n    }\n    \n    STOCK_MOVEMENTS {\n        uuid id PK\n        uuid product_id FK\n        int quantity_change\n        string movement_type\n        string reason\n        int stock_after_movement\n        timestamp created_at\n    }\n    \n    CUSTOMERS ||--o{ CUSTOMER_ADDRESSES : has\n    CUSTOMERS ||--o{ PRODUCT_REVIEWS : writes\n    CUSTOMERS ||--o{ ORDERS : places\n    CATEGORIES ||--o{ CATEGORIES : contains\n    CATEGORIES ||--o{ PRODUCTS : categorizes\n    PRODUCTS ||--o{ PRODUCT_REVIEWS : receives\n    PRODUCTS ||--o{ ORDER_ITEMS : included_in\n    PRODUCTS ||--o{ STOCK_MOVEMENTS : tracks\n    ORDERS ||--o{ ORDER_ITEMS : contains\n```\n\n---\n\n## 🔄 **Event-Driven Workflow**\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant API\n    participant MediatR\n    participant Handler\n    participant Repository\n    participant EventBus\n    participant Elasticsearch\n    participant Cache\n    \n    Client-\u003e\u003eAPI: POST /api/v1/orders\n    API-\u003e\u003eMediatR: PlaceOrderCommand\n    MediatR-\u003e\u003eHandler: Handle Command\n    \n    Handler-\u003e\u003eRepository: Get Product\n    Repository--\u003e\u003eHandler: Product Data\n    \n    Handler-\u003e\u003eRepository: Update Stock\n    Repository-\u003e\u003eEventBus: ProductStockUpdatedEvent\n    \n    EventBus-\u003e\u003eElasticsearch: Sync Stock Data\n    EventBus-\u003e\u003eCache: Invalidate Cache\n    \n    Handler-\u003e\u003eRepository: Create Order\n    Repository--\u003e\u003eHandler: Order Created\n    \n    Handler--\u003e\u003eMediatR: Success Response\n    MediatR--\u003e\u003eAPI: Order DTO\n    API--\u003e\u003eClient: 201 Created\n    \n    Note over EventBus: Asynchronous Processing\n    EventBus-\u003e\u003eElasticsearch: Update Search Index\n    EventBus-\u003e\u003eCache: Update Product Cache\n```\n\n---\n\n## 🚀 **Quick Start**\n\n### Prerequisites\n- .NET 9 SDK\n- PostgreSQL 16+\n- Elasticsearch 8.0+\n- Redis 7.0+\n- RabbitMQ 3.12+\n- Docker (optional)\n\n### 1. Clone Repository\n```bash\ngit clone https://github.com/Yemresalcan/ecommerce-api.git\ncd ecommerce-api\n```\n\n### 2. Setup Infrastructure (Docker)\n```bash\ndocker-compose up -d postgres elasticsearch redis rabbitmq\n```\n\n### 3. Configure Application\n```bash\ncp src/Presentation/ECommerce.WebAPI/appsettings.example.json src/Presentation/ECommerce.WebAPI/appsettings.json\n# Edit connection strings and configurations\n```\n\n### 4. Run Migrations\n```bash\ndotnet ef database update --project src/Infrastructure/ECommerce.Infrastructure --startup-project src/Presentation/ECommerce.WebAPI\n```\n\n### 5. Start Application\n```bash\ndotnet run --project src/Presentation/ECommerce.WebAPI\n```\n\n### 6. Access API\n- **Swagger UI**: http://localhost:8080/swagger\n- **Health Checks**: http://localhost:8080/health\n- **API Base**: http://localhost:8080/api/v1\n\n---\n\n## 📁 **Project Structure**\n\n```\nsrc/\n├── Core/\n│   ├── ECommerce.Domain/           # Domain entities, value objects, aggregates\n│   └── ECommerce.Application/      # Use cases, DTOs, interfaces\n├── Infrastructure/\n│   ├── ECommerce.Infrastructure/   # Data access, external services\n│   └── ECommerce.ReadModel/        # Elasticsearch, read-side queries\n└── Presentation/\n    └── ECommerce.WebAPI/           # Controllers, middleware, configuration\n\ntests/\n├── ECommerce.Domain.Tests/         # Domain unit tests\n├── ECommerce.Application.Tests/    # Application unit tests\n├── ECommerce.Infrastructure.Tests/ # Infrastructure unit tests\n└── ECommerce.WebAPI.Tests/         # Integration tests\n```\n\n---\n\n## 🔧 **Configuration**\n\n### Database Configuration\n```json\n{\n  \"ConnectionStrings\": {\n    \"DefaultConnection\": \"Host=localhost;Database=ecommerce;Username=postgres;Password=password\"\n  }\n}\n```\n\n### Elasticsearch Configuration\n```json\n{\n  \"Elasticsearch\": {\n    \"Uri\": \"http://localhost:9200\",\n    \"IndexPrefix\": \"ecommerce\",\n    \"Username\": \"\",\n    \"Password\": \"\"\n  }\n}\n```\n\n### Redis Configuration\n```json\n{\n  \"ConnectionStrings\": {\n    \"Redis\": \"localhost:6379\"\n  }\n}\n```\n\n---\n\n## 📊 **Live Monitoring Screenshots**\n\n### 🎯 **Grafana Dashboard - Real-time System Monitoring**\n![Grafana Dashboard](assets/grafana.png)\n*Professional monitoring dashboard showing CPU, Memory, Network, and Disk metrics in real-time*\n\n### 📈 **Prometheus Metrics Collection**\n![Prometheus Targets](assets/prometeus.png)\n*Prometheus successfully collecting metrics from all monitoring targets*\n\n### 🐳 **Container Monitoring with cAdvisor**\n![cAdvisor Container Monitoring](assets/cAdvisor.png)\n*Detailed container resource usage and performance metrics*\n\n### 🛠️ **Container Management with Portainer**\n![Portainer Dashboard](assets/portanier.png)\n*Professional container management interface for Docker environments*\n\n### 🐰 **Message Queue Monitoring**\n![RabbitMQ Management](assets/rabitmq.png)\n*RabbitMQ management interface showing queue status and message flow*\n\n### 🛒 **E-Commerce API Documentation**\n![API Documentation](assets/api_screenshot.png)\n*Comprehensive Swagger/OpenAPI documentation with interactive testing*\n\n## 📊 **Performance Metrics**\n\n| Endpoint | Avg Response Time | Throughput |\n|----------|------------------|------------|\n| GET /products | 45ms | 2,000 req/s |\n| POST /orders | 120ms | 500 req/s |\n| GET /orders/{id} | 25ms | 3,000 req/s |\n| GET /search | 80ms | 1,200 req/s |\n\n---\n\n## 🧪 **Testing**\n\n### Run Unit Tests\n```bash\ndotnet test tests/ECommerce.Domain.Tests/\ndotnet test tests/ECommerce.Application.Tests/\n```\n\n### Run Integration Tests\n```bash\ndotnet test tests/ECommerce.WebAPI.Tests/\n```\n\n### Test Coverage\n```bash\ndotnet test --collect:\"XPlat Code Coverage\"\n```\n\n---\n\n## 📈 **Monitoring \u0026 Observability**\n\n### Health Checks\n- Database connectivity\n- Elasticsearch cluster health\n- Redis availability\n- RabbitMQ connection\n- External service dependencies\n\n### Logging\n- Structured logging with Serilog\n- Correlation IDs for request tracking\n- Performance metrics\n- Error tracking and alerting\n\n### Metrics\n- Request/response times\n- Database query performance\n- Cache hit/miss ratios\n- Event processing metrics\n\n---\n\n## 🔒 **Security Features**\n\n- Input validation with FluentValidation\n- SQL injection prevention with parameterized queries\n- XSS protection with output encoding\n- CORS configuration\n- Rate limiting\n- API versioning\n- Health check security\n\n---\n\n## 🚀 **Deployment**\n\n### Docker Deployment\n```bash\ndocker build -t ecommerce-api .\ndocker run -p 8080:8080 ecommerce-api\n```\n\n### Kubernetes Deployment\n```bash\nkubectl apply -f k8s/\n```\n\n### CI/CD Pipeline\n- GitHub Actions workflow\n- Automated testing\n- Docker image building\n- Deployment to staging/production\n\n---\n\n## 🤝 **Contributing**\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n---\n\n## 📄 **License**\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 👨‍💻 **Author**\n\n**Your Name**\n- GitHub: [@Yemresalcan](https://github.com/Yemresalcan)\n- LinkedIn: [Yunusemresalcan](https://linkedin.com/in/yunusemresalcan)\n- Email: yunusemresalcan@gmail.com\n\n---\n\n## 🙏 **Acknowledgments**\n\n- Clean Architecture by Robert C. Martin\n- Domain-Driven Design by Eric Evans\n- Microsoft .NET Documentation\n- Elasticsearch Documentation\n- Redis Documentation\n\n---\n\n## 📚 **Additional Resources**\n\n- [API Documentation](docs/api.md)\n- [Architecture Decision Records](docs/adr/)\n- [Deployment Guide](docs/deployment.md)\n- [Contributing Guidelines](CONTRIBUTING.md)\n- [Code of Conduct](CODE_OF_CONDUCT.md)\n\n---\n\n## 🎯 **Production Screenshots Gallery**\n\n\u003cdiv align=\"center\"\u003e\n\n| Monitoring Dashboard | Container Management | API Documentation |\n|:---:|:---:|:---:|\n| ![Grafana](assets/grafana.png) | ![Portainer](assets/portanier.png) | ![API Docs](assets/api_screenshot.png) |\n| **Real-time Metrics** | **Container Control** | **Interactive API** |\n\n| System Health | Message Queue | Container Analytics |\n|:---:|:---:|:---:|\n| ![Prometheus](assets/prometeus.png) | ![RabbitMQ](assets/rabitmq.png) | ![cAdvisor](assets/cAdvisor.png) |\n| **Target Monitoring** | **Queue Management** | **Resource Analytics** |\n\n\u003c/div\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**⭐ If you found this project helpful, please give it a star! ⭐**\n\n**🚀 Ready for Production • 📊 Enterprise Monitoring • 🛒 Scalable E-Commerce**\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyemresalcan%2Fe-commerceapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyemresalcan%2Fe-commerceapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyemresalcan%2Fe-commerceapi/lists"}