{"id":49260497,"url":"https://github.com/shri-vardhan/spring-student-service","last_synced_at":"2026-04-25T07:01:18.401Z","repository":{"id":333249163,"uuid":"1136678892","full_name":"Shri-Vardhan/Spring-Student-Service","owner":"Shri-Vardhan","description":"A Spring Boot REST application built with Gradle, implementing centralized Log4j2 logging to simulate real-time enterprise backend development ","archived":false,"fork":false,"pushed_at":"2026-04-11T06:56:29.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-11T07:22:15.616Z","etag":null,"topics":["bash","gradle","groovy-script","hyper-v","java","junit","log4j","oracle-database","rest-api","spring-boot","xml","yml-files"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shri-Vardhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-18T06:09:43.000Z","updated_at":"2026-04-11T05:41:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Shri-Vardhan/Spring-Student-Service","commit_stats":null,"previous_names":["shri-vardhan/javaexamples","shri-vardhan/spring-student-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shri-Vardhan/Spring-Student-Service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shri-Vardhan%2FSpring-Student-Service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shri-Vardhan%2FSpring-Student-Service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shri-Vardhan%2FSpring-Student-Service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shri-Vardhan%2FSpring-Student-Service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shri-Vardhan","download_url":"https://codeload.github.com/Shri-Vardhan/Spring-Student-Service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shri-Vardhan%2FSpring-Student-Service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32253251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","gradle","groovy-script","hyper-v","java","junit","log4j","oracle-database","rest-api","spring-boot","xml","yml-files"],"created_at":"2026-04-25T07:01:17.609Z","updated_at":"2026-04-25T07:01:18.360Z","avatar_url":"https://github.com/Shri-Vardhan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Student Management System\n\u003e Spring Boot REST API • Oracle DB • JdbcTemplate\n\n![Java](https://img.shields.io/badge/Java-25-blue) ![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.0.1-green) ![Oracle](https://img.shields.io/badge/Oracle-PDB-red)\n\n## Overview\n\nA production-structured Spring Boot REST application that performs full CRUD operations on student records stored in an Oracle Pluggable Database (PDB). Designed to mirror real enterprise Java backends — with a clean layered architecture, environment-aware configuration via Spring Profiles, structured logging with Log4j, and both REST API and Thymeleaf-based web interfaces.\n\n---\n\n## Architecture\n\n| Layer | Package | Responsibility |\n|-------|---------|----------------|\n| Controller | `com.shrivardhan.college.controller` | Exposes REST endpoints and web MVC routes |\n| Service | `com.shrivardhan.college.service` | Business logic, validation, exception handling |\n| Repository | `com.shrivardhan.college.repository` | JdbcTemplate SQL queries against Oracle PDB |\n| Model | `com.shrivardhan.college.model` | Java objects for DB row mapping |\n\n---\n\n## Tech Stack\n\n| Technology | Details |\n|-----------|---------|\n| Java | 25 (via Gradle toolchain) |\n| Spring Boot | 4.0.1 — embedded Tomcat |\n| Spring JDBC | JdbcTemplate — explicit SQL, no ORM overhead |\n| Oracle DB | Oracle PDB 21c (`ojdbc11:23.3.0.23.09`) |\n| Thymeleaf | Server-side HTML templating |\n| Log4j | Structured application logging |\n| Gradle | Build tool |\n| Spring Profiles | Environment-specific configuration (dev / prod) |\n\n---\n\n## REST API Reference\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/api/viewStudents` | List students with pagination (`?page=0\u0026size=10`) |\n| `GET` | `/api/viewStudents/count` | Return total student count |\n| `GET` | `/api/GetStudent/{id}` | Retrieve a student by ID |\n| `POST` | `/api/insertStudent` | Insert a new student (JSON body) |\n| `PUT` | `/api/updateStudent` | Update student name and age (JSON body) |\n| `GET` | `/api/deleteStudent/{id}` | Delete a student by ID |\n\n---\n\n## Prerequisites\n\n- Java 25+\n- Gradle 8+\n- Oracle Database PDB accessible on the network\n\n---\n\n## Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/shrivardhan/college-student-management.git\ncd college-student-management\n```\n\n### 2. Configure the Database\n\nEdit the appropriate profile config under `src/main/resources/`:\n\n```yaml\n# application-dev.yml\nspring:\n  datasource:\n    url: jdbc:oracle:thin:@//192.168.0.120:1521/ORCLPDB\n    username: dev_user\n    password: dev_pass\n    driver-class-name: oracle.jdbc.OracleDriver\n```\n\n### 3. Create the Student Table\n\n```sql\nCREATE TABLE student (\n  id   NUMBER PRIMARY KEY,\n  name VARCHAR2(100),\n  age  NUMBER\n);\n```\n\n### 4. Build and Run\n\n```bash\n# Run with dev profile\n./gradlew bootRun --args='--spring.profiles.active=dev'\n\n# Or build a JAR\n./gradlew build\njava -jar build/libs/college-1.0-SNAPSHOT.jar --spring.profiles.active=prod\n```\n\n### 5. Access the Application\n\n- REST API: `http://localhost:8080/api`\n- Web UI: `http://localhost:8080/web/viewStudents`\n\n---\n\n## Exception Handling\n\nA global `@RestControllerAdvice` returns structured JSON error responses:\n\n| Exception | HTTP Status | When Thrown |\n|-----------|-------------|-------------|\n| `StudentAlreadyExistsException` | 409 CONFLICT | Student ID already exists |\n| `StudentNotFoundException` | 404 NOT FOUND | Requested ID does not exist |\n| `DataAccessResourceFailureException` | 503 UNAVAILABLE | Cannot reach Oracle DB |\n\n---\n\n## Spring Profiles\n\n| Profile | Config File | For |\n|---------|-------------|-----|\n| default | `application.yml` | Shared / fallback |\n| dev | `application-dev.yml` | Local development VM |\n| prod | `application-prod.yml` | Production Oracle PDB |\n\n---\n\n## Deployment Topology\n\nRuns across two Virtual Machines:\n\n- **VM 1 (Linux):** Oracle Database PDB — listener on port `1521`\n- **VM 2 (Windows):** Spring Boot app — connects to remote Oracle PDB via JDBC\n\n---\n\n## Project Structure\n\n```text\nsrc/main/java/com/shrivardhan/college/\n├── controller/\n├── service/\n├── repository/\n├── model/\n└── exception/\n\nsrc/main/resources/\n├── features/\n├── static/\n├── application.yml\n├── application-dev.yml\n├── application-prod.yml\n└── templates/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshri-vardhan%2Fspring-student-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshri-vardhan%2Fspring-student-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshri-vardhan%2Fspring-student-service/lists"}