Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

Repository files navigation

๐ŸŽ“ Microservices โ€“ Student Management System

Java | J2EE | Spring Boot | REST | SOAP | MySQL | Docker | AWS EC2 | Python Mar 2024 โ€“ May 2024

A production-grade microservice for managing student records, exposing both REST and SOAP APIs, backed by MySQL, containerised with Docker, deployable on AWS EC2, and automated via Python scripts.


๐Ÿ“ Project Structure

student-management-system/
โ”‚
โ”œโ”€โ”€ student-service/                   โ† Spring Boot Microservice
โ”‚   โ”œโ”€โ”€ src/main/java/com/sms/
โ”‚   โ”‚   โ”œโ”€โ”€ StudentServiceApplication.java   โ† Main class + seed data
โ”‚   โ”‚   โ”œโ”€โ”€ model/Student.java               โ† JPA Entity
โ”‚   โ”‚   โ”œโ”€โ”€ repository/StudentRepository.javaโ† Spring Data JPA
โ”‚   โ”‚   โ”œโ”€โ”€ service/StudentService.java      โ† Business logic
โ”‚   โ”‚   โ”œโ”€โ”€ controller/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ StudentRestController.java   โ† REST API (@RestController)
โ”‚   โ”‚   โ””โ”€โ”€ soap/
โ”‚   โ”‚       โ”œโ”€โ”€ StudentSoapEndpoint.java     โ† SOAP endpoint (@Endpoint)
โ”‚   โ”‚       โ”œโ”€โ”€ SoapModels.java              โ† JAXB request/response
โ”‚   โ”‚       โ””โ”€โ”€ WebServiceConfig.java        โ† WSDL + Spring WS config
โ”‚   โ”œโ”€โ”€ src/main/resources/
โ”‚   โ”‚   โ”œโ”€โ”€ application.properties
โ”‚   โ”‚   โ””โ”€โ”€ wsdl/students.xsd               โ† XSD schema for SOAP
โ”‚   โ”œโ”€โ”€ pom.xml                             โ† Maven dependencies
โ”‚   โ””โ”€โ”€ Dockerfile                          โ† Multi-stage Docker build
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ””โ”€โ”€ index.html                          โ† Single-page dashboard UI
โ”‚
โ”œโ”€โ”€ python-scripts/
โ”‚   โ”œโ”€โ”€ automation.py                       โ† Bulk import, health check, stats
โ”‚   โ”œโ”€โ”€ soap_client.py                      โ† Python SOAP client (zeep)
โ”‚   โ””โ”€โ”€ requirements.txt
โ”‚
โ”œโ”€โ”€ SMS-Postman-Collection.json             โ† Import into Postman
โ”œโ”€โ”€ docker-compose.yml                      โ† Full stack orchestration
โ”œโ”€โ”€ nginx.conf                              โ† Reverse proxy config
โ”œโ”€โ”€ init.sql                                โ† DB init script
โ”œโ”€โ”€ deploy-ec2.sh                           โ† AWS EC2 one-click deploy
โ””โ”€โ”€ README.md

๐Ÿ›  Tech Stack

Layer Technology
Language Java 17 (J2EE)
Framework Spring Boot 3.2
REST API Spring MVC (@RestController)
SOAP API Spring WS (@Endpoint, WSDL/XSD)
ORM Spring Data JPA + Hibernate
Database MySQL 8.0
Connection Pool HikariCP
Validation Bean Validation (Jakarta)
Monitoring Spring Actuator
Containerisation Docker + Docker Compose
Cloud AWS EC2 (Ubuntu 22.04)
Reverse Proxy Nginx
Automation Python 3 (requests, zeep)
Testing Postman, JUnit 5, MockMvc
Build Tool Maven 3.9

๐Ÿš€ Quick Start

Option A โ€“ Docker Compose (Recommended)

# 1. Clone and enter
git clone <repo-url>
cd student-management-system

# 2. Launch everything
docker-compose up -d

# 3. Run Python automation (bulk import + health check)
pip3 install -r python-scripts/requirements.txt
python3 python-scripts/automation.py all

Option B โ€“ Run Locally

# 1. Start MySQL
mysql -u root -p -e "CREATE DATABASE student_db;"

# 2. Configure DB in application.properties
cd student-service
# Edit src/main/resources/application.properties

# 3. Build & Run
mvn clean package -DskipTests
java -jar target/student-service-1.0.0.jar

๐Ÿ”Œ REST API Reference

