Skip to content
Closed
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
16 changes: 0 additions & 16 deletions example/basyx/aas-env.properties

This file was deleted.

95 changes: 47 additions & 48 deletions example/README.md → examples/minimalExample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ The setup includes a complete tech stack with services for AAS registry, reposit

This example includes 5 standardized submodel templates from the **Digital Product Passport for Industry 4.0**:

- **Nameplate**
- **MaintenanceInstructions**
- **TechnicalData**
- **CarbonFootprint**
- **HandoverDocumentation**
- **Nameplate**
- **MaintenanceInstructions**
- **TechnicalData**
- **CarbonFootprint**
- **HandoverDocumentation**

## Quick Start

Expand All @@ -26,34 +26,30 @@ Before running the demonstrator, ensure you have installed:
- **Docker Compose** (v1.29+) — Usually included with Docker Desktop
- **Available Ports** — The following ports must be available on your machine:
- `8080` — Main API Gateway (nginx)
- `8081` - PGAdmin
- `8081` PGAdmin

### Running the Setup

1. **Clone or extract this repository:**
```bash
git clone https://github.com/AAS-TwinEngine/AAS.TwinEngine.DataEngine.git
```
2. **Go Inside example Folder**

```bash
cd AAS.TwinEngine.DataEngine\example
```

2. **Start all services:**
2. **Navigate to the minimal example folder:**
```bash
docker-compose up -d
cd AAS.TwinEngine.DataEngine/examples/minimalExample
```

3. **Access the Web UI:**
3. **Start all services:**
```bash
docker compose up -d
```
4. **Access the Web UI:**
Open your browser and navigate to:
```
http://localhost:8080/aas-ui/
```

4. **Stop all services:**
5. **Stop all services:**
```bash
docker-compose down
docker compose down
```

## Architecture & Services
Expand All @@ -65,20 +61,24 @@ The docker-compose setup includes the following services, all running on a share
| Service | Port | Image | Purpose |
|---------|------|-------|----------|
| **nginx** | 8080 | `nginx:trixie-perl` | API Gateway & Web UI proxy |
| **twinengine-dataengine** | - | `ghcr.io/aas-twinengine/dataengine:1.0.0` | Main TwinEngine DataEngine service |
| **template-repository** | - | `eclipsebasyx/aas-environment:2.0.0-SNAPSHOT` | AAS Environment & Submodel repository |
| **aas-template-registry** | - | `eclipsebasyx/aas-registry-log-mongodb:2.0.0-SNAPSHOT` | AAS Shell Descriptor Registry |
| **sm-template-registry** | - | `eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT` | Submodel Descriptor Registry |
| **dpp-plugin** | - | `ghcr.io/aas-twinengine/plugindpp:1.0.0` | Digital Product Passport Plugin |
| **twinengine-dataengine** | - | `ghcr.io/aas-twinengine/dataengine:develop` | Main TwinEngine DataEngine service |
| **template-repository-registry** | 8082 | `eclipsebasyx/aasenvironment-go:SNAPSHOT` | AAS Environment & Submodel repository (BaSyx Go) |
| **dpp-plugin** | - | `ghcr.io/aas-twinengine/plugindpp:develop` | Digital Product Passport Plugin |
| **aas-web-ui** | — | `eclipsebasyx/aas-gui:SNAPSHOT` | Web User Interface (served via nginx) |

### Infrastructure Services

| Service | Port | Image | Purpose |
|---------|------|-------|----------|
| **postgres** | - | `postgres:16-alpine` | Relational database for plugin data |
| **basyx_configuration** | - | `eclipsebasyx/basyxconfigurationservice-go:SNAPSHOT` | Initializes BaSyx Go database schema |
| **postgres** | - | `postgres:16-alpine` | Relational database for plugin and BaSyx Go data |
| **pgadmin** | 8081 | `dpage/pgadmin4:snapshot` | Web UI for managing PostgreSQL database |
| **mongo** | - | `mongo:6.0` | NoSQL database for registry metadata |

Notes:

