This eCommerce API project provides a scalable backend for managing an eCommerce platform, including user management, product catalog, orders, and payments. It utilizes a microservices architecture with an NGINX API Gateway for request routing and is containerized using Docker for easy deployment. The project also integrates Keploy for testing API functionalities, ensuring reliable responses.
- Microservices: Each major feature (user management, products, orders, etc.) is a separate service.
- API Gateway: An NGINX-based gateway to route requests to the respective microservices.
- Database: MongoDB is used for different microservices.
- Testing: Integrated with Keploy to capture and test API calls for accuracy.
- Programming Languages: Go
- Database: MongoDB
- Containers: Docker
- API Gateway: NGINX
- Testing: Keploy for API testing
- Other Tools: Twilio for notifications, Stripe for Payment
-
Clone the repository:
git clone https://github.com/Harshjosh361/Scalable-Ecommerce.git cd Scalable-Ecommerce
-
Environment Variables: Create a
.env
file for each microservice and add necessary environment variables like database URIs, Twilio credentials, etc. -
Docker Setup: To run individual services, navigate to the respective service folder and run:
cd user-service docker compose up
Or for another service:
cd product-service docker compose up
To run all services together, navigate to the root:
docker compose up
- Starting the Application: Once all services and the API Gateway are up, the application will be accessible via the configured API Gateway port.
- Connecting to Databases: MongoDB database is connected to their respective services via environment variables.
endpoints?
This project uses Keploy for API testing. To run tests:
-
Ensure Keploy is configured in each service’s
keploy.yaml
file. -
recording test case
keploy record -c "docker compose up" --container-name "my-app-container"
-
testing
keploy test -c "docker compose up" --container-name "my-app-container"
Replace my-app-container with the original container name
This project includes a Continuous Integration (CI) and Continuous Deployment (CD) pipeline:
-
Continuous Integration: Automated testing and building are set up to ensure that all code changes are validated before being merged.
-
Continuous Deployment: The project is configured to push the latest Docker images to Docker Hub automatically upon successful builds.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature-branch
). - Commit your changes (
git commit -m "Add feature"
). - Push to your fork (
git push origin feature-branch
). - Open a pull request. https://roadmap.sh/projects/scalable-ecommerce-platform
This project is licensed under the terms of the MIT License.