Files
metabuilder/docker-compose.ghcr.yml
johndoe6345789 dc982772af refactor(workflowui): complete monolithic file refactoring + business logic extraction + stub implementation
## Phase 1: Monolithic File Refactoring 
- Refactored 8 large files (300-500 LOC) into 40+ modular components/hooks
- All files now <150 LOC per file (max 125 LOC)
- CanvasSettings: 343 → 7 components
- SecuritySettings: 273 → 6 components
- NotificationSettings: 239 → 6 components
- Editor/Toolbar: 258 → 7 components
- InfiniteCanvas: 239 → 10 modules
- WorkflowCard: 320 → 5 components + custom hook
- useProjectCanvas: 322 → 8 hooks
- projectSlice: 335 → 4 Redux slices

## Phase 2: Business Logic Extraction 
- Extracted logic from 5 components into 8 custom hooks
- register/page.tsx: 235 → 167 LOC (-29%)
- login/page.tsx: 137 → 100 LOC (-27%)
- MainLayout.tsx: 216 → 185 LOC (-14%)
- ProjectSidebar.tsx: 200 → 200 LOC (refactored)
- page.tsx (Dashboard): 197 → 171 LOC (-13%)
- New hooks: useAuthForm, usePasswordValidation, useLoginLogic, useRegisterLogic, useHeaderLogic, useResponsiveSidebar, useProjectSidebarLogic, useDashboardLogic

## Phase 3: Dead Code Analysis & Implementation 
- Identified and documented 3 unused hooks (244 LOC)
- Removed useRealtimeService from exports
- Cleaned 8 commented lines in useProject.ts
- Documented useExecution stub methods
- Removed 3 commented dispatch calls in useCanvasKeyboard
- Fixed 3 'as any' type assertions

## Phase 4: Stub Code Implementation 
- Fully implemented useExecution methods: execute(), stop(), getDetails(), getStats(), getHistory()
- Integrated useCanvasKeyboard into InfiniteCanvas with Redux dispatch
- Verified useCanvasVirtualization for 100+ items
- Enhanced useRealtimeService documentation for Phase 4 WebSocket integration

## Backend Updates
- Added SQLAlchemy models: Workspace, Project, ProjectCanvasItem
- Added Flask API endpoints for CRUD operations
- Configured multi-tenant filtering for all queries
- Added database migrations for new entities

## Build Verification 
- TypeScript strict mode: 0 errors
- Production build:  Successful (161 kB First Load JS)
- No breaking changes
- 100% backward compatibility maintained

## Documentation Generated
- 6 comprehensive guides (70+ KB total)
- Test templates for all new implementations
- Quick reference for all 42 hooks
- Implementation checklist and deployment guide

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-23 06:44:57 +00:00

146 lines
3.9 KiB
YAML

version: '3.9'
services:
# MetaBuilder Next.js App
nextjs-app:
image: ghcr.io/${GITHUB_REPOSITORY:-johndoe6345789/metabuilder}/nextjs-app:${IMAGE_TAG:-latest}
container_name: metabuilder-nextjs
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=file:/app/data/metabuilder.db
- DBAL_API_URL=http://dbal-daemon:8080
- DBAL_WS_URL=ws://dbal-daemon:50051
- NEXTAUTH_URL=http://localhost:3000
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:-change-me-in-production}
volumes:
- metabuilder-data:/app/data
depends_on:
- dbal-daemon
- smtp-relay
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 40s
networks:
- metabuilder-network
# SMTP Relay Service (Twisted Python)
smtp-relay:
build:
context: ./smtprelay
dockerfile: Dockerfile
container_name: metabuilder-smtp-relay
ports:
- "2525:2525"
- "8081:8080"
environment:
- SMTP_LISTEN_HOST=0.0.0.0
- SMTP_LISTEN_PORT=2525
- HTTP_LISTEN_HOST=0.0.0.0
- HTTP_LISTEN_PORT=8080
- GMAIL_USERNAME=${GMAIL_USERNAME:-}
- GMAIL_APP_PASSWORD=${GMAIL_APP_PASSWORD:-}
- FORWARD_TO=${FORWARD_TO:-noreply@metabuilder.local}
- ALLOW_ANY_RCPT=true
- ADD_X_HEADERS=true
- MAX_STORE=500
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
networks:
- metabuilder-network
# DBAL Daemon (Production)
dbal-daemon:
image: ghcr.io/${GITHUB_REPOSITORY:-johndoe6345789/metabuilder}/dbal-daemon:${IMAGE_TAG:-latest}
container_name: metabuilder-dbal
ports:
- "8080:8080"
- "50051:50051"
environment:
- NODE_ENV=production
- DATABASE_URL=file:/app/data/metabuilder.db
- LOG_LEVEL=info
- ENABLE_METRICS=true
- SMTP_RELAY_HOST=smtp-relay
- SMTP_RELAY_PORT=2525
volumes:
- metabuilder-data:/app/data
- dbal-logs:/app/logs
depends_on:
- smtp-relay
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
networks:
- metabuilder-network
# Prometheus for metrics (optional)
prometheus:
image: prom/prometheus:latest
container_name: metabuilder-prometheus
ports:
- "9090:9090"
volumes:
- ./deployment/docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
restart: unless-stopped
networks:
- metabuilder-network
profiles:
- monitoring
# Grafana for visualization (optional)
grafana:
image: grafana/grafana:latest
container_name: metabuilder-grafana
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
- GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
volumes:
- grafana-data:/var/lib/grafana
- ./deployment/docker/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./deployment/docker/grafana/datasources:/etc/grafana/provisioning/datasources:ro
depends_on:
- prometheus
restart: unless-stopped
networks:
- metabuilder-network
profiles:
- monitoring
volumes:
metabuilder-data:
driver: local
dbal-logs:
driver: local
prometheus-data:
driver: local
grafana-data:
driver: local
networks:
metabuilder-network:
driver: bridge