- `postgres` hosts both databases: `twinengine` (plugin data) and `basyxTestDB` (BaSyx Go data).
- DB initialization scripts are in [../shared/postgres](../shared/postgres).
- The setup uses the BaSyx Go stack — no Java or MongoDB services.

## Creating/Changing Your AAS-Data

Expand Down Expand Up @@ -110,61 +110,60 @@ PGAdmin provides a web-based interface to manage the PostgreSQL database without

**How changes affect the Plugin:**
- Updates to application data (e.g., shell records, submodels, submodel element values) are reflected in what the Plugin serves.
- Submodel and shell templates are managed by BaSyx services and are not modified via PostgreSQL.
- Submodel and shell templates are managed by BaSyx Go services and are not modified via PostgreSQL.

--
---

## Additional Notes

### PostgreSQL Database (Plugin)

If desired, you can edit credentials in `docker-compose.yml`:
```yaml
POSTGRES_PASSWORD: admin
POSTGRES_PASSWORD: admin
```

Update plugin connection string to match. Edit `example/postgres/init.sql` for custom schema/data.
Update the plugin connection string to match. Edit `../shared/postgres/` scripts for custom schema/data.

**Using an External Database:**
**Using an External Database:**
To use your own database instead:
1. Change `RelationalDatabaseConfiguration__ConnectionString` in the plugin service environment variables
2. Remove the postgres container from `docker-compose.yml`

**Database Initialization:**
The initial database script is located in `postgres/init.sql`. Modify this file as needed for your requirements.

**Security and Production Notice**

Change all default passwords before any use beyond local development. Default credentials (postgres: admin) are for **development** only.

In production, hosting and managing the PostgreSQL database is the customer's responsibility, not the DataEngine's. Use a managed or self-hosted, production-grade PostgreSQL instance and configure the plugin connection string accordingly.

**Database Initialization:**
The initial database scripts are in `../shared/postgres/`. Modify these files as needed for your requirements.

### Port Changes

Modify port mappings in `docker-compose.yml`. Update corresponding environment variables in affected services.

### Security Note
### Security and Production Notice

Change all default passwords before any use beyond local development. Default credentials (postgres: admin) are for **development** only.

**Change default passwords before any use beyond local development.** Default credentials (postgres: admin) are for development only.
In production, hosting and managing the PostgreSQL database is the customer's responsibility, not the DataEngine's. Use a managed or self-hosted, production-grade PostgreSQL instance and configure the plugin connection string accordingly.

In production: use a secure API gateway (Azure API Management, AWS API Gateway, Kong), and manage database security (encryption, access control, backups) is a customer responsibility.
*Do not use this Docker Compose configuration in production.*

---

## Troubleshooting

**UI not loading:** `docker-compose logs nginx` - Verify ports 8080-8086 are available.
**UI not loading:** `docker compose logs nginx` Verify ports 8080 and 8081 are available.

**Port conflicts:** `netstat -ano | findstr :8080` (Windows) to find conflicts. Change ports in `docker-compose.yml`.

**Startup issues:** Run `docker-compose pull` followed by `docker-compose up -d --force-recreate`
**Startup issues:** Run `docker compose pull`

**Database errors:** Check `docker-compose ps` for health status. Verify connection strings match credentials.

**PGAdmin not accessible:** Verify the postgres service is healthy with `docker-compose ps`. Check port mappings are correctly configured.
**Database errors:** Check `docker compose ps` for health status. Verify connection strings match credentials.

**PGAdmin not accessible:** Verify the postgres service is healthy with `docker compose ps`. Check port mappings are correctly configured.

**Schema/init changed — recreate volumes:**
```bash
docker compose down -v
docker compose up -d
```

## Additional Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ services:
ports:
- "8080:80"
volumes:
- ./nginx/html:/usr/share/nginx/html
- ./nginx/default.conf.template:/etc/nginx/templates/default.conf.template
- ../shared/nginx/html:/usr/share/nginx/html
- ../shared/nginx/default.conf.template:/etc/nginx/templates/default.conf.template
restart: always
depends_on:
aas-template-registry:
condition: service_healthy
sm-template-registry:
condition: service_healthy
template-repository:
condition: service_healthy
template-repository-registry:
condition: service_started
networks:
- twinengine-network

