IMVEEDev Portal

Dev-Setup & Deployment

Anleitung für das lokale Entwicklungssetup der SOCSuite. Zielgruppe: Entwickler, die zum ersten Mal mit dem Projekt arbeiten.

Voraussetzungen

ToolVersionHinweis
Go1.26+go version
Node.js20 LTS+node --version
pnpm9+pnpm --version
Docker24+Für lokale Services
kubectl1.30+Kubernetes-Deployment
make—Build-Automatisierung
Git2.40+Conventional Commits

Ersteinrichtung (Schritt-für-Schritt)

1. Repository klonen

git clone https://gitlab.com/imvee/socsuite.git
cd socsuite

2. Abhängigkeiten installieren

make install

Dies führt aus:

  • pnpm install (Frontend + Packages)
  • cd apps/api && go mod download (Backend)

3. Umgebungsvariablen

cp .env.example .env

:::warn [Keine echten Secrets in .env] .env ist in .gitignore. Nur .env.example wird committed — dort stehen Platzhalter, keine echten Werte. :::

4. Services starten

# Alle Dev-Server (Frontend + Backend)
make dev

# Nur Frontend
make dev-web

# Nur Backend
make dev-api

Services und Ports

ServiceURL / Port
Apphttps://socsuite.dev.imvee.de
Authhttps://auth.dev.imvee.de
SIEMhttps://siem.dev.imvee.de
API (direkt):8080
Frontend (Vite):3000
PostgreSQL:5432
Redis:6379
OpenSearch:9200
Keycloak:8080 (via auth.dev.imvee.de)
Agent WebSocketwss://socsuite.dev.imvee.de/ws/agents/:id (via Gateway)

Kubernetes-Deployment

kubectl apply -k infrastructure/k8s/overlays/dev

:::info [Details] Vollständige Dokumentation zu K8s-Deploy-Workflow, Gateway API und CI/CD-Pipeline → infrastructure/AGENTS.md :::


Lint & Code-Qualität

Alle Checks müssen vor einem Commit grün sein:

TypBefehlSeverity
TypeScript/JSnpx eslint apps/web/src --max-warnings=0Blocker
Formatierungnpx prettier --check .Warning
Gogolangci-lint run ./...Blocker
YAMLyamllintBlocker
ShellshellcheckBlocker
SQLsqlfluffBlocker

:::info [Lint-Configs] Konfigurationsdateien im Repo-Root: golangci.yml, prettier.json, eslint.config.js, yamllint.yml :::


IDE-Setup (empfohlen)

VS Code Extensions

  • Go (golang.go) — Go-Support mit gopls
  • ESLint (dbaeumer.vscode-eslint)
  • Prettier (esbenp.prettier-vscode)
  • YAML (redhat.vscode-yaml)

Formatierung

  • Go: gofmt-Stil (Tabs)
  • TypeScript/JS: Prettier (2 Spaces, Semicolons, Trailing Commas)
  • Kein any in TypeScript → unknown verwenden

Git-Workflow

Branch-Struktur

