Skip to content

Deployment GuideΒΆ

OverviewΒΆ

RapidTriageME can be deployed in multiple environments. This guide covers all deployment scenarios from local development to production.

Deployment OptionsΒΆ

πŸš€ Quick DeployΒΆ

# Clone repository
git clone https://github.com/YarlisAISolutions/rapidtriageME.git
cd rapidtriageME

# Install dependencies
npm install

# Deploy to production
./scripts/04-deploy.sh production

πŸ“‹ Deployment MethodsΒΆ

Method Use Case Time Complexity
Local Testing Development 1 min Easy
Cloudflare Workers Production 5 min Medium
Custom Domain Branded deployment 10 min Medium
Full Production Enterprise 15 min Advanced

PrerequisitesΒΆ

Required ToolsΒΆ

  • Node.js >= 18.0.0
  • npm >= 9.0.0
  • Git >= 2.0.0
  • Cloudflare Account (free tier works)
  • Chrome Browser >= 120

Required AccountsΒΆ

  1. Cloudflare Account
  2. Sign up at cloudflare.com
  3. Free plan is sufficient
  4. Note your Account ID

  5. GitHub Account (optional)

  6. For documentation hosting
  7. For version control

Environment SetupΒΆ

1. Clone RepositoryΒΆ

git clone https://github.com/YarlisAISolutions/rapidtriageME.git
cd rapidtriageME

2. Install DependenciesΒΆ

# Install all dependencies
npm install

# Install Cloudflare CLI globally
npm install -g wrangler

3. Configure EnvironmentΒΆ

# Copy environment template
cp .env.example .env

# Edit with your values
code .env

Required environment variables:

# Cloudflare Configuration
CLOUDFLARE_ACCOUNT_ID=your_account_id
CLOUDFLARE_API_TOKEN=your_api_token  # Optional with OAuth

# Application Settings
BROWSER_TOOLS_PORT=3025
NODE_ENV=production

4. Authenticate with CloudflareΒΆ

# Use OAuth login (recommended)
./scripts/03-oauth-login.sh

# Or use API token
wrangler login

Deployment WorkflowΒΆ

graph TD
    A[Start] --> B[Setup Environment]
    B --> C[Configure Cloudflare]
    C --> D{Local Test?}
    D -->|Yes| E[Run Local Server]
    D -->|No| F[Deploy to Cloudflare]
    E --> G[Test Extension]
    F --> H[Configure Domain]
    H --> I[Test Production]
    G --> J[Ready for Development]
    I --> K[Production Ready]

Quick CommandsΒΆ

DevelopmentΒΆ

# Start local server
./scripts/02-test-local.sh

# Watch for changes
npm run dev

# Run tests
npm test

DeploymentΒΆ

# Deploy to staging
wrangler deploy --env staging

# Deploy to production
wrangler deploy --env production

# Check deployment status
wrangler tail --env production

MaintenanceΒΆ

# View logs
wrangler tail

# Check metrics
wrangler analytics

# Update dependencies
npm update

Project StructureΒΆ

rapidtriageME/
β”œβ”€β”€ src/                   # Source code
β”‚   β”œβ”€β”€ worker.ts         # Main worker
β”‚   └── types/            # TypeScript types
β”œβ”€β”€ rapidtriage-extension/ # Chrome extension
β”œβ”€β”€ rapidtriage-mcp/      # MCP server
β”œβ”€β”€ scripts/              # Deployment scripts
β”‚   β”œβ”€β”€ 01-load-env.sh    # Environment loader
β”‚   β”œβ”€β”€ 02-test-local.sh  # Local testing
β”‚   β”œβ”€β”€ 03-oauth-login.sh # Cloudflare auth
β”‚   β”œβ”€β”€ 04-deploy.sh      # Deployment
β”‚   └── 05-add-dns.sh     # DNS setup
β”œβ”€β”€ docs-site/            # Documentation
β”œβ”€β”€ wrangler.toml         # Cloudflare config
└── package.json          # Dependencies

Configuration FilesΒΆ

wrangler.tomlΒΆ

name = "rapidtriage-me"
main = "src/worker.ts"
compatibility_date = "2024-12-12"

[env.production]
name = "rapidtriage-production"
route = "rapidtriage.me/*"
vars = { BROWSER_TOOLS_PORT = "3025" }

package.json ScriptsΒΆ

{
  "scripts": {
    "dev": "wrangler dev",
    "deploy": "wrangler deploy",
    "test": "vitest",
    "build": "tsc"
  }
}

TroubleshootingΒΆ

Common IssuesΒΆ

Authentication Failed

# Clear old tokens
unset CLOUDFLARE_API_TOKEN
unset CF_API_TOKEN

# Re-authenticate
wrangler login

Port Already in Use

# Find process using port
lsof -i :3025

# Kill process
kill -9 <PID>

DNS Not Resolving

Wait 5-10 minutes for DNS propagation

# Check DNS status
dig rapidtriage.me
nslookup rapidtriage.me

Next StepsΒΆ

SupportΒΆ