Sign inSign up

archety/student-api-mysql

By archety

•Updated 6 months ago

Spring Boot student API with MySQL, Docker & Kubernetes ready, env configurable

Image
Languages & frameworks
0

1.0K

archety/student-api-mysql repository overview

⁠Student API (MySQL) - archety/student-api-mysql

A production-ready Spring Boot REST API for managing students, backed by a MySQL database.

This version is designed for real-world scenarios and demonstrates a complete containerized architecture using Docker and Kubernetes with externalized configuration.


⁠Features

  • Full CRUD operations on students
  • MySQL persistence (JPA/Hibernate)
  • Externalized configuration via environment variables
  • Kubernetes-ready (ConfigMap & Secret integration)
  • Actuator endpoints for monitoring and health checks

⁠Base URL

http://localhost:8080

⁠Available Endpoints

⁠Students
  • GET /api/students
    Retrieve all students

  • GET /api/students/{id}
    Retrieve a student by ID

  • POST /api/students
    Create a new student

  • PUT /api/students/{id}
    Update an existing student

  • DELETE /api/students/{id}
    Delete a student


⁠Search & Filtering
  • GET /api/students/search?course={course}
    Filter students by course

  • GET /api/students/search?status={status}
    Filter students by status

  • GET /api/students/search?course={course}&status={status}
    Filter by both course and status


⁠Additional Endpoints
  • GET /api/students/count
    Get total number of students

  • GET /api/students/version
    Get API version

  • PATCH /api/students/{id}/status
    Update only the student status


⁠Actuator
  • GET /actuator/health
    Health check endpoint

  • GET /actuator/info
    Application info


⁠Configuration (Environment Variables)

SPRING_DATASOURCE_URL=jdbc:mysql://<host>:3306/studentdb
SPRING_DATASOURCE_USERNAME=<username>
SPRING_DATASOURCE_PASSWORD=<password>

⁠Example Request

⁠Create Student
POST /api/students
{
  "firstName": "John",
  "lastName": "Doe",
  "email": "[email protected]",
  "course": "Computer Science",
  "age": 22,
  "status": "ACTIVE"
}

⁠Use Cases

  • DevOps and Kubernetes training labs
  • Microservices architecture demos
  • Backend API testing with real persistence
  • Container-based development workflows

⁠Resources


⁠Source Code


⁠License

MIT License

Copyright (c) 2026 Giovanni Pace

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


⁠☕ Coffeeware Philosophy

If this project helped you build something useful or learn something new, consider offering a coffee ☕

The best way to support my work is by subscribing to my YouTube channel: https://youtube.com/@archety⁠

Tag summary

Content type

Image

Digest

sha256:1a9488c7d…

Size

140.3 MB

Last updated

6 months ago

docker pull archety/student-api-mysql