This project provides an API Gateway with Dynamic Services Management and Dynamic path security for managing microservices, built using Java Spring Boot, Spring Cloud, MySQL with Docker and Jenkins integration.
- Centralized API Management: Route requests to appropriate microservices.
- Dynamic services management: Adding services from database with there paths and urls.
- Dynamic Path security: opening security routes of applications allowing difference in public and private apis.
- Security: Manage authentication and authorization centrally.
- Load Balancing: Distribute incoming traffic to multiple instances of microservices.
- Monitoring and Logging: Centralized logging and monitoring of requests.
- Registry registration: Registering api gateway to Eureka registry enabling load balancing.
- Java 17
- Spring Boot
- Spring Cloud
- MySQL
- Docker
- Jenkins
- Java 17
- MySQL
- PORT: 9000
- Docker
- Maven
-
Clone the repository:
git clone https://github.com/bhupendrasambare/microservices-api-gateway.git cd microservices-api-gateway
-
setup IP & MySQL:
server: ip: 192.168.29.226 spring: datasource: url: jdbc:mysql://${server.ip}:3306/microservices?allowPublicKeyRetrieval=true username: root password: password
-
Build the project using Maven:
./mvn clean install
-
Run the application:
java -jar target/microservices-api-gateway-0.0.1-SNAPSHOT.jar
-
Build the Docker image:
docker build -t microservices-api-gateway .
-
Run the Docker container:
docker run -d -p 9000:9000 microservices-api-gateway
The project includes a Jenkinsfile
for CI/CD integration. Ensure Jenkins is set up with Docker and Maven installed.
CREATE TABLE `services` (
`id` bigint NOT NULL AUTO_INCREMENT,
`enabled` bit(1) DEFAULT NULL,
`path` varchar(255) DEFAULT NULL,
`service_id` varchar(255) DEFAULT NULL,
`uri` varchar(255) DEFAULT NULL,
`method` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `paths` (
`id` bigint NOT NULL AUTO_INCREMENT,
`description` varchar(255) DEFAULT NULL,
`path` varchar(255) DEFAULT NULL,
`service` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or suggestions, please contact Bhupendra Sambare.
This project is part of Bhupendra Sambare's repositories on GitHub.