Skip to content

Hemanth7723/Student_Management_System_v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽ“ Student Management System v1

A production-ready Microservices RESTful API built with Java 17, Spring Boot 3, Spring Cloud & Gradle


๐Ÿ“Œ Overview

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.


๐Ÿ—๏ธ Architecture

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

๐Ÿ› ๏ธ Tech Stack

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

โœ… Prerequisites

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.


๐Ÿš€ How to Run (Local)

Start services in this order:

1๏ธโƒฃ Eureka Server

cd eureka-server
./gradlew bootRun          # macOS / Linux
gradlew bootRun            # Windows

๐ŸŒ Dashboard: http://localhost:8761


2๏ธโƒฃ API Gateway

cd api-gateway
./gradlew bootRun

๐ŸŒ Runs on: http://localhost:8080


3๏ธโƒฃ Student Service

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)

๐Ÿ“ก REST API Reference

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

๐Ÿ“ Example Request

POST /api/students

{
  "name": "John Doe",
  "age": 21,
  "email": "john.doe@example.com",
  "course": "Computer Science"
}

๐Ÿ”„ Switch to MySQL (Production)

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

๐Ÿณ Docker Setup

Build JAR Files

./gradlew clean build
# JAR generated in: build/libs/

Docker Compose (Recommended)

version: "3.8"
services:
  # eureka-server, api-gateway, student-service
docker compose up --build

โ˜๏ธ Deploying to Render

Step 1 โ€” Push to GitHub

Push your project repository to GitHub (e.g., Student_Management_System_v1).

Step 2 โ€” Create a Render Account

Visit render.com and log in with GitHub.

Step 3 โ€” Deploy Each Service

๐Ÿ” 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/

๐ŸŒ Live API URL

https://sms-api-gateway.onrender.com/api/students

๐Ÿ“ Project Structure

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

๐Ÿ”ฎ Future Improvements

  • ๐Ÿ—„๏ธ Replace H2 with MySQL / PostgreSQL
  • ๐Ÿ” Add Authentication (JWT)
  • โš™๏ธ Implement CI/CD Pipelines
  • ๐Ÿ“Š Add Monitoring (Prometheus + Grafana)

Made with โค๏ธ using Java ยท Spring Boot ยท Spring Cloud

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors