refactor: large codebase cleanup - consolidate schemas, migrate to Drizzle ORM, extract frontend components, modernize Docker builds
Build & Deploy / build-and-push (discord-gateway) (push) Failing after 2m22s
Build & Deploy / build-and-push (backend) (push) Failing after 3m22s
Build & Deploy / build-and-push (proxy) (push) Successful in 1m36s
Build & Deploy / deploy (push) Skipped

- Consolidate all DB schema definitions into packages/shared as single source of truth
- Migrate backend from raw SQL to Drizzle ORM across all modules
- Extract frontend inline UI into separate component files
- Refactor discord-gateway circuitBreaker into conversationState + moderationState
- Convert messageStore to Proxy singleton pattern
- Add validateBody/validateQuery middleware + Zod schemas for API endpoints
- Modernize Docker builds with multi-stage + pnpm deploy
- Migrate CI/CD from deployment to image-based pipeline
- Remove 60+ unused/dead files (~15K lines)
- Update color scheme from sky-blue to teal-cyan
- Move DB connection management to @bete/shared/database

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Developer
2026-07-27 21:54:31 +07:00
co-authored by Claude Opus 4.8
parent 63f21513bd
commit 5802d02e29
223 changed files with 11499 additions and 13350 deletions
+7 -19
View File
@@ -1,10 +1,8 @@
version: '3.8'
services:
# Nginx Reverse Proxy + Frontend Static Files
# Routes /api and /ws to backend, serves frontend WASM directly
proxy:
image: registry.gitlab.com/mytheclipse-group/gmw/bete-proxy:${IMAGE_TAG:-latest}
image: ${REGISTRY}/mytheclipse/gmw/bete-proxy:${IMAGE_TAG:-latest}
container_name: imphenbot-proxy
restart: unless-stopped
labels:
@@ -20,10 +18,6 @@ services:
interval: 30s
timeout: 5s
retries: 3
volumes:
# Bind mount for hot-deploy frontend — deploy.sh writes here,
# survives container restart. The image default serves as fallback.
- ./frontend-dist:/usr/share/nginx/html
deploy:
resources:
limits:
@@ -31,9 +25,8 @@ services:
networks:
- app-shared-net
# Backend Service (REST API + WebSocket)
backend:
image: registry.gitlab.com/mytheclipse-group/gmw/bete-backend:${IMAGE_TAG:-latest}
image: ${REGISTRY}/mytheclipse/gmw/bete-backend:${IMAGE_TAG:-latest}
container_name: imphenbot-backend
restart: unless-stopped
env_file:
@@ -41,10 +34,6 @@ services:
environment:
NODE_ENV: production
WEBSERVER_PORT: 3000
volumes:
# Bind mount for hot-deploy backend JS — deploy.sh writes here,
# survives container restart.
- ./backend-dist:/app/services/backend/dist
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
interval: 30s
@@ -58,9 +47,8 @@ services:
networks:
- app-shared-net
# Discord Gateway Service (Event capture and processing — no HTTP)
discord-gateway:
image: registry.gitlab.com/mytheclipse-group/gmw/bete-discord-gateway:${IMAGE_TAG:-latest}
image: ${REGISTRY}/mytheclipse/gmw/bete-discord-gateway:${IMAGE_TAG:-latest}
container_name: imphenbot-discord-gateway
restart: unless-stopped
env_file:
@@ -68,10 +56,7 @@ services:
environment:
NODE_ENV: production
volumes:
- ./recordings:/app/recordings
# Bind mount for hot-deploy gateway JS — deploy.sh writes here,
# survives container restart.
- ./gateway-dist:/app/services/discord-gateway/dist
- recordings:/app/recordings
healthcheck:
test: ["CMD-SHELL", "kill -0 1 || exit 1"]
interval: 30s
@@ -85,6 +70,9 @@ services:
networks:
- app-shared-net
volumes:
recordings:
networks:
app-shared-net:
name: app-shared-net