The Order Service is a microservice within an eCommerce platform that facilitates order management via RESTful APIs. This service is developed using Python, Docker, Flask, and offers endpoints to perform various operations related to orders.
- Order Management: Create, retrieve, update, and delete orders.
- Order Details: Manage order specifics like products, quantities, statuses, and customer information.
- Integration Support: Seamlessly integrates with other microservices for a holistic eCommerce experience.
- Python: Utilized as the primary programming language for development.
- Flask: A micro web framework used for building the RESTful APIs.
- Docker: Containerization for easy deployment and scalability.
- RESTful API: Adherence to REST principles for endpoint design and interaction.
- Python 3.x: Ensure Python is installed.
- Docker: Install Docker for containerization.
-
Clone this repository:
https://github.com/munuhee/order-service.git
-
Navigate to the order service directory:
cd order-service -
Build the Docker container:
docker build -t order-service . -
Run the Docker container:
docker run -p 5000:5000 order-service
-
Access the service at
http://localhost:5000
The service exposes the following endpoints:
- GET /health: Health check endpoint returning a success status.
- POST /orders: Create a new order.
- GET /orders: Retrieve all orders.
- GET /orders/int:order_id: Get details of a specific order by order ID.
- PATCH /orders/int:order_id: Update the status of an order by order ID.
- GET /orders/user/int:user_id: Get orders associated with a specific user.
- DELETE /orders/int:order_id: Cancel an order by order ID.
- GET /orders/status/string:status: Get orders by their status.
- GET /orders/int:order_id/items: Get all order items for a specific order.
- Utilize any HTTP client (e.g., cURL, Postman) to interact with the endpoints provided by the Order Service.
- Ensure proper authentication and authorization mechanisms are in place for secure access.
- Adjust environment variables or settings in the
config.pyor.envfile for database connections, authentication details, or any service-specific configurations.
- Contributions, suggestions, or bug reports are highly appreciated! Feel free to open issues or pull requests for improvements.