Skip to main content

Quick Start Guide

This guide will help you get HERCULES SGI up and running quickly. Follow these steps to deploy a local development or production instance.
This quick start focuses on a Docker-based deployment for simplicity. For production deployments, refer to the deployment guide.

Prerequisites

Before you begin, ensure you have the following installed:

Required Software

1

Java Development Kit 11+

HERCULES SGI backend services require Java 11 or later. We recommend using Eclipse Temurin (formerly AdoptOpenJDK).
# Verify Java installation
java -version
# Should show version 11 or higher
The production Docker images use Eclipse Temurin 21 JRE Alpine for optimal performance.
2

PostgreSQL 12+

The system uses PostgreSQL as the primary database. Oracle and SQL Server are also supported.
# Install PostgreSQL (example for Ubuntu/Debian)
sudo apt-get install postgresql-12
3

Keycloak 11.0.0

Authentication and authorization are handled by Keycloak.
# Download Keycloak 11.0.0
wget https://github.com/keycloak/keycloak/releases/download/11.0.0/keycloak-11.0.0.tar.gz
tar -xzf keycloak-11.0.0.tar.gz
4

Node.js 12+ and npm

Required for building the Angular frontend application.
# Verify Node.js installation
node --version  # Should be v12 or higher
npm --version
5

Maven 3.6+

Required for building the Java backend services.
# Verify Maven installation
mvn --version  # Should be 3.6 or higher

Quick Setup with Docker

Make sure Docker and Docker Compose are installed and running on your system.

Step 1: Clone the Repository

# Clone the HERCULES SGI repository
git clone https://github.com/HerculesCRUE/SGI.git
cd SGI

Step 2: Configure Keycloak

1

Start Keycloak

# Navigate to Keycloak directory
cd keycloak-11.0.0/bin

# Start Keycloak in standalone mode
./standalone.sh
2

Create SGI Realm

  1. Access Keycloak Admin Console at http://localhost:8080/auth
  2. Create a new realm named sgi
  3. Configure the OAuth2 clients as specified in the configuration files
3

Configure OAuth2 Clients

Create the following clients in the sgi realm:Frontend Client (front):
Client ID: front
Client Protocol: openid-connect
Access Type: public
Valid Redirect URIs: http://localhost:4200/*
Service Clients (for each microservice):
Client ID: csp-service
Client Protocol: openid-connect
Access Type: confidential
Service Accounts Enabled: true
Authorization Enabled: true

Step 3: Build Backend Services

# Build all backend services
mvn clean install -DskipTests

# Or build individual services
cd sgi-csp-service
mvn clean package -DskipTests
The build process creates executable JAR files in each service’s target/ directory.

Step 4: Prepare Docker Images

