Last updated: Aug 4, 2025, 11:26 AM UTC

NudgeCampaign v4 Setup Checklist

Status: Complete
Version: v4
Purpose: Step-by-step setup guide for new deployments

Prerequisites

  • Docker Desktop installed and running
  • At least 10GB free disk space
  • Git repository cloned

Setup Steps

1. Environment Configuration

  • Copy .env.example to .env (if not exists)
  • Add API keys to .env:
    • OPENROUTER_API_KEY
    • ANTHROPIC_API_KEY
    • POSTMARK_SERVER_API_TOKEN
    • STRIPE_SECRET_KEY (optional for MVP)

2. Docker Deployment

# Start all services
docker compose up -d

# Wait for services to initialize (30-60 seconds)
docker compose ps

3. n8n API Key Setup (CRITICAL)

This must be done manually on first deployment:

  1. Access n8n UI: http://localhost:5678
  2. Login with: admin / password
  3. Navigate to: Settings β†’ API
  4. Click: Generate API Key
  5. Copy the generated key
  6. Add to .env file:
    N8N_API_KEY=your-generated-key-here
    

Current v4 API Key (for reference):

N8N_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIwZTVkZTM5Ni04Mzg3LTQyYWQtYmZmMi0wZDExYWE5MTNmNzEiLCJpc3MiOiJuOG4iLCJhdWQiOiJwdWJsaWMtYXBpIiwiaWF0IjoxNzU0MjMwMTQ2fQ.PcuqTYftCXV2bD9wN76Ho9vAtLP4Wv_19a8Rew_tvrY

4. Import n8n Workflows

# After setting N8N_API_KEY in .env
./scripts/import-via-api.sh

5. Application Access

6. Verification

  • Can login to app at http://localhost:3002/login
  • Navigation sidebar is visible
  • All menu items load without 404
  • n8n workflows are imported and active
  • Can create a test campaign via chat

Important Notes

Database Configuration

  • n8n now uses PostgreSQL (not SQLite) to avoid disk space issues
  • All containers have memory limits to prevent resource exhaustion
  • Database migrations run automatically on startup

Resource Limits

  • App: 2GB memory limit
  • PostgreSQL: 2GB memory limit
  • n8n: 1GB memory limit
  • Redis: 512MB with LRU eviction

Known Issues & Solutions

Issue: "SQLITE_FULL: database or disk is full"
Solution: n8n is configured to use PostgreSQL. If this occurs, check Docker disk usage with docker system df

Issue: n8n workflows don't import
Solution: Ensure N8N_API_KEY is set in .env and valid

Issue: Supabase Auth service restarts
Solution: This is expected - test auth system bypasses it

Troubleshooting Commands

# Check all services status
docker compose ps

# View logs for specific service
docker compose logs n8n
docker compose logs app

# Restart a specific service
docker compose restart n8n

# Clean rebuild (if needed)
docker compose down
docker system prune -f
docker compose up -d --build

Next Steps After Setup

  1. Create API key in n8n (if not done)
  2. Import workflows using ./scripts/import-via-api.sh
  3. Test campaign creation via chat interface
  4. Configure Postmark for real email sending
  5. Set up production domain and SSL

Production Deployment

For production, additionally:

  1. Change all default passwords
  2. Use environment-specific .env files
  3. Configure proper SSL certificates
  4. Set up monitoring and backups
  5. Use managed database service
  6. Configure CDN for static assets