A production-ready Microservices RESTful API built with Java 17, Spring Boot 3, Spring Cloud & Gradle
A scalable, cloud-ready Student Management System built using a microservices architecture. The system manages full CRUD operations for student records and is designed with service discovery, API routing, and containerization built in โ ready for both local development and cloud deployment.
Browser / Postman
โ
โผ
โโโโโโโโโโโโโโโโ port 8080
โ API Gateway โ โโโโโ All external requests enter here
โโโโโโโโฌโโโโโโโโ
โ (routes /api/students โ lb://student-service)
โผ
โโโโโโโโโโโโโโโโโโ port 8081
โ Student Serviceโ โโโโโ CRUD REST API
โโโโโโโโฌโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโ
โ H2 Database โ (in-memory; swap to MySQL for production)
โโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโ port 8761
โ Eureka Server โ โโโโโ Service Discovery
โโโโโโโโโโโโโโโโโโโโ
| Service | Role | Port |
|---|---|---|
| ๐ Eureka Server | Service Discovery & Registry | 8761 |
| ๐ API Gateway | Request Routing & Load Balancing | 8080 |
| ๐ Student Service | Business Logic + CRUD API | 8081 |
| ๐๏ธ H2 Console | In-Memory DB UI | 8081/h2-console |
| Layer | Technology |
|---|---|
| Language | Java 17 |
| Framework | Spring Boot 3 |
| Microservices | Spring Cloud (Eureka, Gateway) |
| Build Tool | Gradle 8 |
| Database | H2 (dev) / MySQL (prod) |
| Containerization | Docker + Docker Compose |
| Deployment | Render |
| Tool | Version |
|---|---|
| โ Java | 17+ |
| ๐ Gradle | 8+ (or use included Gradle Wrapper) |
| ๐ฎ Postman | Any |
| ๐ณ Docker | For containerized runs |
Note: The Gradle Wrapper is bundled โ no global Gradle install needed.
Start services in this order:
cd eureka-server
./gradlew bootRun # macOS / Linux
gradlew bootRun # Windows๐ Dashboard: http://localhost:8761
cd api-gateway
./gradlew bootRun๐ Runs on: http://localhost:8080
cd student-service
./gradlew bootRun๐ API: http://localhost:8081
๐๏ธ H2 Console: http://localhost:8081/h2-console
H2 Connection Details:
| Property | Value |
|---|---|
| JDBC URL | jdbc:h2:mem:studentsdb |
| Username | sa |
| Password | (leave empty) |
Base URL: http://localhost:8080/api
| Method | Endpoint | Description |
|---|---|---|
GET |
/students |
Get all students |
GET |
/students/{id} |
Get student by ID |
GET |
/students/search?q=name |
Search students by name |
POST |
/students |
Create a new student |
PUT |
/students/{id} |
Update a student |
DELETE |
/students/{id} |
Delete a student |
POST /api/students
{
"name": "John Doe",
"age": 21,
"email": "john.doe@example.com",
"course": "Computer Science"
}1. Add dependency in build.gradle:
runtimeOnly 'com.mysql:mysql-connector-j'2. Update application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/studentsdb?createDatabaseIfNotExist=true
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=root
spring.datasource.password=yourpassword
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto=update./gradlew clean build
# JAR generated in: build/libs/version: "3.8"
services:
# eureka-server, api-gateway, student-servicedocker compose up --buildPush your project repository to GitHub (e.g., Student_Management_System_v1).
Visit render.com and log in with GitHub.
๐ Eureka Server
| Config | Value |
|---|---|
| Name | sms-eureka-server |
| Environment | Docker |
| Root Directory | eureka-server |
| Branch | main |
๐ Student Service
| Config | Value |
|---|---|
| Name | sms-student-service |
| Environment | Docker |
| Root Directory | student-service |
| Env Variable | EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=https://sms-eureka-server.onrender.com/eureka/ |
๐ API Gateway
| Config | Value |
|---|---|
| Name | sms-api-gateway |
| Environment | Docker |
| Root Directory | api-gateway |
| Env Variable | EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=https://sms-eureka-server.onrender.com/eureka/ |
https://sms-api-gateway.onrender.com/api/students
student-management-system/
โ
โโโ ๐ฆ eureka-server/
โ โโโ build.gradle
โ โโโ src/main/java/com/sms/eurekaserver/
โ
โโโ ๐ฆ api-gateway/
โ โโโ build.gradle
โ โโโ src/main/java/com/sms/apigateway/
โ
โโโ ๐ฆ student-service/
โ โโโ build.gradle
โ โโโ src/main/java/com/sms/studentservice/
โ โโโ controller/
โ โโโ service/
โ โโโ repository/
โ โโโ model/
โ โโโ dto/
โ โโโ exception/
โ
โโโ ๐ฅ๏ธ frontend/
โโโ index.html
- ๐๏ธ Replace H2 with MySQL / PostgreSQL
- ๐ Add Authentication (JWT)
- โ๏ธ Implement CI/CD Pipelines
- ๐ Add Monitoring (Prometheus + Grafana)
Made with โค๏ธ using Java ยท Spring Boot ยท Spring Cloud