Deployment Guide
Relevant source files
The following files were used as context for generating this wiki page:
The SweepBot Deployment Guide outlines the procedures, environment requirements, and architectural standards for deploying the SweepBot ecosystem. SweepBot is a multi-layered platform consisting of a React dashboard, a Fastify API, a browser extension, and various background services. The deployment strategy leverages a monorepo structure managed by pnpm and Turborepo to ensure consistent builds across all components.
This guide focuses on the infrastructure-as-code approach, CI/CD integration via GitHub Actions, and the specific hosting providers utilized for the various segments of the application. For information on the core logic driving these services, see the Technical Architecture.
Infrastructure and Hosting
SweepBot utilizes a distributed hosting strategy to optimize performance and cost across its different layers. The system is built on a PostgreSQL foundation provided by Supabase, with Redis used for caching and job queuing.
Hosting Providers
| Layer | Provider | Purpose |
|---|---|---|
| Frontend (Web) | Vercel | React 18 SPA Dashboard |
| Backend (API) | Railway | Fastify 5 REST + WebSocket API |
| Database | Supabase | PostgreSQL 16 with RLS |
| Cache / Queues | Upstash | Redis (REST + BullMQ) |
| Background Services | Replit / Railway | Health-checker, Jackpot-poller, ToS-monitor |
Sources: AGENTS.md, README.md, CLAUDE.md
Architectural Topology
The following diagram illustrates the deployment relationship between the client layers, the API layer, and external data services.
Visual representation of the SweepBot service distribution across hosting providers.
Sources: SWEEPBOT_DASHBOARD.html, CLAUDE.md
CI/CD Pipeline
The CI/CD pipeline is managed via GitHub Actions and is the primary responsibility of the DevOps and Documentation Specialist. The pipeline is designed to ensure code quality through automated testing and type checking before deployment.
Pipeline Workflow
- Validation: Automated testing (Vitest) and type checking (TypeScript strict mode) are triggered on every push.
- Build: Turborepo orchestrates the build process in dependency order.
- Security Scanning: SAST and dependency auditing are performed to identify vulnerabilities.
- Deployment: Successful builds are deployed to staging or production environments.
Sources: AGENT_4_DEVOPS_DOCS.md, CLAUDE.md
Automated Pipeline Tasks
The sequence of automated checks required for a successful deployment.
Sources: AGENT_4_DEVOPS_DOCS.md, README.md
Environment Configuration
Deployment requires a strictly validated set of environment variables. The server is configured to validate these at startup and will refuse to boot if critical variables are missing or incorrectly formatted.
Critical Environment Variables
| Variable | Requirement | Description |
|---|---|---|
DATABASE_URL | Required | Connection string for PostgreSQL 16 |
SUPABASE_URL | Required | API URL for Supabase Auth/Storage |
SUPABASE_SERVICE_ROLE_KEY | Required | Administrative key for backend operations |
STRIPE_SECRET_KEY | Required | Billing integration key |
STRIPE_WEBHOOK_SECRET | Required | Verification secret for incoming webhooks |
UPSTASH_REDIS_REST_URL | Required | URL for Redis cache and BullMQ |
RESEND_API_KEY | Required | Key for transactional email delivery |
Sources: AGENTS.md, CLAUDE.md, SWEEPBOT_DASHBOARD.html
Deployment Scripts
Standardized scripts are used to manage the deployment lifecycle and database state. These are executed from the root of the pnpm workspace.
# Database Management
pnpm db:migrate # Pushes schema changes via Drizzle Kit
pnpm db:seed # Populates the database with required test/initial data
# Build and Packaging
pnpm build # Builds all apps and packages in dependency order
pnpm --filter @sweepbot/extension build:zip # Packages extension for Chrome/Firefox
Background Services
SweepBot maintains several Python-based microservices that monitor platform status and data. These services are typically deployed to Replit or Railway.
- Health-checker: Monitors platform uptime every 5 minutes.
- Jackpot-poller: Polls jackpot values from supported platforms every 60 seconds.
- ToS-monitor: Scans for Terms of Service changes on a daily basis.
Sources: CLAUDE.md, AGENT_1_BACKEND_DATABASE.md
Conclusion
The SweepBot deployment architecture is designed for high availability and strict data integrity. By utilizing specialized hosting providers and an automated CI/CD pipeline, the system ensures that performance-critical layers like the Fastify API remain scalable, while the PostgreSQL foundation remains secure through Row Level Security (RLS). Strict environment validation and dependency-ordered builds via Turborepo are central to maintaining a reliable production environment.