Skip to content

REST API for a tech certification system made using Spring Boot and PostgreSQL.

License

Notifications You must be signed in to change notification settings

ryansakurai/tech-certification-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💻 Tech Certification API 💻

A REST API that allows students to answer questions and get their certifications developed using:

  • Java
  • Spring Boot
  • Lombok
  • PostgreSQL
  • Docker

🚀 Features

  • 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

🏁 How to Run

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.

⚙️ Behavior

All endpoints consume and produce JSON and the following documentation uses mostly YAML

/students

POST

  • 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.

GET /{studentEmail}

  • 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.

PATCH /{studentEmail}

  • 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.

/questions

POST

  • Request Body
technology: string
description: string
alternatives:
    - description: string
      correct: boolean
  • Response
201 - Created:
    Headers:
        Location: URI (string)

GET /{technology}

  • 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.

/certifications

POST

  • 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.

GET /{certificationId}

  • 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.

GET /{technology}/rankings/{quantity}

  • 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.

About

REST API for a tech certification system made using Spring Boot and PostgreSQL.

Topics

Resources

License

Stars

Watchers

Forks

Languages