Java 17 / Spring Boot / Postgresql
The Student Management System is a Spring Boot API project designed for managing students data. This README provides an overview of the project and instructions on how to set it up using Docker Compose.
The Student Management System is a Spring Boot application that provides CRUD (Create, Read, Update, Delete) operations for students data. The API documentation is available using Swagger, making it easy to explore and interact with the endpoints.
ER Diagram
Before you begin, ensure you have met the following requirements:
To get started with the Student Management System, follow these steps:
Clone the repository to your local machine:
git clone https://github.com/dspchathuranga/student-manager.git
Build the project using Maven:
cd student-management
mvn clean install -DskipTests
You can change environment variables docker-compose.yaml
file in the project directory:
version: '3.8'
services:
database_postgres:
container_name: student-manager-postgres
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- '5432:5432'
spring_boot_app:
container_name: student-manager-app
image: student-manager/student-manager-image:1.0
build: .
ports:
- 8080:8080
environment:
- DATABASE_URL=jdbc:postgresql://database_postgres:5432/postgres
- DATABASE_USERNAME=postgres
- DATABASE_PASSWORD=postgres
depends_on:
- database_postgres
Start the application and database services using Docker Compose:
docker-compose up
The application will be accessible at http://localhost:8080
.
The API documentation is available via Swagger, which allows you to interact with the endpoints and understand the available features. To access the API documentation, follow these steps:
Run the Spring Boot application using Docker Compose as described in the “Getting Started with Docker Compose” section.
Open a web browser and go to the Swagger UI by navigating to the following URL:
http://localhost:8080/swagger-ui.html
Use the Swagger UI to explore and test the API endpoints. You can find descriptions and example requests and responses for each endpoint.
Testing is an essential part of ensuring the quality and correctness of the Student Management System. We use JUnit in combination with Spring Test.
Before running the tests, make sure the application.properties
configuration:
# Database Configuration
spring.datasource.url=${DATABASE_URL:jdbc:postgresql://localhost:5432/postgres}
spring.datasource.username=${DATABASE_USERNAME:postgres}
spring.datasource.password=${DATABASE_PASSWORD:postgres}
# Flyway Configuration
spring.flyway.url=${DATABASE_URL:jdbc:postgresql://localhost:5432/postgres}
spring.flyway.user=${DATABASE_USERNAME:postgres}
spring.flyway.password=${DATABASE_PASSWORD:postgres}
For Maven-based projects, execute the following command in your project’s root directory:
mvn test
If you would like to contribute to the project, please submit a pull request. We welcome your contributions and ideas.
© 2023 DSP Chathuranga