SPCBotSPCBot Docs

DevOps

Learn how devops work in SPCBot and how to configure them for your team.

Visual Guide

Drop real screenshots into the paths below. This grid is rendered by src/app/docs/components/image-placeholder.tsx.

Dashboard Overview

Main dashboard with stats and recent deployments

public/docs/images/dashboard-overview.png

Server List

Connected servers and their health status

public/docs/images/servers-list.png

Deployment View

Live deployment logs and progress

public/docs/images/deployment-view.png

Automated testing, building, and deployment using GitHub Actions.

Workflow Overview

CI Workflow

Lint, type-check, unit tests, and E2E tests on every PR

Build Workflow

Build and push Docker images to GitHub Container Registry

Deploy Staging

Auto-deploy to port 9027 on staging_18 branch

Deploy Production

Auto-deploy to port 9003 on 18.0 branch with backup

Workflow Files

WorkflowFileTriggerPurpose
CI.github/workflows/ci.ymlEvery PRTest + Lint + Type-check
Build.github/workflows/build.ymlPush to main/staging/18.0Build Docker images
Deploy Staging.github/workflows/deploy-staging.ymlstaging_18 branchDeploy to staging server
Deploy Production.github/workflows/deploy-production.yml18.0 branchDeploy to production server

Environment Setup (Same Server)

EnvironmentWeb PortAPI PortDirectory
Staging90279028/opt/spcbot-staging
Production90039004/opt/spcbot-production

Required GitHub Secrets

STAGING_SSH_KEY           # SSH private key
STAGING_HOST              # 172.20.0.189
STAGING_USER              # root
PRODUCTION_SSH_KEY        # Same key as staging
PRODUCTION_HOST           # 172.20.0.189
PRODUCTION_USER           # root
NEXT_PUBLIC_API_URL       # http://172.20.0.189:9004

Docker Compose Files

  • docker-compose.staging.yml - Staging environment (ports 9027/9028)
  • docker-compose.production.yml - Production environment (ports 9003/9004)
  • docker-compose.prod.yml - Legacy production file

Testing Suite

Test Coverage

Comprehensive unit and E2E testing for critical paths

Unit Tests (Jest)

Core service tests with mocked dependencies:

  • auth.service.spec.ts - Authentication & authorization
  • servers.service.spec.ts - Server management
  • projects.service.spec.ts - Project operations
  • environments.service.spec.ts - Environment CRUD
  • deployment.worker.spec.ts - Background job processing

Jest Configuration

// apps/api/jest.config.js
module.exports = {
  preset: 'ts-jest',
  testEnvironment: 'node',
  roots: ['/src'],
  testMatch: ['**/*.spec.ts'],
  setupFilesAfterEnv: ['/test/setup.ts'],
  collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
}

E2E Tests (Playwright)

Full browser automation testing:

# Run E2E tests
cd apps/web
pnpm test:e2e

# Run with UI
pnpm test:e2e --ui

Running Tests

# All tests
pnpm test

# API tests only
pnpm --filter @spcbot/api test

# With coverage report
pnpm test:coverage

Test Scripts (package.json)

"scripts": {
  "test": "jest",
  "test:watch": "jest --watch",
  "test:coverage": "jest --coverage",
  "test:e2e": "playwright test"
}