EasyMed is a microservices-based application designed for managing medicine orders. Built with Spring Boot, Spring Cloud, and React, it demonstrates end-to-end service discovery, inter-service communication via Feign Clients, dynamic persistence with MySQL, and a simple frontend interface.
The entire project is fully containerized with Docker Compose deployment.
[ React UI Client ] (Port 3000)
│
│ HTTP (REST API calls)
▼
[ Consumer Service ] (Port 8090)
│
│ Service Discovery & Load Balancing (Feign Client)
├───► [ Eureka Server ] (Port 8080)
│
│ HTTP Routing via Registered Service Name
▼
[ Producer Service ] (Port 8085)
│
│ Spring Data JPA / Hibernate
▼
[ MySQL Database ] (Port 3306)
- Service Discovery: Uses Netflix Eureka Server for microservice registration and discovery.
- Inter-Service Communication: Employs Spring Cloud OpenFeign inside the Consumer service to communicate dynamically with the Producer without hardcoded URLs.
- Data Persistence: Uses Spring Data JPA with MySQL database backend for CRUD operations.
- Single-Page React UI: Clean, simple React interface utilizing state hooks and Axios for easy interactions.
- One-Command Deployment: Docker Compose orchestration allows spinning up the database, registry, microservices, and frontend in one step.
- Frontend: React.js, Axios, HTML5/CSS3
- Backend: Java 21, Spring Boot, Spring Cloud (Eureka, OpenFeign), Spring Data JPA
- Database: MySQL 8.0
- DevOps & Containerization: Docker, Docker Compose
- Documentation: Now supported with swagger-ui documentation for easy visualtization of API endpoints :)
Ensure you have the following installed on your machine:
- Clone the repository:
git clone https://github.com/pgit80/easyMed.git
cd easyMed
``
2. **Build the JAR files for all Java services:**
```bash
mvn clean package -DskipTests
- Start the application with Docker Compose:
docker-compose up --build -d
- Access the Application Services:
- React UI App:
http://localhost:3000 - Eureka Dashboard:
http://localhost:8080/eureka - Consumer Endpoints:
http://localhost:8090/consumer/... - Producer Endpoints:
http://localhost:8085/...
- Stop the Application:
docker-compose down
| Method | Endpoint | Description |
|---|---|---|
| POST | /consumer/save |
Create and save a new medicine order |
| GET | /consumer/getAll |
Fetch all medicine orders |
| GET | /consumer/getAllByName/{name} |
Fetch orders by medicine name |
| GET | /consumer/getAllByContact/{contact} |
Fetch orders by customer contact number |
.
├── easymed-eureka/ # Eureka Discovery Server
├── easyMedProducer/ # Producer Microservice (JPA + MySQL)
├── easyMedConsumer/ # Consumer Microservice (Feign Client)
├── easymed-ui/ # React Frontend App
├── docker-compose.yml # Docker Multi-container Configuration
├── .gitignore # Ignored dependencies & build files
└── README.md # Project documentation