Files
omo-bot/docs/07_deployment_view.md
zwitschi cf564f2886
CI-CD / Bot Lint Test Build (push) Successful in 1m24s
CI-CD / Dashboard Lint Build (push) Successful in 14s
CI-CD / Deploy to Coolify (push) Failing after 3s
feat: Update CI/CD workflow to trigger separate backend and dashboard deployments; enhance deployment documentation with Nginx proxy details and OAuth callback URLs
2026-05-17 19:08:26 +02:00

3.9 KiB

Deployment View

Infrastructure Overview

┌──────────────┐      HTTPS/WSS      ┌──────────────────────────────┐
│ Discord APIs │◄───────────────────►│ Coolify backend resource     │
└──────────────┘                     │ port 8787                    │
                                     │ - Discord gateway runtime    │
                                     │ - Admin API (Express)        │
                                     │ - Dailies pollers            │
                                     └──────────────┬───────────────┘
                                                    │
                                                    ▼
                                          ┌───────────────────┐
                                          │ PostgreSQL        │
                                          │ mileage + config  │
                                          └───────────────────┘

Internet
   │
   ▼
┌──────────────────────────┐
│ Nginx edge reverse proxy │
│ - TLS termination        │
│ - Host/path routing      │
└─────────────┬────────────┘
              │
     ┌────────┴───────────┐
     ▼                    ▼
┌───────────────┐   ┌──────────────────────────┐
│ Coolify       │   │ Coolify dashboard        │
│ backend       │   │ resource                 │
│ port 8787     │   │ port 80                  │
└───────────────┘   │ React/Vite static deploy │
                    └──────────────────────────┘

CI/CD Pipeline

Source file: .gitea/workflows/ci-cd.yml

  1. Bot job: install dependencies, run lint, build, and test.
  2. Dashboard job: install dependencies in admin-dashboard, run lint/build.
  3. Deploy job: on main, trigger Coolify webhook (optionally authenticated with token).
  4. In two-resource production setup, deploy webhooks can independently trigger backend and dashboard resources.

Environment Matrix

Environment Runtime Database Notes
Local development Node.js process via npm run dev Local/Postgres dev instance Fast iteration, manual command registration
CI Ephemeral runner Test/dev DB or mocked integration path Quality gates before deployment
Production Nginx edge + Coolify backend/dashboard resources Managed PostgreSQL Host-based routing, TLS termination, webhook-triggered deployment from Gitea

Deployment Risks and Mitigations

  • Risk: bot restarts clear in-memory OAuth sessions. Mitigation: dashboard re-auth flow and short-lived session design.
  • Risk: DB connectivity interruptions. Mitigation: startup validation + retry behavior on mileage writes.
  • Risk: edge proxy misroutes dashboard/API traffic. Mitigation: verify upstream hostnames/ports and health checks after deploy.