A REST API that allows students to answer questions and get their certifications developed using:
- Java
- Spring Boot
- Lombok
- PostgreSQL
- Docker
- Register students
- Get students by e-mail
- Update students' e-mails
- Register multiple choice questions for a specific technology
- Get all questions for a technology
- Submit answers and get certified
- Check all details of a certification
- Get arbitrary size rankings of certification grades for a technology
To run the application, you'll have to have JRE, Maven and Docker installed in your machine. To start the database container on port 5432, run the following command:
docker-compose up
Then, to start the application on port 8085, run the following command:
mvn spring-boot:run
To alter any of the ports, go to /docker-compose.yml
and /src/main/resources/application.properties
.
All endpoints consume and produce JSON and the following documentation uses mostly YAML
- Request Body
email: string
name: string
- Response
201 - Created:
Headers:
Location: URI (string)
409 - Conflict:
Body:
error:
code: string
details: string
Meaning: Email is already in use.
- Path Variable
studentEmail: string
- Response
200 - OK:
Body:
email: string
fullName: string
certifications:
- id: UUID (string)
technology: string
404 - Not Found:
Meaning: Student does not exist.
- Path Variable
studentEmail: string
- Request Body
email: string
- Response
200 - OK:
Headers:
Location: URI (string)
404 - Not Found:
Meaning: Student referenced in path variable does not exist.
409 - Conflict:
Body:
error:
code: string
details: string
Meaning: E-mail specified in request body is already in use.
- Request Body
technology: string
description: string
alternatives:
- description: string
correct: boolean
- Response
201 - Created:
Headers:
Location: URI (string)
- Path Variable
technology: string
- Response
200 - OK:
Body:
- id: UUID (string)
technology: string
description: string
alternatives:
- id: UUID (string)
description: string
404 - Not Found:
Meaning: No questions found for the specified technology.
- Request Body
email: string
technology: string
answers:
- questionId: UUID (string)
alternativeId: UUID (string)
- Response
201 - Created:
Headers:
Location: URI (string)
404 - Not Found:
Meaning: Either one of the resources referenced in request body (student, question and alternative) does not exist or technology, question and alternative are conflictant.
- Path Variable
certificationId: string
- Response
200 - OK:
Body:
id: UUID (string)
technology: string
grade: float
timeOfEmition: datetime (string)
answers:
- question:
id: UUID (string)
description: string
chosenAlternative:
id: UUID (string)
description: string
correct: boolean
404 - Not Found:
Body:
error:
code: string
details: string
Meaning: Certification does not exist.
- Path Variables
technology: string
quantity: integer
- Response
200 - OK:
Body:
- id: UUID (string)
grade: float
student:
email: string
name: string
404 - Not Found:
Body:
error:
code: string
details: string
Meaning: No certifications found for the specified technology.