{"id":29180481,"url":"https://github.com/adityapatel1010/distributed-order-processing","last_synced_at":"2025-07-01T20:00:24.815Z","repository":{"id":301423767,"uuid":"1008935221","full_name":"adityapatel1010/Distributed-Order-Processing","owner":"adityapatel1010","description":"Microservices-based backend with async order processing via Redis, MySQL storage, and gRPC updates between Node.js and Go services.","archived":false,"fork":false,"pushed_at":"2025-06-26T19:32:23.000Z","size":9861,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T20:29:08.932Z","etag":null,"topics":["async","distributed-systems","docker","golang","grpc","message-queue","microservices","mysql","nodejs","redis","restful-api"],"latest_commit_sha":null,"homepage":"","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/adityapatel1010.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}},"created_at":"2025-06-26T10:14:44.000Z","updated_at":"2025-06-26T19:32:27.000Z","dependencies_parsed_at":"2025-06-26T20:39:59.200Z","dependency_job_id":null,"html_url":"https://github.com/adityapatel1010/Distributed-Order-Processing","commit_stats":null,"previous_names":["adityapatel1010/distributed-order-processing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adityapatel1010/Distributed-Order-Processing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityapatel1010%2FDistributed-Order-Processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityapatel1010%2FDistributed-Order-Processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityapatel1010%2FDistributed-Order-Processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityapatel1010%2FDistributed-Order-Processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityapatel1010","download_url":"https://codeload.github.com/adityapatel1010/Distributed-Order-Processing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityapatel1010%2FDistributed-Order-Processing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263029211,"owners_count":23402354,"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","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":["async","distributed-systems","docker","golang","grpc","message-queue","microservices","mysql","nodejs","redis","restful-api"],"created_at":"2025-07-01T20:00:20.633Z","updated_at":"2025-07-01T20:00:24.751Z","avatar_url":"https://github.com/adityapatel1010.png","language":"JavaScript","readme":"# Distributed Order Processing System\n\n## Overview\n\nThis project simulates an **e-commerce-style distributed system** that decouples order creation, processing, and status management. Using Redis as a queue, orders are processed asynchronously by a Go service, with inter-service communication via gRPC to ensure scalable, event-driven architecture.\n\n---\n\n## Impact\n\n* Mimics **real-world backend systems** used in online marketplaces and retail platforms.\n* Demonstrates **asynchronous communication and processing** using a message queue (Redis).\n* Provides hands-on understanding of **gRPC**, microservices, and inter-language service orchestration (Node.js ↔ Go).\n* Highlights efficient **status transition workflows** (`pending` → `processing` → `completed`) in distributed environments.\n\n---\n\n## Functionalities\n\n* **Create Orders** via REST API (`POST /orders`)\n* **Push to Redis Queue** with essential data (`orderId`, `quantity`)\n* **Process Orders** asynchronously using Go service\n* **Update Status via gRPC** to `processing` and later `completed`\n* **View All Orders** using REST (`GET /orders`)\n* **MySQL Persistence** for order lifecycle tracking\n\n---\n\n## Technologies Used\n\n| Category         | Technology             |\n| ---------------- | ---------------------- |\n| API Layer        | Node.js, Express       |\n| Database         | MySQL                  |\n| Message Queue            | Redis          |\n| Worker Service   | Go                     |\n| Communication    | gRPC, RESTful|\n| Containerization | Docker |\n\n---\n\n## Highlights\n\n* Asynchronous queue-based processing with Redis\n* Microservice architecture: loose coupling and high cohesion\n* Language-agnostic gRPC interface between Go and Node.js\n* Sequelize `sync()` ensures schema alignment without migrations\n* Retries and health checks ensure robust startup via Docker Compose\n* Modular codebase with separation of concerns (controllers, models, services)\n\n---\n\n## Commands to Run the Project\n\n\u003e Make sure Docker and Docker Compose are installed.\n\n```bash\n# Step 1: Clone the repo\ngit clone https://github.com/your-username/distributed-order-system.git\ncd distributed-order-system\n\n# Step 2: Start all services\ndocker-compose up --build\n```\n\nYou should see:\n\n* REST API on [http://localhost:3000](http://localhost:3000)\n* gRPC running on port `50051`\n\n---\n\n## Output Screenshots\n\n### Order Created\n\u003cimg src=\"./imgs/createOrder.png\" alt=\"Order Created\" width=\"500\"/\u003e\n\n### Fetch Orders\n![Fetch All Orders](./imgs/fetchOrder.png)\n\n### Output Logs\n![Output Logs](./imgs/outputLog.png)\n\n---\n\n## Sample Commands\n\n### Create an Order\n\n```bash\ncurl -X POST http://localhost:3000/orders \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"item\": \"Laptop\",\n    \"quantity\": 2,\n    \"price\": 1299.99\n  }'\n```\n\n### Get All Orders\n\n```bash\ncurl http://localhost:3000/orders\n```\n\n---\n\n## Notes\n\n* The Redis queue only stores `orderId` and `quantity` for efficiency.\n* Statuses (`pending`, `processing`, `completed`) are updated in MySQL through Sequelize.\n* gRPC services are defined in `.proto` files and loaded using `@grpc/proto-loader`.\n* Retry mechanisms ensure the Node service waits for MySQL and Redis before starting.\n* The system is extensible to include features like email notifications, billing, etc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityapatel1010%2Fdistributed-order-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityapatel1010%2Fdistributed-order-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityapatel1010%2Fdistributed-order-processing/lists"}