Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Java REST API in the back end #105

Merged
merged 12 commits into from
Sep 26, 2023

Conversation

RMCampos
Copy link

@RMCampos RMCampos commented Sep 25, 2023

Description

Adds a REST API with Spring Boot. Features:

  • Apache Maven for package management
  • Plugins and profiles for DEV, and PROD. (TEST later, when we have more tests)
  • Java 21
  • GraalVM for Cloud Native
  • Add a new service in the Docker compose
  • Google CheckStyle
  • OpenAPI with Swagger and Spring Docs

⚠️ Note that all workflow-related changes will be in a separate PR.

Fixes #91

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

This was tested locally.

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Further comments


Thanks for the PR!

Any successful deployments (not always required) will be available below.
Frontend

Once merged, code will be promoted and handed off to following workflow run.
Main Merge Workflow

Ricardo Campos added 11 commits September 14, 2023 11:50
Issue #91

This commit adds initial files generated by start.spring.io website
where the project was generated with:

- Project: Maven
- Language: Java
- Spring Boot version: 3.1.3 (latest stable)
- Project metadata group: ca.bc.gov.restapi
- Project metadata artifact: results
- Project metadata name: results
- Project metadata description: RESULTS REST API
- Packaging: Jar
- Java version: 17
- Dependencies
  - Actuator
  - Data JPA
  - OAuth2 Authorization server
  - OAuth2 client
  - Started web
  - Devtools
  - H2 Database
  - Lombok
  - GraalVM
Issue #91

Adding the maven wrapper is a good practice, recommended in case you
want to use maven out of the box.
Issue #91

This change adds required dependencies for building, running and
packaging the service locally and for Cloud Native images. This is what
was changed:

- Add project license
- Add properties and definitions
- Add profiles for dev, prod and native
- Add dependencies
- Add plugins for building, running and packaging
- Add project final name jar, line 179
Issue #91

This commit adds the google checkstyle xml definition file to be used as
a guide for the checkings. Also updates existing class files to met the
checkstyle validations, replacing tab by spaces, adding JavaDoc to all
public classes.
Issue #91

This change adds a new service to the docker-compose file for the
backend REST api. If you want to run the backend locally all you need is
to run at the project root folder: `docker compose up backend` and
you're all set.

Other minor changes were made:
- Add some properties to the application properties file
- Remove dependencies not required for now
Issue #91

This change gets tests passing and cloud native build working and
running smoothly.
Issue #91

This change simply add more information on the new service in the back
end.
Issue #91

This change updates the Spring Boot version to the latest (at the time
of this writing), which is 3.1.4. And also updates the required Java
version required to compile and run this service, which is the 21.
Issue #91

This commit updates the existing docker-compose file to use the latest
maven with Java 21 available at this moment.
@RMCampos RMCampos added the enhancement New feature or request label Sep 25, 2023
@RMCampos RMCampos self-assigned this Sep 25, 2023
@RMCampos RMCampos linked an issue Sep 25, 2023 that may be closed by this pull request
11 tasks
backend/pom.xml Fixed Show fixed Hide fixed
Copy link
Member

@DerekRoberts DerekRoberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. :)

@RMCampos
Copy link
Author

Hmm.. Just saw that Trivy security alert. I'll take a look

Issue #91

This change simply change the required version by spring boot of this
dependency. You can learn more about it here:

- spring-projects/spring-boot#32221
- https://avd.aquasec.com/nvd/2022/cve-2022-1471/
@RMCampos RMCampos merged commit 3aaca0f into main Sep 26, 2023
6 checks passed
@RMCampos RMCampos deleted the 91-get-java-rest-api-backend-started branch September 26, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get Java REST API backend started
2 participants