https://github.com/partheebanmani/springboot-restapi-grpc
Spring boot application with rest api and grpc
https://github.com/partheebanmani/springboot-restapi-grpc
docker grpc grpc-java grpc-server grpc-service h2-database mapper proto protobuf protoc rest-api restcontroller spring-boot springboot
Last synced: 18 days ago
JSON representation
Spring boot application with rest api and grpc
- Host: GitHub
- URL: https://github.com/partheebanmani/springboot-restapi-grpc
- Owner: partheebanMani
- Created: 2024-07-26T12:33:09.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-07-26T14:23:07.000Z (9 months ago)
- Last Synced: 2025-04-07T05:49:39.491Z (18 days ago)
- Topics: docker, grpc, grpc-java, grpc-server, grpc-service, h2-database, mapper, proto, protobuf, protoc, rest-api, restcontroller, spring-boot, springboot
- Language: Java
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Employee Records Management System
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.
## Prerequisites
* Java 17
* Maven 3
* Spring Boot 3
* Docker
## Features
* 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.## Endpoints
### REST API
* Get all employees
* Get a specific employee
* Create a new employee
* Delete an employee### gRPC
Defined in the proto file: employee.proto## Configuration
* REST API: Runs on port 8081 (configurable in the properties file)
* gRPC: Runs on port 9090 (configurable in the properties file)## Swagger Documentation
Access the Swagger UI for API documentation at: Swagger UI
## Build and Run
#### Maven
Use the following Maven command to clean, install, and generate the necessary classes and jar file:mvn clean install
#### Docker
##### Build Docker Imagedocker build -t my-spring-boot-app .
##### Start Docker Container
docker run -p 8081:8081 -p 9090:9090 -d my-spring-boot-app
## Getting Started
1. Clone the repository:
git clone https://github.com/partheebanMani/springboot-restapi-grpc
2. Navigate to the project directory:
cd springboot-restapi-grpc
3. Build the project using Maven:
mvn clean install
4. 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-app5. Access the REST API documentation via Swagger UI at http://localhost:8081/swagger-ui/index.html#/.
## Contributing
Contributions are welcome! Please submit a pull request or open an issue for any changes or enhancements.