Steadybase
Deployment

Current Architecture

EC2 + PM2 + Nginx deployment architecture.

Current Architecture

Steadybase currently runs on a single AWS EC2 instance with PM2 process management and Nginx reverse proxy.

Infrastructure

┌─────────────────────────────────────────────┐
│  AWS EC2 (t4g.medium)                       │
│  Region: us-west-2                          │
│  Elastic IP: 34.210.217.25                 │
│  Instance: i-063afb7f24a64376a             │
│                                             │
│  ┌────────────────────────────────────────┐  │
│  │  Nginx                                │  │
│  │  - Reverse proxy (:443 → :3000)       │  │
│  │  - TLS 1.2+ (Let's Encrypt)           │  │
│  │  - Security headers                   │  │
│  │  - Blocks .git, .env, node_modules    │  │
│  └──────────────┬─────────────────────────┘  │
│                 │                             │
│  ┌──────────────▼─────────────────────────┐  │
│  │  PM2 (Process Manager)                │  │
│  │  - Auto-restart on crash              │  │
│  │  - Log rotation                       │  │
│  │  - Environment management             │  │
│  └──────────────┬─────────────────────────┘  │
│                 │                             │
│  ┌──────────────▼─────────────────────────┐  │
│  │  Express Server (:3000)               │  │
│  │  - TypeScript (ts-node)               │  │
│  │  - 5 API routers                      │  │
│  │  - WebSocket server                   │  │
│  └────────────────────────────────────────┘  │
│                                             │
│  App Path: /var/www/durable-minds/          │
└─────────────────────────────────────────────┘

Domain & DNS

RecordValue
Domaindurableminds.steadybase.io
TypeA Record
Target34.210.217.25 (Elastic IP)
TLSLet's Encrypt (auto-renewal via certbot)

PM2 Configuration

PM2 manages the application process:

// ecosystem.config.js
module.exports = {
  apps: [{
    name: 'steadybase',
    script: 'dist/server.js',
    instances: 1,
    autorestart: true,
    watch: false,
    max_memory_restart: '1G',
    env: {
      NODE_ENV: 'production',
      PORT: 3000
    }
  }]
};

Common PM2 Commands

# Start the application
pm2 start ecosystem.config.js
 
# View logs
pm2 logs steadybase
 
# Restart
pm2 restart steadybase
 
# Monitor
pm2 monit

Nginx Configuration

Key nginx settings:

server {
    listen 443 ssl http2;
    server_name durableminds.steadybase.io;
 
    ssl_certificate /etc/letsencrypt/live/durableminds.steadybase.io/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/durableminds.steadybase.io/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
 
    # Block sensitive paths
    location ~ /\. { deny all; }
    location /node_modules { deny all; }
 
    # Proxy to Express
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
    }
}

Deployment Process

Currently manual:

# SSH to the server
ssh ubuntu@34.210.217.25
 
# Pull latest code
cd /var/www/durable-minds
git pull origin main
 
# Install dependencies and build
npm install
npm run build
 
# Restart the application
pm2 restart steadybase

:::warning Manual deployment is a known limitation. A CI/CD pipeline (GitHub Actions) is planned for Phase 2. :::

Limitations

LimitationImpactResolution
Single instanceNo redundancyECS with multi-AZ (Phase 2)
Manual deploymentError-prone, slowCI/CD pipeline (Phase 2)
No health checksSilent failuresHealth monitoring (Phase 1)
No auto-scalingCan't handle spikesECS Fargate auto-scaling (Phase 2)
Secrets in .envNot enterprise-gradeAWS Secrets Manager (Phase 2)

On this page