directlx-claude-config/projects/-source-hiveops-src-hiveops.../memory/MEMORY.md

2.8 KiB

HiveOps Browser Project Memory

Architecture

  • Browser: Electron app at /source/hiveops-src/hiveops-browser
  • Mgmt Server: Spring Boot at /source/hiveops-src/hiveops-mgmt
  • IPC pattern: kebab-case channels (get-config), camelCase in preload (getConfig)
  • API client returns { success, data } or { success, error, status, code }
  • DTOs use Lombok @Data @Builder @NoArgsConstructor @AllArgsConstructor
  • Services use @RequiredArgsConstructor @Slf4j, @Transactional(readOnly=true) for reads
  • Controllers use @RestController @RequestMapping("/api/v1/...") with OpenAPI annotations
  • Security: 3 filter chains (API@Order1, Portal@Order2, Default@Order3)
  • Flyway migrations in db/migration/, H2 dev data in db/h2/data.sql (MERGE INTO syntax)
  • H2 uses CHAR(10) for newlines (no E'...\n...' like PostgreSQL)

Key Files

  • src/main/main.js - Main process, IPC handlers, window management (~1400 lines)
  • src/main/api-client.js - Axios-based API client
  • src/main/preload.js - contextBridge IPC exposure
  • Window pattern: check if exists, focus; else create BrowserWindow with preload
  • Legal API: GET /api/v1/legal and GET /api/v1/legal/{section} (public, no auth)
  • 4 settings in global_settings: legal.copyright, legal.license, legal.usagePolicy, legal.disclaimers
  • About page has tabbed layout: Info, License, Usage Policy, Disclaimers
  • About window size: 650x700

DevOps Scripts Pattern (Standardized Feb 2026)

All Spring Boot microservices follow this standardized devops-scripts structure:

devops-scripts/
├── build-and-push.sh       # Build Docker image, push to registry
├── deploy.sh               # Deploy with docker-compose or docker run
├── docker/
│   └── .env.example        # Service-specific environment template
└── ansible/                # Ansible playbooks (if applicable)

Key Features:

  • Auto-detect version from pom.xml using grep -oP '<version>\K[^<]+' pom.xml | head -1
  • Registry authentication with REGISTRY_USERNAME/REGISTRY_PASSWORD
  • Tag both $VERSION and latest (if version != latest)
  • Deploy script auto-detects docker-compose.prod.yml or docker-compose.yml
  • Comprehensive .env.example with all service-specific variables
  • Health checks and status reporting

When Creating New Microservice:

  1. Copy devops-scripts/ from hiveops-incident, hiveops-auth, or hiveops-mgmt
  2. Update service name in build-and-push.sh and deploy.sh
  3. Customize docker/.env.example with service-specific variables
  4. Create docker-compose.prod.yml with external PostgreSQL
  5. Ensure Dockerfile follows multi-stage Alpine pattern

Standard Ports:

  • hiveops-mgmt: 8080
  • hiveops-incident: 8081
  • hiveops-auth: 8082
  • (next service: 8083, etc.)