Small Bets is an online community to support new and aspiring entrepreneurs. This repository contains the source code for the Small Bets web application, which is based on a modified version of Campfire, a Ruby on Rails chat application built by 37signals.
We modified Campfire extensively to serve the needs of the Small Bets community. We have a list of some of the major modifications, along with references to the source code. If you like any of our changes, feel free to incorporate them into your own Campfire instance.
If you would like to help us improve Small Bets, we pay bounties for pull requests that resolve our issues. If you find a bug or have a feature request, we would appreciate it if you post an issue. Thank you!
And if you're not part of the Small Bets community yet, we would love to welcome you onboard!
- Ruby 3.3.1 (check with
ruby --version) - Redis server
- SQLite3
- Node.js with npm (or bun) for Tailwind CSS builds
bin/setupStart the app in development:
bin/devThis starts both the Rails server and Vite dev server using Foreman (via Procfile.dev).
The bin/setup script installs Ruby gems and Node packages (via npm install), prepares the database, and configures the application.
If you skip bin/setup, install frontend dependencies manually with npm install.
All CSS is managed through Vite. Tailwind processes styles from app/frontend/entrypoints/application.css, which is automatically rebuilt during development.
Small Bets uses Kamal for deployment. A modern tool that provides zero-downtime deployments with Docker.
- A Linux server (Ubuntu 20.04+ recommended)
- Docker installed on the server
- A domain name pointing to your server
- Docker Hub account (or another container registry)
- Kamal CLI installed locally (install via
gem install kamal)
-
Initialize Kamal (creates
.kamal/secretsif missing):kamal init
-
Configure environment variables: Edit
.kamal/secretsand add your production secrets, for example:# Registry KAMAL_REGISTRY_PASSWORD=your-docker-hub-password REGISTRY_USERNAME=your-docker-hub-username # Server + domain SERVER_IP=your-server-ip PROXY_HOST=your-domain.com # Application secrets (generate with: rails secret) SECRET_KEY_BASE=your-rails-secret-key RESEND_API_KEY=your-resend-api-key VIMEO_ACCESS_TOKEN=your-vimeo-api-key AWS_ACCESS_KEY_ID=your-aws-access-key AWS_SECRET_ACCESS_KEY=your-aws-secret-key AWS_DEFAULT_REGION=us-east-1 VAPID_PUBLIC_KEY=your-vapid-public-key VAPID_PRIVATE_KEY=your-vapid-private-key WEBHOOK_SECRET=your-webhook-secret COOKIE_DOMAIN=your-domain.com # Optional features GUMROAD_ON=false
-
Initial deployment:
kamal setup # Sets up Docker, builds image, starts services
kamal deploy # Zero-downtime deploymentThis repository includes GitHub Actions for automatic deployment:
-
Set GitHub Secrets in your repository settings:
SSH_PRIVATE_KEY- SSH key for server accessSERVER_IP- Your production server IPDOMAIN- Your domain name (PROXY_HOST)DOCKER_USERNAME&DOCKER_PASSWORD- Docker Hub credentialsSECRET_KEY_BASE- Rails encryption keyRESEND_API_KEY- Email delivery serviceAWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY- File storageAWS_DEFAULT_REGION- AWS region (default: us-east-1)VAPID_PUBLIC_KEY&VAPID_PRIVATE_KEY- Push notificationsWEBHOOK_SECRET- Webhook securityCOOKIE_DOMAIN- Your domain for cookies- Optional:
GUMROAD_ACCESS_TOKEN,GUMROAD_ON,GUMROAD_PRODUCT_IDS
-
Deploy automatically:
- Push to
masterbranch for automatic deployment - Or use "Deploy with Kamal" workflow for manual deployment
- Push to
If you prefer not to use Kamal, you can deploy manually with Docker:
# Build and run
docker build -t smallbets/campfire .
docker run -p 3000:3000 \
-e RAILS_ENV=production \
-e SECRET_KEY_BASE=your-secret-key \
-v /path/to/storage:/rails/storage \
smallbets/campfire| Variable | Purpose | Required |
|---|---|---|
SECRET_KEY_BASE |
Rails encryption key | ✅ |
RESEND_API_KEY |
Email delivery via Resend | ✅ |
AWS_ACCESS_KEY_ID |
File storage on AWS | ✅ |
AWS_SECRET_ACCESS_KEY |
File storage on AWS | ✅ |
AWS_DEFAULT_REGION |
AWS region (us-east-1) | ✅ |
VAPID_PUBLIC_KEY |
Web push notifications | ✅ |
VAPID_PRIVATE_KEY |
Web push notifications | ✅ |
WEBHOOK_SECRET |
Webhook security | ✅ |
COOKIE_DOMAIN |
Session cookies domain | ✅ |
VIMEO_ACCESS_TOKEN |
Video downloads | |
GUMROAD_ACCESS_TOKEN |
Payment processing | |
GUMROAD_ON |
Enable Gumroad features | |
GUMROAD_PRODUCT_IDS |
Gumroad product IDs |
✅ = Required for production deployment