Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/build-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Push UI Container

on:
schedule:
- cron: "0 10 * * *" # every day at 10am
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
build-ui:
name: Build UI Container
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: ui/fhir-place/package-lock.json

- name: Install dependencies
working-directory: ui/fhir-place
run: npm ci

- name: Initialize database
working-directory: ui/fhir-place
run: npm run db:init

- name: Run tests
working-directory: ui/fhir-place
run: npm test

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/fhir-ui
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}

- name: Build and push UI container
uses: docker/build-push-action@v5
with:
context: ui/fhir-place
file: ui/fhir-place/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ part of BBMRI-ERIC. This tool should support ETL processes by providing the foll


## Glossary
- [Deployment](/docs/DEPLOYMENT.md)
- [Data model](/docs/DATA_MODEL.md)
- [Maps](/docs/MAPS.md)
- [Deployment Guide](/docs/DEPLOYMENT.md)
- [User Interface (UI)](/docs/UI.md)
- [Data Model](/docs/DATA_MODEL.md)
- [Security](/docs/SECURITY.md)
- [Monitoring](/docs/MONITORING.md)
- [Maps Documentation](/docs/MAPS.md)
- [Contributing](/docs/CONTRIBUTING.md)

## State
Expand Down
30 changes: 19 additions & 11 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,28 @@ services:
target: "/opt/records"
- fhir-logs:/var/log/fhir-module

fhir-ui:
image: ghcr.io/bbmri-cz/fhir-ui:latest
container_name: fhir-ui
profiles:
- ui
networks:
- fhir-integration
- monitoring
ports:
- "3000:3000"
env_file:
- .env
volumes:
- ui-data:/app/data
depends_on:
- fhir-module
restart: unless-stopped

prometheus:
image: prom/prometheus:latest
profiles:
- monitoring
depends_on:
config-generator:
condition: service_completed_successfully
required: false
networks:
- monitoring
ports:
Expand Down Expand Up @@ -88,18 +102,12 @@ services:
container_name: promtail
profiles:
- monitoring
depends_on:
config-generator:
condition: service_completed_successfully
required: false
networks:
- monitoring
volumes:
- fhir-logs:/var/log/fhir-module:ro
- promtail-config:/etc/promtail
- promtail-positions:/etc/promtail/positions
command: -config.file=/etc/promtail/promtail-config.yaml
restart: unless-stopped

networks:
fhir-integration:
Expand All @@ -110,4 +118,4 @@ volumes:
prometheus-config:
fhir-logs:
promtail-config:
promtail-positions:
ui-data:
65 changes: 65 additions & 0 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,51 @@ if connection to the Blaze was successful, you should see the following line:

` Starting sync with Blaze 🔥!`

### UI Deployment

The FHIR module includes a web-based user interface that provides monitoring and control capabilities. The UI is deployed alongside the main application.

#### Running the UI

To deploy both the FHIR module and the UI:

```shell
# Production deployment with UI
docker compose --profile prod up -d

# Development deployment with UI
docker compose --profile dev up -d
```

#### Running the UI

Building the container:

```shell
# Build the docker container with the
docker build ./ui/fhir-place -t ghcr.io/bbmri-cz/fhir-ui:latest
```

The UI will be available at [http://localhost:3000](http://localhost:3000).

#### UI-specific logs

To check the UI application logs:

```shell
docker logs fhir-ui -f
```

#### First-time Setup

On first deployment, the UI will automatically:

1. Initialize the SQLite database
2. Create default user accounts
3. Set up authentication system

**Important**: Make sure to set the `NEXTAUTH_SECRET` environment variable to a secure random string in production environments.

### Environment variables

The FHIR module is configured via environment variables, all of which can be found below. To override the default value,
Expand Down Expand Up @@ -79,6 +124,26 @@ The following environment variables are used for configuring monitoring and logg
| GRAFANA_LOGS_USERNAME | _empty_ | Username for authentication with Grafana Cloud logs service for centralized log aggregation. |
| GRAFANA_LOGS_PASSWORD | _empty_ | Password or API key for authentication with Grafana Cloud logs service for centralized log aggregation. |

#### UI Application Variables

The following environment variables are used to configure the Next.js UI application:

| Variable name | Default value | Description |
| ------------------------------ | --------------------------------- | ---------------------------------------------------------------------------- |
| NODE_ENV | development | Node.js environment mode (development/production) |
| PORT | 3000 | Port on which the UI application runs |
| NEXTAUTH_SECRET | _required_ | Secret key for NextAuth.js session encryption. **Must be set in production** |
| AUTH_TRUST_HOST | false | Set to `true` for Docker deployment to trust proxy headers |
| BACKEND_API_URL | http://localhost:5000 | URL of the FHIR module backend API |
| PROMETHEUS_URL | http://prometheus:9090 | URL of the Prometheus metrics server |
| PASSWORD_MIN_LENGTH | 8 | Minimum password length requirement |
| PASSWORD_MAX_LENGTH | 128 | Maximum password length requirement |
| PASSWORD_REQUIRE_UPPERCASE | false | Require uppercase letters in passwords |
| PASSWORD_REQUIRE_LOWERCASE | false | Require lowercase letters in passwords |
| PASSWORD_REQUIRE_NUMBERS | false | Require numbers in passwords |
| PASSWORD_REQUIRE_SPECIAL_CHARS | false | Require special characters in passwords |
| PASSWORD_SPECIAL_CHARS | !@#$%^&\*()\_+-=[]{}&#124;;:,.<>? | Allowed special characters for passwords |

## Object mapping

The FHIR module uses dynamically configurable maps currently stored as json files
Expand Down
Loading
Loading