Base URL: http://localhost:8080/api

Method Endpoint Description
GET /students List all students
GET /students?search=<kw> Search by name/email/roll
GET /students?department=<dept> Filter by department
POST /students Create new student
GET /students/{id} Get student by ID
GET /students/roll/{rollNumber} Get by roll number
PUT /students/{id} Full update
PATCH /students/{id}/status Update status only
DELETE /students/{id} Delete student
GET /students/stats/summary Statistics overview
GET /students/health Health check

Create Student โ€“ Sample Payload

POST /api/students
{
  "firstName":  "Aarav",
  "lastName":   "Sharma",
  "email":      "aarav.sharma@sms.edu",
  "rollNumber": "CS2024001",
  "department": "Computer Science",
  "semester":   5,
  "phone":      "+91-9876543210",
  "gpa":        3.8,
  "status":     "ACTIVE"
}

๐Ÿงผ SOAP Web Service

WSDL: http://localhost:8080/soap/students.wsdl
Endpoint: http://localhost:8080/soap
Namespace: http://sms.com/students/soap

Operations

Operation Description
GetAllStudentsRequest Get all students
GetStudentByIdRequest Get student by ID
CreateStudentRequest Create via SOAP
DeleteStudentRequest Delete via SOAP

Sample SOAP Request

<soapenv:Envelope
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:tns="http://sms.com/students/soap">
  <soapenv:Body>
    <tns:GetStudentByIdRequest>
      <tns:id>1</tns:id>
    </tns:GetStudentByIdRequest>
  </soapenv:Body>
</soapenv:Envelope>

๐Ÿ Python Automation

cd python-scripts
pip3 install -r requirements.txt

# Check service health
python3 automation.py health

# Bulk import from CSV
python3 automation.py import

# Export all to JSON
python3 automation.py export

# Print stats report
python3 automation.py stats

# SOAP client demo
python3 soap_client.py

# Run all tasks
python3 automation.py all

๐Ÿณ Docker

# Build image manually
docker build -t student-service ./student-service

# Run with env vars
docker run -d -p 8080:8080 \
  -e DB_HOST=mysql \
  -e DB_USER=sms_user \
  -e DB_PASS=sms_password \
  student-service

# Full stack
docker-compose up -d
docker-compose ps
docker-compose logs -f student-service

โ˜๏ธ AWS EC2 Deployment

# SSH into your EC2 instance
ssh -i your-key.pem ubuntu@<EC2-IP>

# Upload project
scp -i your-key.pem -r student-management-system ubuntu@<EC2-IP>:~

# One-click deploy
chmod +x deploy-ec2.sh
./deploy-ec2.sh

screen short

Screenshot 2026-03-26 005158 Screenshot 2026-03-26 005218 Screenshot 2026-03-26 005232

EC2 Security Group โ€“ Required Inbound Rules:

Port Protocol Purpose
22 TCP SSH
80 TCP HTTP
3000 TCP Frontend
8080 TCP Spring Boot API

๐Ÿ“ฎ Postman Testing

  1. Open Postman
  2. Click Import โ†’ select SMS-Postman-Collection.json
  3. Set environment variable BASE_URL = http://localhost:8080
  4. Run the collection

๐Ÿ“Š Actuator Endpoints

URL Purpose
/actuator/health Health status
/actuator/info App metadata
/actuator/metrics JVM + HTTP metrics

๐Ÿ—„๏ธ Database Schema

CREATE TABLE students (
  id           BIGINT AUTO_INCREMENT PRIMARY KEY,
  first_name   VARCHAR(100) NOT NULL,
  last_name    VARCHAR(100) NOT NULL,
  email        VARCHAR(150) UNIQUE NOT NULL,
  roll_number  VARCHAR(20)  UNIQUE NOT NULL,
  department   VARCHAR(100) NOT NULL,
  semester     INT,
  date_of_birth DATE,
  phone        VARCHAR(20),
  address      TEXT,
  gpa          DOUBLE,
  status       ENUM('ACTIVE','INACTIVE','GRADUATED','SUSPENDED') DEFAULT 'ACTIVE',
  created_at   DATETIME,
  updated_at   DATETIME
);

๐Ÿ‘ค Author

  • Project: Microservices โ€“ Student Management System
  • Duration: March 2024 โ€“ May 2024
  • Stack: Java, J2EE, Spring Boot, REST, SOAP, MySQL, Docker, AWS EC2, Python

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages