- Übersicht
- Funktionen
- Technologie-Stack
- Projektstruktur
- Installation
- Nutzung
- Entwicklung
- Contribution Guidelines
- Dokumentation
RoleMapper ist ein leistungsstarkes System von FlowCraft AG, das dynamisches Mapping von Rollen und Berechtigungen in Unternehmen ermöglicht. Es bietet eine moderne Benutzeroberfläche sowie ein skalierbares Backend, das effiziente Rechteverwaltung und Prozessoptimierung unterstützt.
- Dynamisches Rollen-Mapping: Rollen werden basierend auf Benutzerfunktionen und organisatorischen Strukturen dynamisch zugewiesen.
- Zentrales Rechte-Management: Intuitive Verwaltung von Berechtigungen.
- Workflow-Integration: Unterstützung von Genehmigungs- und Automatisierungsprozessen mithilfe von Camunda BPM.(Z.B. starten von Prozessen und das verwalten von Prozessinstanzen)
- Responsives UI: Eine moderne, reaktionsschnelle Benutzeroberfläche mit Next.js und MUI (Material-UI).
- Framework: NestJS
- Programmiersprache: TypeScript
- Datenbank: MongoDB
- Authentifizierung: Keycloak
- Workflow-Engine: Camunda BPM
- Framework: Next.js
- Programmiersprache: TypeScript
- UI-Bibliothek: MUI (Material-UI)
.
├── .extras # Zusatzkonfigurationen und Dokumentationen
│ ├── camunda # Camunda-spezifische Dateien
│ │ ├── bpmn # BPMN-Modelle
│ │ ├── dienstreiseantrag # Beispielprozess für Dienstreiseanträge
│ │ │ ├── bpmn # BPMN-Modelle für Dienstreiseanträge
│ │ │ └── form # Formulare für Dienstreiseanträge
│ │ ├── dmn # Entscheidungsmodelle (DMN)
│ │ └── form # Formulare für Camunda-Prozesse
│ ├── compose # Docker-Compose-Konfigurationen
│ │ ├── backend # Backend-spezifische Compose-Dateien
│ │ │ └── keycloak # Keycloak-spezifische Konfigurationen
│ │ ├── camunda # Camunda-spezifische Compose-Dateien
│ │ │ └── full # Komplettes Camunda-Setup mit Keycloak
│ │ ├── frontend # Frontend-spezifische Compose-Dateien
│ │ ├── sonarqube # Konfiguration für SonarQube
│ │ └── zipkin # Zipkin-Konfiguration für Tracing
│ └── doc # Dokumentation für Zusatzmodule
│
├── .github # GitHub-spezifische Dateien
│ └── workflows # CI/CD-Workflows für GitHub Actions
│
├── .volumes # Persistente Volumes für Docker-Container
│ ├── camunda # Volumes für Camunda-Services
│ │ ├── elastic # Elasticsearch-Daten
│ │ │ └── data
│ │ ├── keycloak # Keycloak-Daten
│ │ │ └── keycloak-theme # Angepasste Keycloak-Themes
│ │ ├── kibana # Kibana-Daten
│ │ │ └── data
│ │ ├── operate # Operate-Daten
│ │ │ └── operate_tmp
│ │ ├── optimize # Optimize-Daten
│ │ ├── postgres # PostgreSQL-Datenbanken
│ │ │ ├── data # Hauptdatenbank
│ │ │ ├── pgadmin # pgAdmin-Daten
│ │ │ └── pgadmin4 # Weitere pgAdmin-Daten
│ │ ├── tasklist # Tasklist-Daten
│ │ │ └── tasklist_tmp
│ │ └── zeebe # Zeebe-Daten
│ │ └── data
│ └── keys # Schlüssel und Zertifikate
│
├── backend # Backend-Quellcode
│ ├── __tests__ # Testfälle für das Backend
│ ├── log # Backend-Logs
│ └── src # Hauptquellcode des Backends
│ ├── camunda # Camunda-Integration
│ │ ├── controller # API-Endpunkte
│ │ ├── resolver # GraphQL-Resolver
│ │ ├── service # Geschäftslogik
│ │ └── types # Typdefinitionen
│ │ ├── input-filter # Filter-Inputs für GraphQL
│ │ └── payload # Antwort-Payloads
│ ├── config # Konfigurationsdateien
│ │ └── resources # Ressourcen für Konfigurationen
│ │ └── graphql # GraphQL-Ressourcen
│ │ ├── camunda # Camunda-spezifische GraphQL-Ressourcen
│ │ └── rolemapper # RoleMapper-spezifische GraphQL-Ressourcen
│ ├── logger # Logging-Funktionalität
│ ├── role-mapper # Hauptlogik für Rollen-Mapping
│ │ ├── controller # API-Endpunkte
│ │ ├── error # Fehlerbehandlung
│ │ ├── model # Datenmodelle
│ │ │ ├── dto # Data Transfer Objects
│ │ │ ├── entity # Datenbank-Entitäten
│ │ │ ├── input # Eingabe-Objekte
│ │ │ ├── payload # Antwort-Payloads
│ │ │ └── types # Allgemeine Typdefinitionen
│ │ ├── resolver # GraphQL-Resolver
│ │ ├── service # Geschäftslogik
│ │ │ └── pipeline # Pipeline-Logik
│ │ └── utils # Hilfsfunktionen
│ └── security # Sicherheitsmodul
│ ├── http # HTTP-Sicherheitskonfiguration
│ └── keycloak # Keycloak-Integration
│
├── docs # Dokumentation
│ ├── backend # Backend-Dokumentation
│ └── frontend # Frontend-Dokumentation
│
└── frontend # Frontend-Quellcode
├── logs # Frontend-Logs
├── public # Statische Dateien
└── src # Hauptquellcode des Frontends
├── app # App-spezifische Logik
│ ├── api # API-Endpunkte
│ │ └── auth # Authentifizierungs-API
│ │ ├── [...nextauth]
│ │ ├── error
│ │ └── refresh-token
│ ├── camunda # Camunda-Prozessinstanzen
│ │ ├── [key] # Individueller Prozessinstanzen
│ │ └── myProcess # Eigene Prozesseinstanzen
│ ├── fonts # Schriftarten
│ ├── login # Login-Seiten
│ ├── organisationseinheiten # Organisationseinheiten-Logik
│ │ └── standard # Standardsicht-Organisationseinheiten
│ └── prozesse # Prozessliste
├── components # Wiederverwendbare UI-Komponenten
│ ├── bpmn # BPMN-Komponenten
│ ├── customs # Benutzerdefinierte Komponenten
│ ├── modal # Modale Dialoge
│ │ ├── functionModals
│ │ ├── orgUnitModals
│ │ ├── processModals
│ │ ├── rolesModal
│ │ └── userModals
│ ├── navigation # Navigationskomponenten
│ ├── organigramm # Organigramm-Komponenten
│ └── prozess # Prozess-Komponenten
├── graphql # GraphQL-Operationen
│ ├── auth # Authentifizierungs-Operationen
│ ├── functions # Funktionen
│ │ ├── mutation
│ │ └── query
│ ├── orgUnits # Organisationseinheiten
│ │ ├── mutation
│ │ └── query
│ ├── processes # Prozesse
│ │ ├── mutation
│ │ └── query
│ ├── rollen # Rollen
│ │ ├── mutation
│ │ └── query
│ └── users # Benutzer
│ └── query
├── hooks # React-Hooks
├── interfaces # Schnittstellendefinitionen
├── lib # Hilfsfunktionen
│ ├── api # API-Hilfsfunktionen
│ │ └── rolemapper # RoleMapper-spezifische API-Logik
│ └── camunda # Camunda-Hilfsfunktionen
├── styles # CSS-Styles
├── theme # Design-Themes
├── types # Typdefinitionen
└── utils # Allgemeine Hilfsfunktionen
-
Windows/Mac: Lade Docker Desktop herunter und installiere es.
-
Linux: Installiere Docker mit:
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io
-
Repository klonen:
git clone https://github.com/flowcraft-ag/rolemapper.git cd rolemapper
-
Abhängigkeiten installieren:
-
Backend:
cd backend npm install
-
Frontend:
cd ../frontend npm install
-
-
Schlüssel und Zertifikate erstellen:
-
Erstelle den Ordner
.volumes/keys
(falls nicht vorhanden):mkdir -p .volumes/keys
-
TLS-Schlüssel und -Zertifikate erstellen:
-
Mac/Linux:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout .volumes/keys/key.pem -out .volumes/keys/certificate.crt
-
Windows (PowerShell):
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout .volumes/keys/key.pem -out .volumes/keys/certificate.crt
Hinweis: Stelle sicher, dass der Pfad zur
openssl
-Binärdatei korrekt in deinem System hinterlegt ist. -
-
Konvertiere
.crt
und.pem
in.p12
für Keycloak:openssl pkcs12 -export -in .volumes/keys/certificate.crt -inkey .volumes/keys/key.pem -out .volumes/keys/keycloak.p12 -name keycloak -passout pass:changeit
-
-
Umgebungsvariablen konfigurieren:
-
Backend (.env):
MONGO_URI=mongodb+srv://<username>:<password>@<cluster-url>/<database>?retryWrites=true&w=majority MONGODB_DATABASE=<database> TEST_MONGODB_URI=mongodb+srv://<username>:<password>@<cluster-url>/<database>?retryWrites=true&w=majority TEST_MONGODB_DATABASE=Test NVD_API_KEY = <nvd-api-token> #optional SNYK_TOKEM = <synk-token> #optional KEYCLOAK_CLIENT_SECRET=<keycloak-secret> # NODE_ENV = test NODE_ENV=development CAMUNDA_TASKLIST_API_URL=http://localhost:8082/v1 (default) CAMUNDA_OPERATE_API_URL=http://localhost:8081/v1 (default) REQUEST_TIMEOUT_MS=5000 #default 5 Sekunden GRAPHQL_SCHEMA=true #default
-
Frontend (.env):
NODE_TLS_REJECT_UNAUTHORIZED=0 #Nur bei der Entwicklung mit selbstsigniertem Zertifikat KEYCLOAK_CLIENT_ID=<keycloak-client-id> KEYCLOAK_CLIENT_SECRET=<keycloak-client-secret> KEYCLOAK_ISSUER=<issuer-url> NEXTAUTH_URL=http://localhost:4000 NEXTAUTH_SECRET=<next-auth-secret> NEXTAUTH_DEBUG=true NEXT_PUBLIC_BACKEND_SERVER_URL=https://localhost:3000 NEXT_PUBLIC_LOG_LEVEL=debug NEXT_PUBLIC_NODE_ENV=development NEXT_PUBLIC_PINO_PRETTY=true NEXT_PUBLIC_LOG_DIR=logs CAMUNDA_OPERATE_API_URL=http://localhost:8081/v1 (default) CAMUNDA_TASKLIST_API_URL=http://localhost:8082/v1 (default) CAMUNDA_KEYCLOAK_API_URL=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token #bsp. der issuer bei keycloak mit camunda CAMUNDA_KEYCLOAK_CLIENT_SECRET=<secret> NOTIFICATION_UPDATE_INTERVAL=86400000 # 24 Stunden NEXT_PUBLIC_ADMIN_GROUP=Identity #bezeichnet die role die Admins haben (was ein Admin ausmacht) NEXT_PUBLIC_DEFAULT_ROUTE=/ # normalerweise die Startseite
-
für die compose.yml:
Im Grunde dieselben wie im Backend und Frontend, nur statt localhost den jeweiligen Hostnamen des Containers (z. B. bei Keycloak: keycloak).
-
-
Server starten:
-
Nur Backend ( mit Camunda ) starten:
cd .extras/compose/backend docker compose up -d
-
Frontend (und damit die gesamte Anwendung) starten:
cd .extras/compose/frontend docker compose up -d
-
Camunda starten:
-
Camunda mit Identity und Keycloak:
cd .extras/compose/camunda/full docker compose up -d
-
Camunda nur mit Core-Funktionen:
cd .extras/compose/camunda docker compose up -d
-
-
-
pgAdmin konfigurieren (für Keycloak bei der Full-Version):
-
Öffne
http://localhost:8888
im Browser. -
Melde dich mit den folgenden Anmeldedaten an:
- E-Mail:
bash <[email protected]>
- Passwort:
bash p
- E-Mail:
-
Füge einen neuen Server hinzu:
- General:
- Name:
bash keycloak
- Name:
- Connection:
- Host Name:
bash Postgres
- Username:
bash bn_keycloak
- Passwort:
bash #3]O?4RGj)DE7Z!9SA5
- Maintenance Database:
bash bitnami_keycloak
- Host Name:
- General:
-
Die Datenbanktabellen können unter
Database -> bitnami_keycloak -> Schemas -> Tables
eingesehen und verwaltet werden.
-
- Öffne das Frontend unter
http://localhost:4000
. - Melde dich mit einem in Keycloak definierten Benutzer an.
- Navigiere zur Rollenverwaltung. Tipp: Vergewissere dich, dass Benutzerrollen in Keycloak korrekt konfiguriert sind.
- Beginne mit der Verwaltung von Rollen und Berechtigungen.
-
Backend:
-
Normale Tests:
cd backend npm t
-
Tests mit Coverage:
npm run test:istanbul
-
Code analysieren (ESLint):
npm run eslint
-
Code formatieren (Prettier):
npm run prettier
-
-
Frontend:
-
Code analysieren (Lint):
npm run lint
-
Code formatieren (Prettier):
npm run prettier
-
Zeebe Client aktivieren/deaktivieren:
-
Zeebe deaktivieren:
- Öffne die Datei
backend/src/config/resource/app.yml
und setzeZeebe.enable
auffalse
.
- Öffne die Datei
-
Zeebe aktivieren:
- Setze
Zeebe.enable
auftrue
. - Starte Camunda mit:
-
Mit Identity und Keycloak:
cd .extras/compose/camunda/full docker compose up -d
-
Nur Core-Funktionen:
cd .extras/compose/camunda docker compose up -d
-
- Setze
- Forke das Repository.
- Erstelle einen neuen Branch.
- Führe Änderungen durch und committe diese.
- Sende einen Pull Request.