# Extract dependencies for Docker layering (example for CSP service)
cd sgi-csp-service
mkdir -p target/dependency
cd target/dependency
jar -xf ../*.jar

# Build Docker image
cd ../..
docker build -t sgi-csp-service:latest .
Each service includes a Dockerfile:
# Example: sgi-csp-service/Dockerfile
FROM eclipse-temurin:21-jre-alpine

EXPOSE 8080

COPY target/dependency/BOOT-INF/lib /app/lib
COPY target/dependency/META-INF /app/META-INF
COPY target/dependency/BOOT-INF/classes /app

ENTRYPOINT java -Duser.timezone=UTC -Djava.security.egd=file:/dev/./urandom -cp "app:app/lib/*" org.crue.hercules.sgi.csp.CspApplication

Step 5: Configure Database

1

Create Databases

Create separate databases for each service:
-- PostgreSQL example
CREATE DATABASE csp;
CREATE DATABASE eti;
CREATE DATABASE pii;
CREATE DATABASE prc;
CREATE DATABASE cnf;
CREATE DATABASE com;
CREATE DATABASE usr;
CREATE DATABASE rep;
CREATE DATABASE rel;
CREATE DATABASE eer;
CREATE DATABASE tp;

-- Create schemas
CREATE SCHEMA IF NOT EXISTS csp;
CREATE SCHEMA IF NOT EXISTS eti;
-- ... repeat for each service
2

Update Configuration

Edit application.yml for each service to point to your database:
spring:
  datasource:
    url: "jdbc:postgresql://postgres:5432/csp"
    driver-class-name: org.postgresql.Driver
    username: postgres
    password: your_password
  jpa:
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQL10Dialect
        '[default_schema]': csp
3

Run Liquibase Migrations

The system uses Liquibase for database schema management. Migrations run automatically on first startup.
spring:
  liquibase:
    enabled: true
    contexts: dev
    default-schema: csp

Step 6: Build and Start Frontend

# Navigate to webapp directory
cd sgi-webapp

# Install dependencies
npm install

# Build the Angular framework
ng build sgi-framework-angular

# Start development server
npm start
The web application will be available at http://localhost:4200.
The frontend build includes a custom CKEditor 5 build for rich text editing capabilities.

Step 7: Start Microservices

Start each backend service individually or use a process manager:
# Start CSP Service (Grants, Applications & Projects)
cd sgi-csp-service
java -jar target/sgi-csp-service-1.1.0-SNAPSHOT.jar --spring.profiles.active=dev

# Start ETI Service (Ethics)
cd sgi-eti-service
java -jar target/sgi-eti-service-1.1.0-SNAPSHOT.jar --spring.profiles.active=dev

# Repeat for other services...
Ensure services start in the correct order. Configuration (CNF) and User (USR) services should start first as other services depend on them.

Default Ports

Each service runs on a dedicated port:
ServicePortDescription
sgi-webapp4200Angular frontend
sgi-auth (Keycloak)8080Authentication service
sgi-eti-service4280Ethics service
sgi-csp-service4281Grants/Projects service
sgi-tp-service4285Scheduled tasks service
sgi-com-service4286Communications service
sgi-rep-service4287Reporting service
sgi-cnf-service4288Configuration service

First Login

1

Access the Application

Navigate to http://localhost:4200 in your web browser.
2

Keycloak Authentication

You’ll be redirected to the Keycloak login page at:
http://localhost:8080/auth/realms/sgi/protocol/openid-connect/auth
3

Login with Credentials

Use the credentials configured in Keycloak for your initial admin user.
4

Explore the Dashboard

After successful authentication, you’ll see the main HERCULES SGI dashboard with access to:
  • Convocatorias (Funding Calls)
  • Proyectos (Projects)
  • Ética (Ethics Reviews)
  • Producción Científica (Scientific Production)
  • Propiedad Industrial (Intellectual Property)

Verify Installation

Check that all services are running correctly:
# Check service health endpoints
curl http://localhost:4281/actuator/health  # CSP Service
curl http://localhost:4280/actuator/health  # ETI Service
curl http://localhost:4288/actuator/health  # CNF Service
Expected response:
{
  "status": "UP"
}

Configuration Profiles

HERCULES SGI supports multiple Spring profiles:
  • dev: Development mode with H2 database and debug logging
  • dev-oracle: Development with Oracle database
  • dev-sqlserver: Development with SQL Server database
  • prod: Production mode with PostgreSQL
Activate profiles using:
java -jar service.jar --spring.profiles.active=prod

Next Steps

Architecture Overview

Learn about the system architecture and microservices

Configuration Guide

Configure the system for your institution

User Management

Set up users, roles, and permissions

Core Modules

Explore the core research management modules

Troubleshooting

Verify that PostgreSQL is running and accessible:
psql -U postgres -h localhost -p 5432
Check the database URL in application.yml matches your PostgreSQL configuration.
Ensure:
  1. Keycloak is running on port 8080
  2. The sgi realm is created
  3. OAuth2 clients are properly configured
  4. The issuer-uri in application.yml is correct
Check browser console for errors. Common issues:
  1. Backend services not running
  2. CORS configuration issues
  3. Keycloak client configuration mismatch
If migrations fail, check:
# View Liquibase logs
tail -f logs/application.log | grep liquibase
Ensure the database user has schema creation privileges.

Build docs developers (and LLMs) love