Go to file
Andreas Svanberg 12319da38c
Some checks failed
Build and test / build-and-test (push) Has been cancelled
Coverage report / coverage-report (pull_request) Successful in 8m27s
Turn on debug-mode
2024-12-05 10:58:54 +01:00
.gitea/workflows Turn on debug-mode 2024-12-05 10:58:54 +01:00
.mvn/wrapper Build and test on each push (#9) 2024-10-30 10:19:50 +01:00
api Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
core Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
daisy-integration Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
resources/db_update_scripts new db file 2013-10-10 11:16:14 +09:00
view Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
war Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
.gitattributes Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
.gitignore Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
.mailmap Updated git mailmap. 2015-02-05 15:56:03 +01:00
.prettierrc.yaml Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
docker-compose.yml Enable creating an API using Spring Web (#5) 2024-11-06 11:23:28 +01:00
GetToken.java Enable creating an API using Spring Web (#5) 2024-11-06 11:23:28 +01:00
mvnw Build and test on each push (#9) 2024-10-30 10:19:50 +01:00
mvnw.cmd Build and test on each push (#9) 2024-10-30 10:19:50 +01:00
owasp.xml Supress bogus security vulnerability 2024-04-22 09:30:47 +02:00
package-lock.json Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
package.json Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00
parallel.sh Bash script to enable parallel deployment. 2014-05-08 09:54:39 +02:00
pom.xml Report test coverage on pull request 2024-12-05 10:42:54 +01:00
README.md Enforce code formatting via Prettier (#44) 2024-12-02 14:17:59 +01:00

Working with the API

The API is protected by OAuth 2 acting as a resource server verifying tokens using token introspection.

When developing it uses a locally running instance of an authorization server that is run inside Docker. It can be started with docker compose -f docker-compose.yml up. Since there is no frontend to interact with the authorization server there's a helper script in GetToken.java that can be run directly with java GetToken.java to run through the authorization flow and get an access token.

Once the token has been obtained go to the Swagger UI to interact with the API. Click the "Authorize" button in the top right and paste the access token to log in.

Code formatting

This project uses prettier-java to format all Java code. To reformat the code run ./mvnw validate frontend:npm@reformat -pl .. Yes it's a mouthful but unfortunately the prettier-maven-plugin does not work due to an outstanding issue.

An easier way to reformat code is to set IntelliJ to do it on save. Go to Settings -> Language & Frameworks -> JavaScript -> Prettier and then check Automatic Prettier Configuration, set Run for files to **/*.{java}, and finally check Run on save.

The formatting is validated by CI, but you should do it beforehand with a simple ./mvnw verify -pl ..