This mono-repo contains the language and translator services of the Finnish National Agency for Education.
- Maven 3.1+
- JDK 17
- PostgreSQL 12.9
- node v16.16.0
- yarn 3.2.2 (to enable it, run the following command:
corepack enable
)
Below are listed the OPH services which are a part of this mono-repo.
In addition, the shared frontend content can be found here.
Create and start database, backend, and frontend containers for a specific application:
docker-compose -f <service-docker-compose-file-name.yml> up
Or
Start up a certain service of an application:
docker-compose up frontend | backend | postgres
To disable default Spring Security configurations, create the following environment variable and restart the containers:
export AKR_UNSECURE=true
docker-compose -f <service-docker-compose-file-name.yml> up
In case of errors, clean cache and recreate volumes:
docker-compose -f <service-docker-compose-file-name.yml> down
docker-compose -f <service-docker-compose-file-name.yml> up --build --force-recreate --renew-anon-volumes
After starting the services, the frontend runs on > http://localhost:4000
Deployments are created automatically when a new push is done into dev
branch. To create a new deployment from other branches use [deploy]
in the commit messages.
For example:
AKR(Frontend): Added new translations [deploy]
The project uses the shared workspace configs. In order to keep code clean and easily maintainable please use the following VS Code Extensions.
To reformat all frontend files, run:
npm run <project-name>:lint
Prettier Java is used as a code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules.
To reformat all Java files in a project, run:
mvn validate
CI/CD validates that the files are formatted properly.
If you are using an IDE such as IntelliJ, you might want to configure it to organize imports.
For IntelliJ, you can use the following configurations:
ìmport *
is disabled:
Code Style -> Java -> Imports:
Class count to use import with '*': 999
Names count to use static import with '*': 999
To create a useful revision history the guidelines of Conventional Commits are broadly followed.
A commit message should be structured as follows:
service(scope): <description>
service: AKR, VKT, OTR, YKI, and SHARED
scope: Frontend, Backend, Docs, Infra
description: Informal description
For example:
AKR(Frontend): Added new translations
Jira ticket numbers are used as branch names without any extra suffixes.
Used prefixes are feature
, hotfix
, and release
. Below are some examples.
feature/<ticket-number> ----> feature/OPHAKRKEH-250
hotfix/<service-name> ----> hotfix/akr
release/<service-name/<date> ----> release/akr/2022-04-12