main       → Stable (bis MVP: Direkt-Commits)
feature/*  → Features
fix/*      → Bugfixes

:::info [Bis MVP: direkt auf main] In der MVP-Phase werden Commits direkt auf main gemacht. Ab Post-MVP: eigener Branch, kein direkter Commit auf main. Kein Force-Push auf geteilte Branches. :::

Commit-Konventionen

Alle Commits folgen dem Conventional-Commits-Format:

PräfixVerwendung
feat:Neues Feature
fix:Bugfix
refactor:Refactoring (kein Feature, kein Fix)
test:Tests hinzufügen oder anpassen
docs:Dokumentation
chore:Wartungsaufgaben, Abhängigkeiten

Was niemals committed wird

  • .env-Dateien (nur .env.example ist erlaubt)
  • node_modules/
  • dist/
  • vendor/
  • Lock-Files manuell editieren
  • Binäre Dateien

Troubleshooting

Keycloak-Redirect schlägt fehl

SameSite=Strict bricht den OAuth-Redirect. Die Anwendung nutzt SameSite=Lax — stelle sicher, dass du über https://socsuite.dev.imvee.de zugreifst (nicht localhost).

Datenbank-Verbindung fehlgeschlagen

Prüfe ob PostgreSQL auf Port :5432 erreichbar ist:

pg_isready -h localhost -p 5432

Port-Konflikt auf :8080

API und Keycloak nutzen beide :8080. Keycloak wird über auth.dev.imvee.de geroutet — stelle sicher, dass die /etc/hosts-Einträge korrekt gesetzt sind.

Frontend zeigt leere Seite

# Cache löschen und neu starten
rm -rf node_modules/.vite
pnpm dev

Design-Tokens (Figma → Code)

Part of IMVEE SOCsuite v0.2 | ← Back to Main Project (Quelle: ../../README.md)


Design tokens exported from Figma - Single Source of Truth for design values.

Related: UI Component Library (Quelle: ../ui/README.md)

🎨 Figma Integration

Option 1: Figma Tokens Plugin (Empfohlen)

  1. Installiere Plugin: Figma Tokens
  2. Exportiere Tokens:
    • Öffne dein Figma Design
    • Plugin starten → Export → JSON
  3. Update Code:
    # Kopiere JSON in packages/design-tokens/figma-tokens.json
    npm run generate-tokens

Option 2: Figma Variables API

// Mit Figma Variables API (erfordert Figma Token)
import { fetchVariables } from "@figma/rest-api-client";

const variables = await fetchVariables({
  fileKey: "your-figma-file-key",
  token: process.env.FIGMA_TOKEN,
});

Option 3: Manuelle Synchronisation (Aktuell)

Die Tokens in src/ manuell mit deinen Figma-Werten aktualisieren.

📦 Installation

pnpm add @soc-suite/design-tokens

🚀 Verwendung

In TypeScript/JavaScript

import { colors, spacing, typography } from "@soc-suite/design-tokens";

// Farben verwenden
const primaryColor = colors.primary[500];
const textColor = colors.text.primary;

// Spacing verwenden
const padding = spacing[4]; // 1rem (16px)

// Typography
const headingFont = typography.fontFamily.sans;

In CSS

@import "@soc-suite/design-tokens/css";

.button {
  background-color: var(--color-primary-500);
  padding: var(--spacing-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

In Tailwind CSS

// tailwind.config.js
import { tokens } from "@soc-suite/design-tokens";

export default {
  theme: {
    extend: {
      colors: tokens.colors,
      spacing: tokens.spacing,
      borderRadius: tokens.borderRadius,
      fontFamily: tokens.fontFamily,
      fontSize: tokens.fontSize,
      boxShadow: tokens.boxShadow,
    },
  },
};

🔄 Token-Struktur

design-tokens/
├── colors.ts          # Farbpalette (primary, secondary, semantic)
├── spacing.ts         # Abstände & Border Radius
├── typography.ts      # Schriftarten, Größen, Gewichte
├── shadows.ts         # Schatten & Elevations
├── animation.ts       # Transitions & Animationen
├── breakpoints.ts     # Responsive Breakpoints
└── zIndex.ts          # Layering System

🎯 Best Practices

  1. Nie Hardcoded Values: Immer Tokens verwenden

    // ❌ Schlecht
    const Button = styled.button`
      color: #0ea5e9;
    `;
    
    // ✅ Gut
    const Button = styled.button`
      color: ${colors.primary[500]};
    `;
  2. Semantic Colors: Verwende semantische Token

    // ✅ Für Status-Meldungen
    colors.success[500]; // Erfolg
    colors.danger[500]; // Fehler
    colors.warning[500]; // Warnung
  3. Responsive Design: Breakpoints nutzen

    import { breakpoints } from "@soc-suite/design-tokens";
    
    const Container = styled.div`
      @media (min-width: ${breakpoints.lg}) {
        /* Desktop styles */
      }
    `;

🔧 Figma → Code Workflow

Figma Design
    ↓
Figma Tokens Plugin / Variables
    ↓
JSON Export
    ↓
packages/design-tokens/src/*.ts
    ↓
Build (pnpm build)
    ↓
dist/ (TypeScript + CSS)
    ↓
Verwendet in apps/web & packages/ui

📝 Token Updates

Wenn Figma-Design sich ändert:

# 1. Tokens aktualisieren
code packages/design-tokens/src/colors.ts

# 2. Build
pnpm -F @soc-suite/design-tokens build

# 3. In allen Apps verwenden
pnpm -r build

🎨 Figma File Key finden

  1. Öffne dein Figma Design
  2. URL: https://www.figma.com/file/FILE_KEY/...
  3. Kopiere FILE_KEY
  4. In .env: FIGMA_FILE_KEY=...

Logo-Assets

1. Logo-Dateien ablegen

Speichere deine Logo-Dateien in:

apps/web/public/logos/

Empfohlene Dateinamen:

  • imvee-icon.png - Nur das V-Icon (grau/orange)
  • imvee-icon-dark.png - V-Icon (dunkelblau/orange)
  • imvee-logo.png - Icon + "IMVEE" Text vertikal (hell)
  • imvee-logo-dark.png - Icon + "IMVEE" Text vertikal (dunkel)
  • imvee-logo-full.png - Icon + "IMVEE" Text horizontal (hell)
  • imvee-logo-full-dark.png - Icon + "IMVEE" Text horizontal (dunkel)

💡 Tipp: Benenne die Dateien wie oben, dann funktioniert die Logo-Komponente sofort!

2. Logo-Komponente verwenden

import { Logo } from '@/assets/icons/Logo';

// Nur Icon (48x48px)
<Logo variant="icon" size={48} />

// Icon + Text vertikal gestapelt
<Logo variant="stacked" size={120} />

// Icon + Text horizontal (für Header)
<Logo variant="full" size={48} />

// Nur Text
<Logo variant="text" size={32} />

// Mit Dark Theme
<Logo variant="full" theme="dark" size={48} />

3. Props

PropTypDefaultBeschreibung
variant'icon' | 'text' | 'full' | 'stacked''icon'Logo-Variante
sizenumber48Höhe in Pixeln
theme'light' | 'dark''light'Farbschema
classNamestring''Zusätzliche Tailwind-Klassen

4. Verwendungsbeispiele

<Logo variant="icon" size={48} />

Header (Icon + Text horizontal)

<Logo variant="full" size={32} />

Login-Seite (gestapelt)

<Logo variant="stacked" size={150} />
<Logo variant="full" theme="dark" size={40} />

5. Direkte Verwendung (ohne Komponente)

Falls du die Bilder direkt einbinden möchtest:

<img src="/logos/imvee-logo.png" alt="IMVEE" height={48} />

6. Favicon

Für das Browser-Tab-Icon:

  1. Speichere ein 32x32px Icon als apps/web/public/favicon.ico
  2. Oder nutze das PNG: apps/web/public/favicon.png

Das wird automatisch von Vite erkannt!

7. Responsive Logos

// Klein auf Mobile, groß auf Desktop
<Logo
  variant="full"
  size={32}
  className="md:h-12"
/>

// Oder mit Tailwind direkt
<img
  src="/logos/imvee-logo.png"
  alt="IMVEE"
  className="h-8 md:h-12 w-auto"
/>

Nächste Schritte

  1. ✅ Kopiere deine Logo-PNGs nach apps/web/public/logos/
  2. ✅ Benenne sie entsprechend den Empfehlungen
  3. ✅ Nutze die <Logo /> Komponente in deinen Components
  4. ✅ Füge ein Favicon hinzu

Icon-Assets

Struktur

apps/web/src/assets/icons/
├── index.ts       # Zentrale Export-Datei für alle Icons
├── Logo.tsx       # Custom SOCsuite Logo Component
└── svg/           # Platzhalter für weitere SVG-Dateien

Verwendung

1. Lucide React Icons

Import über die zentrale index.ts:

import { ShieldAlert, Settings, User } from "@/assets/icons";

function MyComponent() {
  return (
    <div>
      <ShieldAlert className="w-6 h-6 text-red-600" />
      <Settings className="w-5 h-5 text-gray-500" />
      <User className="w-8 h-8 text-blue-500" />
    </div>
  );
}

2. Custom Logo Component

Das Logo hat zwei Varianten:

import { Logo } from '@/assets/icons/Logo';

// Icon Variante (Standard) - runder Kreis mit Buchstabe
<Logo size={48} variant="icon" />

// Full Logo Variante - SVG mit Gradient
<Logo size={64} variant="full" />

// Mit zusätzlichen Props
<Logo
  size={32}
  variant="icon"
  className="shadow-lg"
/>

Props:

  • size: Größe in Pixeln (default: 48)
  • variant: 'icon' | 'full' (default: 'icon')
  • className: Zusätzliche Tailwind-Klassen
  • Alle SVG-Props werden durchgereicht

Verfügbare Icon-Kategorien

  • Home, LayoutDashboard, Bell, Settings, User
  • Menu, X, ChevronLeft, ChevronRight

Security & Alerts

  • Shield, ShieldAlert, ShieldCheck
  • AlertTriangle, AlertCircle, AlertOctagon
  • Lock, Unlock, Eye, EyeOff

Actions

  • Search, Filter, Download, Upload
  • Trash2, Edit, Plus, Minus
  • Save, RefreshCw

Status

  • CheckCircle, XCircle, Info, HelpCircle
  • Clock, Activity
  • TrendingUp, TrendingDown

Communication

  • Mail, MailOpen, MessageSquare, Send

Files & Folders

  • File, FileText, Folder, FolderOpen

System

  • Server, Database, HardDrive, Cpu
  • Network, Wifi, WifiOff

Charts & Analytics

  • BarChart, LineChart, PieChart

Other

  • MoreVertical, MoreHorizontal
  • ExternalLink, Copy, Check

Styling

Alle Lucide Icons können mit Tailwind-Klassen gestylt werden:

// Größe
<Shield className="w-4 h-4" />   // 16x16px
<Shield className="w-6 h-6" />   // 24x24px
<Shield className="w-8 h-8" />   // 32x32px

// Farbe
<Shield className="text-red-600" />
<Shield className="text-primary-500" />

// Stroke Width (default: 2)
<Shield strokeWidth={1.5} />
<Shield strokeWidth={2.5} />

// Kombiniert
<Shield className="w-6 h-6 text-blue-500 hover:text-blue-700" />

Eigene SVG Icons hinzufügen

  1. SVG-Datei in assets/icons/svg/ ablegen
  2. React Component erstellen:
import type { SVGProps } from "react";

export function CustomIcon({
  className = "",
  ...props
}: SVGProps<SVGSVGElement>) {
  return (
    <svg
      xmlns="http://www.w3.org/2000/svg"
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth="2"
      strokeLinecap="round"
      strokeLinejoin="round"
      className={className}
      {...props}
    >
      {/* SVG Pfade hier */}
    </svg>
  );
}
  1. In index.ts exportieren:
export { CustomIcon } from "./CustomIcon";

Best Practices

  1. Konsistente Größen: Verwende die Standard-Sizes (16, 20, 24, 32, 40, 48px)
  2. Semantische Namen: Wähle Icons die die Funktion beschreiben
  3. Accessibility: Füge aria-label für wichtige Icons hinzu
  4. Performance: Icons werden automatisch tree-shaked (nur genutzte Icons im Bundle)
  5. Farben: Nutze Design-Tokens für konsistente Farben

Beispiele aus dem Dashboard

<LayoutDashboard className="w-6 h-6 text-slate-700" />
<ShieldAlert className="w-6 h-6 text-slate-700" />

Status Indicators

<ShieldAlert className="w-6 h-6 text-yellow-600" />
<Activity className="w-6 h-6 text-sky-950" />
<Mail className="w-6 h-6 text-yellow-600" />

Trend Indicators

<TrendingUp className="w-10 h-10 text-green-600" />
<TrendingDown className="w-10 h-10 text-red-600" />

Buttons

<ChevronRight className="w-4 h-4 text-black group-hover:text-sky-950" />

Weitere Informationen

Siehe auch

Auf dieser Seite