Expand Down Expand Up @@ -62,35 +58,20 @@ services:
- TemplateManagement__TemplateMappingRules__AasIdExtractionRules__0__Pattern=/
- TemplateManagement__TemplateMappingRules__AasIdExtractionRules__0__Index=5
- TemplateManagement__AasTemplateRepository__Name=AasTemplateRepository
- TemplateManagement__AasTemplateRepository__baseUrl=http://template-repository:8081
- TemplateManagement__AasTemplateRepository__headerMappings__0__source=Authorization
- TemplateManagement__AasTemplateRepository__headerMappings__0__target=Authorization
- TemplateManagement__AasTemplateRepository__headerMappings__0__required=false
- TemplateManagement__AasTemplateRepository__healthEndpoint=/actuator/health
- TemplateManagement__AasTemplateRepository__baseUrl=http://template-repository-registry:8082
- TemplateManagement__AasTemplateRepository__healthEndpoint=/health
- TemplateManagement__SubmodelTemplateRepository__Name=SubmodelTemplateRepository
- TemplateManagement__SubmodelTemplateRepository__baseUrl=http://template-repository:8081
- TemplateManagement__SubmodelTemplateRepository__headerMappings__0__source=Authorization
- TemplateManagement__SubmodelTemplateRepository__headerMappings__0__target=Authorization
- TemplateManagement__SubmodelTemplateRepository__headerMappings__0__required=false
- TemplateManagement__SubmodelTemplateRepository__healthEndpoint=/actuator/health
- TemplateManagement__SubmodelTemplateRepository__baseUrl=http://template-repository-registry:8082
- TemplateManagement__SubmodelTemplateRepository__healthEndpoint=/health
- TemplateManagement__ConceptDescriptionTemplateRepository__Name=ConceptDescriptionTemplateRepository
- TemplateManagement__ConceptDescriptionTemplateRepository__baseUrl=http://template-repository:8081
- TemplateManagement__ConceptDescriptionTemplateRepository__headerMappings__0__source=Authorization
- TemplateManagement__ConceptDescriptionTemplateRepository__headerMappings__0__target=Authorization
- TemplateManagement__ConceptDescriptionTemplateRepository__headerMappings__0__required=false
- TemplateManagement__ConceptDescriptionTemplateRepository__healthEndpoint=/actuator/health
- TemplateManagement__ConceptDescriptionTemplateRepository__baseUrl=http://template-repository-registry:8082
- TemplateManagement__ConceptDescriptionTemplateRepository__healthEndpoint=/health
- TemplateManagement__AasTemplateRegistry__Name=AasTemplateRegistry
- TemplateManagement__AasTemplateRegistry__baseUrl=http://aas-template-registry:8080
- TemplateManagement__AasTemplateRegistry__headerMappings__0__source=Authorization
- TemplateManagement__AasTemplateRegistry__headerMappings__0__target=Authorization
- TemplateManagement__AasTemplateRegistry__headerMappings__0__required=false
- TemplateManagement__AasTemplateRegistry__healthEndpoint=/actuator/health
- TemplateManagement__AasTemplateRegistry__baseUrl=http://template-repository-registry:8082
- TemplateManagement__AasTemplateRegistry__healthEndpoint=/health
- TemplateManagement__SubmodelTemplateRegistry__Name=SubmodelTemplateRegistry
- TemplateManagement__SubmodelTemplateRegistry__baseUrl=http://sm-template-registry:8080
- TemplateManagement__SubmodelTemplateRegistry__headerMappings__0__source=Authorization
- TemplateManagement__SubmodelTemplateRegistry__headerMappings__0__target=Authorization
- TemplateManagement__SubmodelTemplateRegistry__headerMappings__0__required=false
- TemplateManagement__SubmodelTemplateRegistry__healthEndpoint=/actuator/health
- TemplateManagement__SubmodelTemplateRegistry__baseUrl=http://template-repository-registry:8082
- TemplateManagement__SubmodelTemplateRegistry__healthEndpoint=/health
networks:
- twinengine-network

