Moneyline

Self-Hosting

Run Moneyline on your own infrastructure.

The fastest way to get a full Moneyline stack running.

Prerequisites

  • Docker Engine 24+
  • Docker Compose v2
  • 4GB+ RAM

Quick Start

git clone https://github.com/moneyline/moneyline.git
cd moneyline/deploy/docker

cp .env.example .env
# Edit .env with your configuration

docker compose up -d

This starts:

  • API — Node.js API server (port 3000)
  • ML — Python ML service (port 8000)
  • Dashboard — Next.js dashboard (port 3001)
  • Supabase — PostgreSQL + Auth + Storage (ports 54321-54322)
  • Redis — Cache + rate limiting (port 6379)
  • Inngest — Background job processing (port 8288)

Development Mode

docker compose -f docker-compose.dev.yml up -d

Enables hot reload for API, ML, and dashboard services.

Kubernetes

Prerequisites

  • Kubernetes 1.28+
  • kubectl configured
  • Ingress controller (nginx-ingress recommended)

Deploy

cd deploy/k8s

# Create namespace
kubectl apply -f namespace.yaml

# Deploy services
kubectl apply -f deployment-api.yaml
kubectl apply -f deployment-ml.yaml
kubectl apply -f service.yaml
kubectl apply -f ingress.yaml

Configuration

Set environment variables via ConfigMap or Secrets:

apiVersion: v1
kind: Secret
metadata:
  name: moneyline-secrets
  namespace: moneyline
data:
  DATABASE_URL: <base64-encoded>
  API_KEY_ENCRYPTION_KEY: <base64-encoded>
  BETTER_AUTH_SECRET: <base64-encoded>
  R2_ACCESS_KEY_ID: <base64-encoded>
  R2_SECRET_ACCESS_KEY: <base64-encoded>

Single Binary

For simple deployments, the API can run as a standalone Bun process:

# Install deps (workspace-aware)
bun install

# Run migrations
bun run db:migrate

# Build + start
bun run turbo build --filter @moneyline/api
bun apps/api/dist/server.js

Requires an external PostgreSQL database, Redis instance, and an S3-compatible object store (Cloudflare R2, AWS S3, Backblaze B2, or MinIO).

Environment Variables

VariableRequiredDefaultDescription
DATABASE_URLYesPostgreSQL connection string
REDIS_URLNoredis://localhost:6379Redis connection string
BETTER_AUTH_SECRETYes32+ char secret (openssl rand -base64 32)
BETTER_AUTH_URLNohttp://localhost:3000Base URL of the API
BETTER_AUTH_TRUSTED_ORIGINSNolocalhostComma-separated origin allowlist
API_KEY_ENCRYPTION_KEYYes32-char encryption key
R2_ENDPOINTYesS3-compatible endpoint (e.g. R2 account URL)
R2_ACCESS_KEY_IDYesObject storage access key
R2_SECRET_ACCESS_KEYYesObject storage secret
R2_DOCUMENTS_BUCKETNomoneyline-documentsDocs bucket
R2_EXPORTS_BUCKETNomoneyline-exportsExports bucket
PORTNo3000API server port
HOSTNo0.0.0.0API server host
LOG_LEVELNoinfoLog level (debug, info, warn, error)
CORS_ORIGINNo*CORS allowed origins

Health Check

curl http://localhost:3000/v1/health

Returns:

{
  "status": "ok",
  "version": "0.1.0",
  "services": {
    "database": "connected",
    "redis": "connected",
    "ml": "connected"
  }
}

On this page