This repository contains a simple Fruit Store Microservice built with Spring Boot that allows users to manage fruits, place orders, and handle customer operations.
- Java
- Spring Boot
- Spring Data JPA
- H2 Database for Fruit and order service (for demo purposes, can be changed to other databases)
- MYSQL for Customers service
- Maven
- API Gateway & Eureka Service Registry
- Kubernetes and Docker
- Intellij Idea for development, Postman for testing
- Git and GitHub
- Sonarqube, Jenkins & Argo CD
- Deploy to AWS
-
Clone the repository:
git clone https://github.com/sangaryousmane/fruit-store-microservice.git
-
Navigate to project directory
cd fruits-microservice
-
Build each service in the root directory cd fruits-microservice
-
Endpoints
- GET /api/v1/fruits: Retrieve all fruits.
- GET /api/v1/fruits/{id}: Retrieve a specific fruit by ID.
- POST /api/v1/fruits/saveFruit: Add a new fruit.
{ "name": "Mango", "quantity": 10, "price": 1.99 }
- PUT /api/v1/fruits/{id}: Update a specific fruit by ID. Request Body:
{ "name": "Orange", "quantity": 15, "price": 2.49 }
- DELETE /api/v1/fruits/{id}: Delete a specific fruit by ID.
- POST /orders/placeOrder: Place an order. Request Body:
{ "customerId": "customer_id", "fruitIds": [1, 2, 3] }
- Deployment
-
Download terraform and configure on your system https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli
-
Navigate to terraform directory and create a new aws ec2 instance
cd terraform-config terraform init terraform plan terraform apply
-
Push your docker images to docker hub and make changes to the names in your k8s manifests
-
Deploy to kubernetes cluster
cd k8s kubectl apply -f *.yaml minikube dashboard
- Ousmane Sangary - Software Developer