{"id":28840639,"url":"https://github.com/maron09/ecommerce-microservice","last_synced_at":"2026-06-09T16:32:04.245Z","repository":{"id":298583119,"uuid":"999829311","full_name":"Maron09/Ecommerce-Microservice","owner":"Maron09","description":null,"archived":false,"fork":false,"pushed_at":"2025-11-09T15:00:56.000Z","size":352,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"dev","last_synced_at":"2025-11-09T16:09:47.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Maron09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-10T21:15:13.000Z","updated_at":"2025-11-09T15:01:00.000Z","dependencies_parsed_at":"2025-06-11T21:52:28.496Z","dependency_job_id":"ce46bff3-9c0e-46c1-b8ea-1addf1631972","html_url":"https://github.com/Maron09/Ecommerce-Microservice","commit_stats":null,"previous_names":["maron09/ecommerce-microservice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Maron09/Ecommerce-Microservice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maron09%2FEcommerce-Microservice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maron09%2FEcommerce-Microservice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maron09%2FEcommerce-Microservice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maron09%2FEcommerce-Microservice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Maron09","download_url":"https://codeload.github.com/Maron09/Ecommerce-Microservice/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Maron09%2FEcommerce-Microservice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34116457,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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-06-19T15:09:52.807Z","updated_at":"2026-06-09T16:32:04.240Z","avatar_url":"https://github.com/Maron09.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ E-Commerce Microservices System\n\nA **scalable, event-driven e-commerce platform** built with a microservices architecture using **Node.js**, **Express**, **MongoDB**, **RabbitMQ**, and **Paystack** for payments.  \nThis project showcases a distributed system design where independent services handle different business domains — enabling better scalability, maintainability, and fault isolation.\n\n---\n\n## 🚀 Overview\n\nThis system demonstrates a modular e-commerce backend, where each service operates independently and communicates asynchronously through **RabbitMQ**.  \nIt’s designed for portfolio and production-level demonstration — combining clean code practices, microservice patterns, and real payment integration.\n\n---\n\n## 🧩 Services Breakdown\n\n| Service | Description |\n|----------|-------------|\n| **API Gateway** | Central entry point. Handles routing, authentication, and request forwarding to respective services. |\n| **Auth Service** | Manages user registration, login, JWT authentication, and role-based access control (customer, vendor, admin). |\n| **Customer Service** | Handles customer profile, preferences, and order history. |\n| **Vendor Service** | Manages vendor registration, store setup, and payout configurations (including Paystack subaccounts). |\n| **Cart Service** | Handles cart creation, item addition/removal, and cart persistence per customer session. |\n| **Order Service** | Coordinates order creation, status updates, and fulfillment workflows. |\n| **Product Service** | Manages product listing, stock updates, categories, and vendor associations. |\n| **Inventory Service** | Tracks product stock levels and updates them based on order activity. |\n| **Payment Service** | Integrates with **Paystack** for secure transactions and automatic vendor payment splits. |\n| **Notification Service** | Sends real-time notifications (email/SMS) for order confirmations, payment updates, and vendor alerts. |\n| **Admin Service** | Provides administrative controls for monitoring, approving vendors, and managing platform data. |\n\n---\n\n## 🧠 Architecture\n\nThe project is designed around **microservice principles**:\n\n- 🕸 **Event-driven communication** via **RabbitMQ**\n- 🧱 **Independent MongoDB databases** for each service\n- 🔐 **JWT-based Authentication** (managed by the Auth Service)\n- 💳 **Paystack Integration** for real payments and vendor split handling\n- ⚙️ **API Gateway** for unified request management\n- 💬 **Asynchronous messaging** for decoupled service interactions\n- 🧩 **Scalable microservices** that can run separately or as a cluster\n\n---\n\n## 📦 Tech Stack\n\n| Category | Technology |\n|-----------|-------------|\n| **Language** | Node.js (ES Modules) |\n| **Framework** | Express.js |\n| **Database** | MongoDB (Mongoose ODM) |\n| **Message Broker** | RabbitMQ |\n| **Payment Integration** | Paystack |\n| **Authentication** | JWT |\n| **Logging** | Winston-based logger |\n| **Containerization (optional)** | Docker \u0026 Docker Compose |\n\n---\n\n## 💳 Payment Flow (Paystack Integration)\n\n1. **Customer places an order** via the API Gateway.  \n2. The **Order Service** creates the order and publishes a message to RabbitMQ.  \n3. The **Payment Service** initializes a Paystack transaction with split details for vendors.  \n4. Upon successful payment, Paystack calls the **/verify** endpoint.  \n5. The **Payment Service** verifies the transaction, updates the order via the **Order Service**, and publishes a payment completion event.  \n6. **Notification Service** informs the customer and vendor of the payment status.\n\n---\n\n## 📨 RabbitMQ Message Flow\n\n| Event | Publisher | Subscriber(s) | Description |\n|--------|------------|---------------|--------------|\n| `order.created` | Order Service | Payment, Inventory | Triggered when an order is created. |\n| `payment.completed` | Payment Service | Order, Notification | Triggered when a payment is verified. |\n| `inventory.updated` | Inventory Service | Order | Adjusts stock levels after successful order. |\n| `vendor.payout` | Payment Service | Vendor | Handles Paystack vendor split confirmation. |\n\n---\n\n## 🗂️ Directory Structure (Example)\n\necommerce-microservices/\n│\n├── api-gateway/\n│ ├── routes/\n│ ├── middlewares/\n│ └── server.js\n│\n│ ├── auth/\n│ ├── cart/\n│ ├── customer/\n│ ├── vendor/\n│ ├── order/\n│ ├── product/\n│ ├── inventory/\n│ ├── payments/\n│ ├── notification/\n│ └── admin/\n│\n│\n└── README.md\n\n\n```bash\ngit clone https://github.com/maron09/Ecommerce-Microservice.git\ncd ecommerce-microservices\n```\n```bash\nnpm install\n```\n## Each service has its own .env file. Example for Payment Service: \n- PORT=5007\n- MONGO_URI=mongodb://localhost:27017/payment\n- RABBITMQ_URL=amqp://localhost\n- PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxx\n- PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxxxxx\n\n## 🏁 Future Improvements\n1. ✅ Add Analytics to track performance\n\n2. ✅ Integrate Kubernetes for deployment orchestration.\n\n3. ✅ Add unit/integration tests (Jest + Supertest).\n\n\n## 🧑‍💻 Author\n\n**Ezra**\n- Backend Developer (Python, Node.js)\n- Building scalable systems with clean architecture \u0026 efficient APIs.\n\n\n## 🏗️ License\n-  This project is licensed under the MIT License — feel free to use and modify it for learning or production.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaron09%2Fecommerce-microservice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaron09%2Fecommerce-microservice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaron09%2Fecommerce-microservice/lists"}