{"id":24993877,"url":"https://github.com/datarohit/order-management-system","last_synced_at":"2025-03-29T13:43:52.079Z","repository":{"id":275407883,"uuid":"925935956","full_name":"DataRohit/Order-Management-System","owner":"DataRohit","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-02T09:25:56.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T10:25:07.602Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/DataRohit.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}},"created_at":"2025-02-02T05:31:02.000Z","updated_at":"2025-02-02T09:25:59.000Z","dependencies_parsed_at":"2025-02-02T10:25:15.511Z","dependency_job_id":"11213ddd-4af8-4536-80ab-6cbebb5a573e","html_url":"https://github.com/DataRohit/Order-Management-System","commit_stats":null,"previous_names":["datarohit/order-management-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FOrder-Management-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FOrder-Management-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FOrder-Management-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataRohit%2FOrder-Management-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataRohit","download_url":"https://codeload.github.com/DataRohit/Order-Management-System/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237134413,"owners_count":19260655,"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":[],"created_at":"2025-02-04T14:36:58.300Z","updated_at":"2025-03-29T13:43:52.068Z","avatar_url":"https://github.com/DataRohit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Order Management System 🚀🛒\n\n## Project Overview 📝\n\nThis Order Management System is a microservices-based application ⚙️ designed to streamline e-commerce operations. It focuses on efficiently managing products 📦, inventory Stock📈, orders 🛍️, and payments 💳. The system is built with user authentication 🔑, supporting both vendor 🧑‍💼 and customer 🧑‍🧑‍🤝‍🧑 roles. It leverages asynchronous task processing ⏱️ for improved performance and scalability ☁️. Designed to be cloud-native 🌐, it utilizes Docker 🐳 for containerization and Consul 🧭 for service discovery.\n\n## Services 🧩\n\nThe system is composed of distinct microservices, each handling a specific domain:\n\n*   **Gateway Service 🚪**:\n    *   Serves as the single entry point for all external API requests 🚦.\n    *   Manages HTTP routing using Gin 🛤️.\n    *   Enforces authentication and authorization via middleware 🛡️.\n    *   Implements rate limiting using Redis to ensure API stability ⏳.\n    *   Provides comprehensive API documentation with Swagger 📚.\n    *   Communicates with backend services using gRPC 🗣️.\n\n*   **Auth Service 🛡️**:\n    *   Handles all aspects of user authentication and authorization 🔑.\n    *   Manages user registration 📝, login ✅, logout 🚪, and secure password management (resetting and forgotten passwords 🔄).\n    *   Generates and rigorously verifies JWT tokens for both access and refresh tokens 🗝️.\n    *   Manages distinct user roles: customer and vendor 🧑‍💼🧑‍🧑‍🤝‍🧑.\n    *   Persistently stores user data in MongoDB 💾.\n    *   Publishes critical user-related events to RabbitMQ for asynchronous processing (e.g., user registration, account activation, password resets ✉️).\n\n*   **Product Service 📦**:\n    *   Manages the entire product catalog and detailed product information ℹ️.\n    *   Empowers vendors to create ➕, update ✏️, delete 🗑️, and list products 📜.\n    *   Stores all product-related information in MongoDB 💾.\n    *   Dispatches product-related events via RabbitMQ (e.g., product creation, updates, deletions 📢).\n\n*   **Inventory Service Stock📈**:\n    *   Precisely manages product inventory levels 📊.\n    *   Enables vendors to efficiently create ➕, update ✏️, delete 🗑️, and retrieve inventory details for their products 📦.\n    *   Stores inventory data securely in MongoDB 💾.\n\n*   **Order Service 🛍️**:\n    *   Oversees the complete order lifecycle: creation ➕, retrieval 🔍, and cancellation ❌.\n    *   Calculates order totals accurately and manages order statuses effectively 🔄.\n    *   Stores comprehensive order information in MongoDB 💾.\n    *   Broadcasts order-related events using RabbitMQ (e.g., order creation, cancellation, successful payments 📢).\n\n*   **Payment Service 💳**:\n    *   Facilitates secure payment processing using Stripe 💰.\n    *   Generates unique payment links for each order 🔗.\n    *   Processes real-time webhook events from Stripe for immediate payment confirmations and notifications of failures 📞.\n    *   Interacts with Auth, Product, and Order services via high-performance gRPC 🗣️.\n    *   Subscribes to relevant order and product events from RabbitMQ to orchestrate payment workflows and maintain data synchronization with Stripe 🔄.\n    *   Sends timely email notifications for order confirmations and cancellations through the Mailer service ✉️.\n\n*   **Mailer Service ✉️**:\n    *   Dedicated to sending emails for crucial events: user registration, account activation, password resets, and order confirmations 📧.\n    *   Utilizes Mailpit for efficient local email testing and SMTP for reliable real email delivery 🧪➡️📤.\n    *   Subscribes to user-related events from RabbitMQ to trigger automated email sending processes 📬.\n\n## Functionalities ✨\n\nThe Order Management System is packed with features, including:\n\n*   **User Authentication and Authorization 🔑**:\n    *   Streamlined user registration and secure account activation via email verification 📧✅.\n    *   Secure user login and logout with JWT-based authentication 🔐🚪.\n    *   Role-Based Access Control (RBAC) to manage permissions for customers and vendors 🧑‍💼🧑‍🧑‍🤝‍🧑.\n    *   Password recovery and reset functionalities for account security 🔄.\n    *   Refresh token mechanism for seamless access token renewal and persistent sessions 🔄.\n\n*   **Product Management 📦**:\n    *   Vendors can easily add new products with comprehensive details: name, description, category, and price ➕.\n    *   Vendors have full control to update and remove their listed products ✏️🗑️.\n    *   Vendors can efficiently list and manage their product offerings with pagination support 📜➡️.\n\n*   **Inventory Management Stock📈**:\n    *   Vendors can precisely control inventory levels, setting available and threshold quantities for each product 📊.\n    *   Real-time inventory updates triggered by order placements and cancellations ensure accuracy 🔄.\n\n*   **Order Management 🛍️**:\n    *   Customers can create orders with multiple items, potentially from various vendors, in a single transaction 🛒.\n    *   Orders are initiated in a \"pending\" status and transition to \"paid\" upon successful payment processing ⏳➡️✅.\n    *   Customers can conveniently view their order details and cancel orders that are still pending 🔍❌.\n    *   Unique payment links are dynamically generated for each order using Stripe for secure checkout 🔗💳.\n    *   Real-time webhook handling for Stripe payment events ensures immediate order status updates and accurate records 📞🔄.\n\n*   **Payment Processing 💳**:\n    *   Seamless integration with Stripe for secure and reliable payment processing 🤝💰.\n    *   Automated generation of Stripe Payment Links simplifies the checkout process for customers 🔗.\n    *   Robust handling of Stripe webhook events keeps order statuses synchronized with payment events 📞🔄.\n    *   Supports order cancellations and efficient payment refunds when necessary ❌↩️.\n\n*   **Email Services ✉️**:\n    *   Automated email notifications for user registration and account activation guide new users 📧✅.\n    *   Password reset email functionality ensures users can recover access to their accounts securely 📧🔄.\n    *   Order confirmation and cancellation emails keep customers informed about their transactions 📧🛍️❌.\n\n*   **Monitoring and Tracing 🔭**:\n    *   Distributed tracing with Jaeger provides deep insights into request flows across all services, aiding in monitoring and debugging 🔍.\n    *   Centralized logging across all services using Logrus for efficient issue tracking and system analysis 🪵.\n    *   Health check endpoints for every service enable proactive monitoring and ensure system health 🩺.\n\n*   **Service Discovery and Configuration 🧭**:\n    *   Consul facilitates dynamic service registration and discovery, enabling services to locate and communicate with each other automatically 📍🗣️.\n    *   Environment variable-based configuration ensures flexibility and easy deployment across different environments ⚙️.\n\n*   **API Security and Rate Limiting 🛡️⏳**:\n    *   JWT-based authentication secures all API endpoints, protecting against unauthorized access 🔑.\n    *   Rate limiting middleware in the Gateway service safeguards against abuse and ensures fair usage 🚦.\n\n*   **API Documentation 📚**:\n    *   Swagger documentation for the Gateway API provides interactive, up-to-date API exploration and integration resources for developers 📖.\n\n\n## Docker Setup 🐳\n\nTo run the Order Management System using Docker Compose, ensure you have Docker and Docker Compose installed on your machine.\n\n1.  **Clone the repository:**\n\n    ```bash\n    git clone \u003crepository_url\u003e\n    cd \u003crepository_directory\u003e\n    ```\n\n2.  **Environment Variables:**\n\n    *   Ensure you have configured all necessary environment variables. Example `.env` files are provided in each service directory (e.g., `.envs/auth/.env.example`).\n    *   Copy `.env.example` files to `.env` and modify the values as needed for your setup.\n    *   Pay special attention to database connection strings, RabbitMQ and Redis URIs, Stripe secrets, and JWT secrets.\n\n3.  **Start the services with Docker Compose:**\n\n    ```bash\n    docker-compose up --build -d\n    ```\n\n    This command builds all the Docker images and starts all services in detached mode.\n\n4.  **Access the applications:**\n\n    *   **Gateway Service \u0026 Swagger UI**:  `http://localhost:8080/api/v1/swagger/index.html`\n    *   **Mailpit UI**: `http://localhost:8025`\n    *   **RabbitMQ Management UI**: `http://localhost:15672` (default credentials are `guest:guest`)\n    *   **Jaeger UI**: `http://localhost:16686`\n    *   **Consul UI**: `http://localhost:8500`\n    *   **mongo-express UI**: `http://localhost:8081`\n\n5.  **Stop the services:**\n\n    ```bash\n    docker-compose down\n    ```\n\n## Tech Stack 🛠️\n\n*   **Backend Services**: Go \n*   **API Gateway Framework**: Gin \n*   **Inter-service Communication**: gRPC \n*   **Message Broker**: RabbitMQ \n*   **In-memory Data Store**: Redis \n*   **Database**: MongoDB \n*   **Payment Processing**: Stripe \n*   **Service Discovery**: Consul \n*   **Distributed Tracing**: Jaeger \n*   **Email Testing**: Mailpit \n*   **Containerization**: Docker\n\n## License \u0026 Contributing 📜🧑‍🤝‍🧑\n\n### License 📄\n\nThis project is licensed under the MIT License - see the [LICENSE](license) file for details.\n\n### Contributing 🧑‍🤝‍🧑\n\nContributions are welcome! Please feel free to submit pull requests, report issues, or suggest new features to improve Gopher Social Backend.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Forder-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatarohit%2Forder-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatarohit%2Forder-management-system/lists"}