Skip to content

Latest commit

 

History

History
96 lines (61 loc) · 1.99 KB

File metadata and controls

96 lines (61 loc) · 1.99 KB

PollSystem BE

Overview

This project provides a BE with REST APIs that are documented using OpenAPI (Swagger). The OpenAPI documentation is available in both JSON and YAML formats.

Accessing the Swagger OpenAPI Documentation

JSON Format

To download the OpenAPI documentation in JSON format, you can access the following endpoint:

http://localhost:8080/v3/api-docs

You can download the JSON by sending a GET request to this endpoint. For example, using curl:

curl --location --output openapi.json 'http://localhost:8080/v3/api-docs'

This will download the OpenAPI documentation in JSON format as openapi.json to your local machine.

YAML Format

If you prefer to download the OpenAPI documentation in YAML format, you can access the following endpoint:

http://localhost:8080/v3/api-docs.yaml

To download the YAML version, you can use the following curl command:

curl --location --output openapi.yaml 'http://localhost:8080/v3/api-docs.yaml'

This will download the OpenAPI documentation in YAML format as openapi.yaml to your local machine.

Requirements

  • Java 17 or higher
  • Maven
  • Spring Boot >= 3.4.4
  • PostgreSQL >=15
  • RabbiMQ >= 4.08

Running the Project Locally

To run this project locally, follow these steps:

  1. Clone the repository:

    git clone <repository-url>
  2. Start PostgreSQL (port 5432).

  3. Start RabbitMQ (port 5672).

  4. Navigate to the project directory:

    cd <project-directory>
  5. Build and run the application using Maven (or Gradle):

    For Maven:

    ./mvnw spring-boot:run
  6. The API will be accessible at http://localhost:8080.


Feel free to reach out if you have any issues accessing or downloading the Swagger documentation!

Coverage Check

To check the code coverage, you can use JaCoCo. Follow these steps:

mvn clean test
mvn jacoco:report

View the coverage report:

After running, open:

target/site/jacoco/index.html