Skip to main content

Prerequisites

Before starting, ensure you have:
  • Node.js 18+ - Download
  • pnpm - Install with npm install -g pnpm
  • Supabase CLI - Install with npm install -g supabase
  • Git - For version control
  • GitHub access - To the trendingsociety repo

Step 1: Clone the Repository

git clone https://github.com/trendingsociety/trendingsociety.git
cd trendingsociety

Step 2: Install Dependencies

pnpm install
This installs dependencies for all apps and packages in the monorepo.

Step 3: Environment Setup

Copy the example environment file:
cp .env.example .env.local
Add the required variables:
# Supabase (Production)
NEXT_PUBLIC_SUPABASE_URL=https://ymdccxqzmhxgbjbppywf.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key_here
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here

# Shopify
SHOPIFY_STORE_DOMAIN=y0nrcb-2y.myshopify.com
SHOPIFY_ACCESS_TOKEN=your_shopify_token

# AI Models (as needed)
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
Get Supabase keys from the Supabase Dashboard. Never commit these to git.

Step 4: Generate Types

Generate TypeScript types from the Supabase schema:
pnpm generate:types
This creates fully-typed database clients.

Step 5: Run Development Server

# Run all apps
pnpm dev

# Or run specific app
pnpm dev --filter=publisher
pnpm dev --filter=dashboard
pnpm dev --filter=agency
Apps will be available at:

Useful Commands

Development

pnpm dev              # Run all apps
pnpm dev --filter=X   # Run specific app
pnpm build            # Build all packages
pnpm typecheck        # Type check everything
pnpm lint             # Lint all code

Database

pnpm generate:types   # Regenerate Supabase types
pnpm db:migrate       # Run pending migrations
pnpm db:reset         # Reset local database

Testing

pnpm test             # Run all tests
pnpm test --filter=X  # Test specific package

IDE Setup

VS Code

Recommended extensions:
  • ESLint
  • Prettier
  • Tailwind CSS IntelliSense
  • Supabase

Cursor

The repo includes .cursorrules for AI-assisted development. Cursor will automatically follow project patterns.

Troubleshooting

”Module not found” errors

# Clear node_modules and reinstall
rm -rf node_modules
pnpm install

Type errors after schema change

# Regenerate types
pnpm generate:types

Port already in use

# Kill process on port
lsof -i :3000 | grep LISTEN | awk '{print $2}' | xargs kill -9

Supabase connection fails

  1. Check .env.local has correct keys
  2. Verify project is running in Supabase dashboard
  3. Check network/firewall settings

Next Steps