This project is part of IroCO2. You are not in the principal repository. For any general information about the project, please refer to the principal repository.
This is the backend of the IroCO2 application. Developed using Java 21 and Spring Boot 3.2.4.
- Java 21 (tested with Eclipse Temurin 21)
- Maven 3.8+
- Docker & Docker Compose (for local development and database)
- PostgreSQL (local or via Docker)
- Clone the repository:
git clone https://github.com/ippontech/iroco2-backend.git cd iroco2-backend
- Build the project:
mvn clean install
- Start the database and tools:
docker compose -f docker/local.docker-compose.yml up -d
- Run the backend (in another terminal):
mvn spring-boot:run
- Make sure a PostgreSQL instance is running and accessible (see
docker/local.docker-compose.yml
for env vars). - Update the
application.properties
or use environment variables as needed. - Run:
mvn spring-boot:run
domain/
: Domain model and business rulesinfrastructure/
: Infrastructure layer with Main Spring Boot application (external services, adapters)docker/
: Dockerfile, local development and CI tools (compose, scripts)docs/
: Backend documentationtf/
: Terraform infrastructure as code
- Unit and integration tests via Maven:
mvn test
- Cucumber BDD tests included
- Testcontainers used for integration tests (PostgreSQL, Localstack)
- Spring Security + JWT (see configuration in
infrastructure
module) - OAuth2 test support via
spring-addons-oauth2-test
We use Prettier Java to ensure consistent code formatting for Java files.
- Install Node modules:
npm ci
- (Recommended) Install the File Watchers plugin in your IDE and configure it as follows:
- Name: Prettier Java
- File Type: Java
- Program: npx
-
Arguments: prettier --write
$FilePath$ -
Output path to refresh:
$FilePath$ - Trigger the watcher on external changes: checked
- Autosave edited files to trigger the watcher: checked
npx prettier --write "**/*.java"
By default, Git on Windows may convert line endings (LF β CRLF). Our Prettier config enforces LF. To avoid unwanted conversions, run one of the following:
git config --system core.autocrlf false # per-system
git config --global core.autocrlf false # per-user
git config --local core.autocrlf false # per-project
We use SonarQube for static code analysis and code quality.
docker compose -f docker/local.docker-compose.yml up
- Access SonarQube at http://localhost:9001
- Login:
admin
/admin
(change the password after first login) - Create a new project named
iroco-backend
with default branchdevelop
- Choose "locally" analysis mode and generate a new token
- Export the token as an environment variable:
export LOCAL_SONAR_TOKEN=your_token_here
- Run analysis:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent verify sonar:sonar \ -Dsonar.projectKey=iroco-backend \ -Dsonar.host.url=http://localhost:9001 \ -Dsonar.login=$LOCAL_SONAR_TOKEN
After building the Java application, you will need to build and push the docker image to your repository. Use the Dockerfilek in the docker/
directory.
Then you can deploy the application using Terraform.
WIP: More docs to come.
Distributed under the Apache 2.0 License. See LICENSE for more information.
See docs/ for technical documentation.
For ADRs and workflow documentation, see the [principal repository](https://github.com/ippontech/iroco2/blob/main/contribute/adr/ and https://github.com/ippontech/iroco2/tree/main/contribute/workflows).
See CONTRIBUTING.md