Skip to content

MartinCherry/students-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Student App Example

To run application run command - mvn spring-boot:run

Application is running on http://localhost:8080/students/

Application gives user options to:

  • Add Tutor
  • Add Course
  • Add Student
  • Register Course to Student

Primary options

To add Tutor ->

http://localhost:8080/students/addTutor {POST}

{
  "id": 0,
  "name": "string",
  "surname": "string"
}

To add Course ->

http://localhost:8080/students/addCourse {POST}

{
  "name": "String",
  "tutorId": Integer
}

To add student ->

http://localhost:8080/students/addStudent {POST}

{
  "name": "String",
  "surname": "String"
}

To add Student with Course ->

http://localhost:8080/students/addStudentRequest {POST}

{
  "name": "String",
  "surname": "String",
  "courseId": Integer
}

To add Course for already registered Student ->

http://localhost:8080/students/{studentID}/{courseID} {POST}

To get all Courses with their Tutors, that Studant has been registered to ->

http://localhost:8080/students/getStudentCourses/{studentId} {GET}


Bonus options

Function Request Type Description
http://localhost:8080/students/getTutors/{tutorId} GET Get specific Tutor
http://localhost:8080/students/getTutors GET Get All Tutors
http://localhost:8080/students/getCourses/{courseId} GET Get specific Course
http://localhost:8080/students/getCourses GET Get All Courses
http://localhost:8080/students/geStudents/{StudentId} GET Get specific Student
http://localhost:8080/students/getStudents GET Get All Students

Databases

Application is configured to run on H2 database. You can connect to database console from http://localhost:8080/h2-console

Screenshot 2022-11-28 at 10 12 52


PostgreSQL

To configur database to work on PostgreSQL, change student-app.connection-type=in-memory application.properties

to student-app.connection-type=postgresql

And change values to -

student-app.database.username={Your PostgreSQL DB Username}
student-app.database.password={Your PostgreSQL DB Password}
student-app.database.url={Your PostgreSQL DB URL}


Swagger

Application is configured to work with swagger.

To acces swagger UI go to -> http://localhost:8080/swagger-ui/index.html

About

RESTful API gives options to Add Tutors, Add Courses, Add Students, Assign Tutors to Courses and Assign Courses to Students

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages