This Spring Boot application manages employee records using an in-memory H2 database and exposes endpoints for CRUD operations through both REST API and gRPC.
-
Java 17
-
Maven 3
-
Spring Boot 3
-
Docker
- Maintains employee records in H2 database.
- Exposes endpoints for creating, reading, updating, and deleting employee records.
- Provides endpoints in both REST API and gRPC formats.
- Get all employees
- Get a specific employee
- Create a new employee
- Delete an employee
Defined in the proto file: employee.proto
- REST API: Runs on port 8081 (configurable in the properties file)
- gRPC: Runs on port 9090 (configurable in the properties file)
Access the Swagger UI for API documentation at: Swagger UI
Use the following Maven command to clean, install, and generate the necessary classes and jar file:
mvn clean install
docker build -t my-spring-boot-app .
docker run -p 8081:8081 -p 9090:9090 -d my-spring-boot-app
-
Clone the repository:
git clone https://github.com/partheebanMani/springboot-restapi-grpc
-
Navigate to the project directory:
cd springboot-restapi-grpc
-
Build the project using Maven:
mvn clean install
-
Build and run the Docker container:
docker build -t my-spring-boot-app . docker run -p 8081:8081 -p 9090:9090 -d my-spring-boot-app
-
Access the REST API documentation via Swagger UI at http://localhost:8081/swagger-ui/index.html#/.
Contributions are welcome! Please submit a pull request or open an issue for any changes or enhancements.