Skip to content

loic-hamelin/netzgrafik-editor-backend

 
 

Repository files navigation

Netzgrafik-Editor Backend API

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.

Getting-Started

Setup Development Environment

Prerequisites

  • Java JDK
  • Maven
  • Docker and docker-compose

Command line setup guide

  1. Clone the repository:

    git clone https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-backend.git
    cd netzgrafik-editor-backend
  2. Start the local development environment (PostgreSQL, Keycloak):

    docker compose up -d
  3. 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
  4. 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.
  5. Start the app using maven

    mvn spring-boot:run

License

This project is licensed under Apache 2.0.

Contributing

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.

Coding Standards

This repository includes a CODING_STANDARDS.md file that outlines the coding standards that you should follow when contributing to the project.

Code of Conduct

To ensure that your project is a welcoming and inclusive environment for all contributors, you should establish a good CODE_OF_CONDUCT.md

About

Backend for the Netzgrafik-Editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%