This is a java spring-boot REST API application to implement school registration system.
mvn clean install
docker-compose build
docker-compose up -d
http://localhost:8080
src - sources
pom.xml - maven project configuration file to build application
Dockerfile - Docker configuration file for application
docker-compose.yml - Docker-compose configuration file to build environment
build.sh - bash script to build application
run.sh - bash script to run environment
test.sh - make test requests to working application
readme.md - this file
target - directory with compiled java sources and result jar file (will be created after build)
List of REST API endpoints:
- Students API
- Get list of all students: GET http://localhost:8080/api/students
- Get student by ID: GET http://localhost:8080/api/students/{id}
- Create new student: POST http://localhost:8080/api/students
- Update existing student: PUT http://localhost:8080/api/students/{id}
- Delete existing student: DELETE http://localhost:8080/api/students/{id}
- Cources API
- Get list of all courses: GET http://localhost:8080/api/courses
- Get course by ID: GET http://localhost:8080/api/courses/{id}
- Create new course: POST http://localhost:8080/api/courses
- Update existing course: PUT http://localhost:8080/api/courses/{id}
- Delete existing course: DELETE http://localhost:8080/api/courses/{id}
- Registration API
- Register student to course by ID: POST http://localhost:8080/api/students/{id}/register/{id}
- Reports API
- Get list of all student's courses by ID: GET http://localhost:8080/api/reports/student/{id}/courses
- Get list of all courses' students by ID: GET http://localhost:8080/api/reports/course/{id}/students
- Get list of all students without any courses: GET http://localhost:8080/api/reports/studentsWithoutAnyCourses
- Get list of all courses without any students: GET http://localhost:8080/api/reports/coursesWithoutAnyCourses
GET http://localhost:8080/api/students
[
{
"id": 1,
"firstName": "Alex",
"lastName": "Sco"
},
{
"id": 2,
"firstName": "John",
"lastName": "Doe"
},
{
"id": 3,
"firstName": "Mari",
"lastName": "Lui"
},
{
"id": 4,
"firstName": "Jill",
"lastName": "Sun"
},
{
"id": 5,
"firstName": "Debi",
"lastName": "Fox"
}
]
POST http://localhost:8080/api/students
{
"firstName": "Test",
"lastName": "User"
}
{
"id": 6,
"firstName": "Test",
"lastName": "User"
}
PUT http://localhost:8080/api/students/6
{
"firstName": "Test new name",
"lastName": "User new last name"
}
{
"id": 6,
"firstName": "Test new name",
"lastName": "User new last name"
}
DELETE http://localhost:8080/api/students/6
[No content]
GET http://localhost:8080/api/courses
[
{
"id": 1,
"name": "Java"
},
{
"id": 2,
"name": "PHP"
},
{
"id": 3,
"name": "JS"
},
{
"id": 4,
"name": "Python"
},
{
"id": 5,
"name": ".NET"
},
{
"id": 6,
"name": "Bash"
},
{
"id": 7,
"name": "Linux"
},
{
"id": 8,
"name": "Windows"
},
{
"id": 9,
"name": "MacOS"
},
{
"id": 10,
"name": "Docker"
},
{
"id": 11,
"name": "AWS"
}
]
POST http://localhost:8080/api/courses
{
"name": "New course"
}
{
"id": 12,
"name": "New course"
}
PUT http://localhost:8080/api/courses/12
{
"name": "New course name"
}
{
"id": 12,
"name": "New course name"
}
DELETE http://localhost:8080/api/courses/12
[No content]
POST http://localhost:8080/api/students/2/register/6
{
"id": 2,
"firstName": "John",
"lastName": "Doe"
}
GET http://localhost:8080/api/reports/course/1/students
[
{
"id": 1,
"firstName": "Alex",
"lastName": "Sco"
}
]
GET http://localhost:8080/api/reports/student/1/courses
[
{
"id": 3,
"name": "JS"
},
{
"id": 1,
"name": "Java"
},
{
"id": 2,
"name": "PHP"
}
]
GET http://localhost:8080/api/reports/studentsWithoutAnyCourses
[
{
"id": 2,
"firstName": "John",
"lastName": "Doe"
},
{
"id": 3,
"firstName": "Mari",
"lastName": "Lui"
},
{
"id": 4,
"firstName": "Jill",
"lastName": "Sun"
},
{
"id": 5,
"firstName": "Debi",
"lastName": "Fox"
}
]
GET http://localhost:8080/api/reports/coursesWithoutAnyStudents
[
{
"id": 4,
"name": "Python"
},
{
"id": 5,
"name": ".NET"
},
{
"id": 6,
"name": "Bash"
},
{
"id": 7,
"name": "Linux"
},
{
"id": 8,
"name": "Windows"
},
{
"id": 9,
"name": "MacOS"
},
{
"id": 10,
"name": "Docker"
},
{
"id": 11,
"name": "AWS"
}
]