This repository contains the source for the backend API for the Netzgrafik-Editor frontend.
- Spring Framework with Spring Boot is used to implement the REST API.
- Data is stores in the PostgreSQL relational database.
- jOOQ is used to access the database through a database-independent SQL-Like Domain-Specific-Language. For that the jOOQ framework generates classes for every table, row, index and sequence in the database. This allows for type-save declarations of SQL queries.
- Flyway migrations are used to manage the database schema (see src/main/resources/db.migration).
- Project Lombok enhances the Java code with additional language features.
- H2 is used as an in-memory database for end-to-end integration tests.
- Java JDK
- Maven
- Docker and
docker-compose
-
Clone the repository:
git clone https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-backend.git cd netzgrafik-editor-backend
-
Start the local development environment (PostgreSQL, Keycloak):
docker compose up -d
-
Setup environment variables
export DB_URL=jdbc:postgresql://localhost/netzgrafikeditor export DB_USER=netzgrafikeditor export DB_PASSWORD=netzgrafikeditor export CORS_ALLOWED_ORIGINS=* export AUTH_SERVICE_NAME=fc44839c-e95f-4854-a52d-449867a9aa62
-
Run database migrations
# run migrations mvn flyway:migrate
- The database schema is managed using Flyway. Migrations are placed
under
src/main/resources/db/migration
and can be executed using maven.
- The database schema is managed using Flyway. Migrations are placed
under
-
Start the app using maven
mvn spring-boot:run
This project is licensed under Apache 2.0.
This repository includes a CONTRIBUTING.md file that outlines how to contribute to the project, including how to submit bug reports, feature requests, and pull requests.
This repository includes a CODING_STANDARDS.md file that outlines the coding standards that you should follow when contributing to the project.
To ensure that your project is a welcoming and inclusive environment for all contributors, you should establish a good CODE_OF_CONDUCT.md