Skip to content

Commit

Permalink
feat: add Java REST API in the back end (#105)
Browse files Browse the repository at this point in the history
* feat: add backend initial files

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

* feat: add maven wrapper jar

Issue #91

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

* feat: add plugins and review pom.xml backend file

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

* feat: add google checkstyle

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.

* feat: add backend to docker compose file

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

* test: fix test cases and tests configuration

Issue #91

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

* docs: update readme file to include new service

Issue #91

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

* feat: update sb version to 3.1.4 and java to 21

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.

* feat: update docker compose to run with java 21

Issue #91

This commit updates the existing docker-compose file to use the latest
maven with Java 21 available at this moment.

* fix: trivy warning cve-2022-1471

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/
  • Loading branch information
Ricardo Campos authored Sep 26, 2023
1 parent b1c380d commit 3aaca0f
Show file tree
Hide file tree
Showing 12 changed files with 1,478 additions and 28 deletions.
67 changes: 39 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,59 @@ and [our Rocket Chat](https://chat.developer.gov.bc.ca/) channel.
# Stack

Here you will find a comprehensive list of all the languages and tools that are
been used in this app. And also everything you need to get started, build,
been used on SILVA. And also everything you need to get started, build,
test and deploy.

- React Progressive Web Application
- TypeScript
- Context API
- React Testing Library
- Jest
## Front end
- Progressive Web Application
- [React](https://react.dev/)
- [React Redux](https://react-redux.js.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/)
- [Vitest](https://vitest.dev/)
- [Vite](https://vitejs.dev/)
- [Node 20](https://nodejs.org/download/release/v20.7.0/)
- Lint
- Airbnb ESLint
- [Standard TS ESLint](https://github.com/standard/eslint-config-standard-with-typescript)
- Tools
- Docker
- Microsoft Visual Studio Code
- Docker & Docker compose
- Microsoft VS Code
- Styling
- Carbon Design System
- Bootstrap
- Authentication
- AWS Cognito (FAM)
- [Carbon Design System](https://github.com/bcgov/nr-fsa-theme)
- [Bootstrap CSS](https://getbootstrap.com/)
- Authentication & Authorization
- [FAM (AWS Cognito)](https://github.com/bcgov/nr-forests-access-management)

## Back end
- REST API
- [Java 17 with GraalVM](https://www.graalvm.org/)
- [Spring Boot Web](https://spring.io/guides/gs/spring-boot/)
- [Apache Maven](https://maven.apache.org/)
- [Hibernate ORM](https://hibernate.org/orm/)
- [Oracle JDBC](https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html)
- Lint
- [Google Java Checkstyle ](https://checkstyle.org/styleguides/google-java-style-20180523/javaguide.html)
- IDE
- [VSCode](https://code.visualstudio.com/) can be a great choice
- Authentication & Authorization
- OAuth 2.0 with JWT Token-based requests.

# Getting started

Once you have cloned this repository, you can get the app running by typing
`npm install` and then `npm run start` from the project root directory. Then
head to http://localhost:3000.

Be aware of the required environment variables:

- VITE_USER_POOLS_ID
- VITE_USER_POOLS_WEB_CLIENT_ID
at the project root directory:

To run the unit tests all you need is `npm run test`.

And with Docker:

```bash
docker compose --env-file ./frontend/.env.local up -d
```sh
docker compose up -d
```

Then head to http://localhost:3000 too see SILVA running. You can see the REST API working at http://localhost:8080

Before writing your first line of code, please take a moment and check out
our [CONTRIBUTING](CONTRIBUTING.md) guide.

## Getting help

As mentioned, we're here to help. Feel free to start a conversation
on Rocket chat, you can search for `@jazz.grewal`.
As mentioned, we're here to help. Feel free to reach out and
start a conversation on Rocket chat, you can search for
`@jazz.grewal` or `@ricardo.campos`.
33 changes: 33 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Loading

0 comments on commit 3aaca0f

Please sign in to comment.