Expand Down Expand Up @@ -129,49 +110,64 @@ services:
networks:
- twinengine-network

template-repository:
image: eclipsebasyx/aas-environment:2.0.0-SNAPSHOT
container_name: template-repository
template-repository-registry:
image: eclipsebasyx/aasenvironment-go:SNAPSHOT
container_name: template-repository-registry
pull_policy: always
command: ["/app/aasenvironmentservice"]
volumes:
- ./aas:/application/aas
- ./basyx/aas-env.properties:/application/application.properties
- ../shared/aas:/app/preconfiguration:ro
environment:
BASYX_EXTERNALURL : http://localhost:8080
- SERVER_PORT=8082
- CORS_ALLOWEDORIGINS=*
- CORS_ALLOWEDHEADERS=*
- CORS_ALLOWEDCREDENTIALS=true
- CORS_ALLOWEDMETHODS=GET,OPTIONS
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
- POSTGRES_DBNAME=basyxTestDB
- POSTGRES_MAXOPENCONNECTIONS=500
- POSTGRES_MAXIDLECONNECTIONS=500
- POSTGRES_CONNMAXLIFETIMEMINUTES=5
- ABAC_ENABLED=false
- GENERAL_AASREGISTRYINTEGRATION=true
- GENERAL_SUBMODELREGISTRYINTEGRATION=true
- GENERAL_DISCOVERYINTEGRATION=true
- GENERAL_EXTERNALURL=http://localhost:8080
- GENERAL_AAS_PRECONFIG_PATHS=/app/preconfiguration
restart: always
depends_on:
aas-template-registry:
condition: service_healthy
sm-template-registry:
condition: service_healthy
basyx_configuration:
condition: service_completed_successfully
networks:
- twinengine-network

aas-template-registry:
image: eclipsebasyx/aas-registry-log-mongodb:2.0.0-SNAPSHOT
container_name: aas-template-registry
restart: always
depends_on:
- mongo
basyx_configuration:
container_name: basyx_configuration
image: eclipsebasyx/basyxconfigurationservice-go:SNAPSHOT
pull_policy: always
environment:
- SPRING_DATA_MONGODB_URI=mongodb://mongoAdmin:mongoPassword@mongo:27017
networks:
- twinengine-network

sm-template-registry:
image: eclipsebasyx/submodel-registry-log-mongodb:2.0.0-SNAPSHOT
container_name: sm-template-registry
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=admin
- POSTGRES_DBNAME=basyxTestDB
- POSTGRES_MAXOPENCONNECTIONS=500
- POSTGRES_MAXIDLECONNECTIONS=500
- POSTGRES_CONNMAXLIFETIMEMINUTES=5
depends_on:
- mongo
environment:
- SPRING_DATA_MONGODB_URI=mongodb://mongoAdmin:mongoPassword@mongo:27017
postgres:
condition: service_healthy
networks:
- twinengine-network

aas-web-ui:
image: eclipsebasyx/aas-gui:SNAPSHOT
container_name: aas-ui
volumes:
- ./logo:/usr/src/app/dist/Logo
- ../shared/logo:/usr/src/app/dist/Logo
environment:
AAS_REGISTRY_PATH: http://localhost:8080/shell-descriptors
SUBMODEL_REGISTRY_PATH: http://localhost:8080/submodel-descriptors
Expand All @@ -184,17 +180,8 @@ services:
PRIMARY_LIGHT_COLOR: "#041b2b"
restart: always
depends_on:
template-repository:
condition: service_healthy
networks:
- twinengine-network

mongo:
image: mongo:6.0
container_name: mongo
environment:
MONGO_INITDB_ROOT_USERNAME: mongoAdmin
MONGO_INITDB_ROOT_PASSWORD: mongoPassword
template-repository-registry:
condition: service_started
networks:
- twinengine-network

Expand All @@ -206,7 +193,7 @@ services:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
volumes:
- ./postgres:/docker-entrypoint-initdb.d
- ../shared/postgres:/docker-entrypoint-initdb.d
- postgres-data:/var/lib/postgresql/data
restart: always
healthcheck:
Expand Down
Loading
Loading