A demonstrator UI API server for the Connector Fabric Manager platform. Redline is a fictitious cloud service provider offering managed dataspace services to multiple industries. Redline (the UI API server) is built using Spring Boot.
- Keycloak integration for authentication
- PostgreSQL and H2 database support
- Java 21 (LTS) JDK
- Gradle (or use the included wrapper -
./gradlew) - PostgreSQL (for production profile)
- Keycloak server (for authentication)
The development profile uses an in-memory H2 database:
./gradlew bootRun --args='--spring.profiles.active=dev'Access H2 Console at: http://localhost:8081/h2-console
- JDBC URL:
jdbc:h2:mem:redlinedb - Username:
sa - Password: (leave empty)
The production profile uses PostgreSQL. Set the following environment variables:
export DATABASE_URL=jdbc:postgresql://localhost:5432/redlinedb
export DATABASE_USERNAME=redline
export DATABASE_PASSWORD=your_password
./gradlew bootRun --args='--spring.profiles.active=prod'The easiest way to get started is using Docker Compose, which will start both PostgreSQL and Keycloak:
# Start PostgreSQL and Keycloak
docker-compose up -d
# Check logs
docker-compose logs -f
# Stop services
docker-compose downAfter starting the services:
- Keycloak Admin Console: http://localhost:8080 (admin/admin)
- PostgreSQL: localhost:5432 (redline/redline)
Set these environment variables to configure Keycloak:
export KEYCLOAK_ISSUER_URI=http://localhost:8080/realms/your-realm
export KEYCLOAK_JWK_SET_URI=http://localhost:8080/realms/your-realm/protocol/openid-connect/certs- Start Keycloak server
- Create a new realm (e.g., "redline")
- Create a client for your application
- Configure the client:
- Access Type: bearer-only or public
- Valid Redirect URIs: http://localhost:8081/*
- Create roles (e.g., USER, ADMIN)
- Create users and assign roles
./gradlew buildUse the convenience script:
./run-dev.shOr run directly:
./gradlew bootRunThis starts the application with:
- H2 in-memory database
- H2 Console at http://localhost:8081/h2-console
- Server at http://localhost:8081
./gradlew bootRun --args='--spring.profiles.active=prod'The application will start on port 8081.
GET /api/public/health- Health checkGET /api/public/info- Application info
This application uses OAuth2 JWT tokens from Keycloak. To access protected endpoints:
- Obtain a JWT token from Keycloak
- Include the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" http://localhost:8081/api/users/meRun tests with:
./gradlew testThis project is licensed under the Apache 2.0 License.