Dev-Setup & Deployment
Anleitung für das lokale Entwicklungssetup der SOCSuite. Zielgruppe: Entwickler, die zum ersten Mal mit dem Projekt arbeiten.
Voraussetzungen
| Tool | Version | Hinweis |
|---|---|---|
| Go | 1.26+ | go version |
| Node.js | 20 LTS+ | node --version |
| pnpm | 9+ | pnpm --version |
| Docker | 24+ | Für lokale Services |
| kubectl | 1.30+ | Kubernetes-Deployment |
| make | — | Build-Automatisierung |
| Git | 2.40+ | Conventional Commits |
Ersteinrichtung (Schritt-für-Schritt)
1. Repository klonen
git clone https://gitlab.com/imvee/socsuite.git
cd socsuite2. Abhängigkeiten installieren
make installDies 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-apiServices und Ports
| Service | URL / Port |
|---|---|
| App | https://socsuite.dev.imvee.de |
| Auth | https://auth.dev.imvee.de |
| SIEM | https://siem.dev.imvee.de |
| API (direkt) | :8080 |
| Frontend (Vite) | :3000 |
| PostgreSQL | :5432 |
| Redis | :6379 |
| OpenSearch | :9200 |
| Keycloak | :8080 (via auth.dev.imvee.de) |
| Agent WebSocket | wss://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:
| Typ | Befehl | Severity |
|---|---|---|
| TypeScript/JS | npx eslint apps/web/src --max-warnings=0 | Blocker |
| Formatierung | npx prettier --check . | Warning |
| Go | golangci-lint run ./... | Blocker |
| YAML | yamllint | Blocker |
| Shell | shellcheck | Blocker |
| SQL | sqlfluff | Blocker |
:::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
anyin TypeScript →unknownverwenden
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äfix | Verwendung |
|---|---|
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.exampleist 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 5432Port-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 devDesign-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)
- Installiere Plugin: Figma Tokens
- Exportiere Tokens:
- Öffne dein Figma Design
- Plugin starten → Export → JSON
- 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
-
Nie Hardcoded Values: Immer Tokens verwenden
// ❌ Schlecht const Button = styled.button` color: #0ea5e9; `; // ✅ Gut const Button = styled.button` color: ${colors.primary[500]}; `; -
Semantic Colors: Verwende semantische Token
// ✅ Für Status-Meldungen colors.success[500]; // Erfolg colors.danger[500]; // Fehler colors.warning[500]; // Warnung -
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
- Öffne dein Figma Design
- URL:
https://www.figma.com/file/FILE_KEY/... - Kopiere
FILE_KEY - 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
| Prop | Typ | Default | Beschreibung |
|---|---|---|---|
variant | 'icon' | 'text' | 'full' | 'stacked' | 'icon' | Logo-Variante |
size | number | 48 | Höhe in Pixeln |
theme | 'light' | 'dark' | 'light' | Farbschema |
className | string | '' | Zusätzliche Tailwind-Klassen |
4. Verwendungsbeispiele
Sidebar (nur Icon)
<Logo variant="icon" size={48} />Header (Icon + Text horizontal)
<Logo variant="full" size={32} />Login-Seite (gestapelt)
<Logo variant="stacked" size={150} />Footer (mit dunklem Theme)
<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:
- Speichere ein 32x32px Icon als
apps/web/public/favicon.ico - 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
- ✅ Kopiere deine Logo-PNGs nach
apps/web/public/logos/ - ✅ Benenne sie entsprechend den Empfehlungen
- ✅ Nutze die
<Logo />Komponente in deinen Components - ✅ 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-DateienVerwendung
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
Navigation
Home,LayoutDashboard,Bell,Settings,UserMenu,X,ChevronLeft,ChevronRight
Security & Alerts
Shield,ShieldAlert,ShieldCheckAlertTriangle,AlertCircle,AlertOctagonLock,Unlock,Eye,EyeOff
Actions
Search,Filter,Download,UploadTrash2,Edit,Plus,MinusSave,RefreshCw
Status
CheckCircle,XCircle,Info,HelpCircleClock,ActivityTrendingUp,TrendingDown
Communication
Mail,MailOpen,MessageSquare,Send
Files & Folders
File,FileText,Folder,FolderOpen
System
Server,Database,HardDrive,CpuNetwork,Wifi,WifiOff
Charts & Analytics
BarChart,LineChart,PieChart
Other
MoreVertical,MoreHorizontalExternalLink,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
- SVG-Datei in
assets/icons/svg/ablegen - 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>
);
}- In
index.tsexportieren:
export { CustomIcon } from "./CustomIcon";Best Practices
- Konsistente Größen: Verwende die Standard-Sizes (16, 20, 24, 32, 40, 48px)
- Semantische Namen: Wähle Icons die die Funktion beschreiben
- Accessibility: Füge
aria-labelfür wichtige Icons hinzu - Performance: Icons werden automatisch tree-shaked (nur genutzte Icons im Bundle)
- Farben: Nutze Design-Tokens für konsistente Farben
Beispiele aus dem Dashboard
Sidebar Navigation
<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
- Lucide React Dokumentation: https://lucide.dev/guide/packages/lucide-react
- Alle verfügbaren Icons: https://lucide.dev/icons/
Siehe auch
- Architektur — Monorepo-Struktur und Tech-Stack
- Betrieb — Monitoring, Backup, Wartung
- Contributing — Git-Workflow und Code-Standards
- Test-Strategie — Test-Pyramide und Coverage-Ziele