Development Setup

Set up your development environment to start building with SocialTwin.

Prerequisites

  • Node.js 18+
  • pnpm 8+
  • Cloudflare account
  • Wrangler CLI

Installation

1. Install Dependencies

pnpm install

2. Install Wrangler CLI

npm install -g wrangler

3. Login to Cloudflare

wrangler login

Development Servers

Start All Services

./scripts/start-all-services.sh

This starts all workers and the frontend.

Start Individual Services

# Frontend
pnpm run dev:pages

# All Workers
pnpm run dev:workers

# Specific Worker
cd workers/strategy && pnpm run dev

Service URLs

Frontend: http://localhost:3000

Strategy Worker: http://localhost:8787

Knowledge Worker: http://localhost:8789

Content Generation: http://localhost:8790

Approval Queue: http://localhost:8791

Platform Manager: http://localhost:8792

Scheduler: http://localhost:8793

Activity Monitor: http://localhost:8794

Analytics: http://localhost:8795

Lead Intelligence (CRM): http://localhost:8796

Environment Variables

Create `.env.local` files in each package directory:

# Example .env.local
ENVIRONMENT=development
API_KEY_SECRET=your-secret-key
VECTORIZE_INDEX=amplifier-vectors