Skip to main content

Directory Layout

trendingsociety/
├── apps/                    # Deployable applications
│   ├── agency/             # Client services dashboard
│   ├── docs/               # This documentation site
│   ├── dashboard/          # Main dashboard (app.trendingsociety.com)
│   ├── platform/           # Creator tools portal
│   └── publisher/          # Blog network frontend

├── services/                # Backend infrastructure
│   └── mcp/                 # MCP Server (Cloudflare Workers)

├── packages/               # Shared runtime code
│   ├── content-engine/     # Content generation utilities
│   ├── db/                 # Supabase client + types
│   ├── eslint-config/      # Shared ESLint config
│   ├── typescript-config/  # Shared TS config
│   └── ui/                 # Shared React components

├── database/               # Database management
│   └── migrations/         # SQL migration files

├── docs/                   # Additional documentation
├── scripts/                # Build/utility scripts
├── skills/                 # MCP skill definitions
├── supabase/              # Supabase local config

├── AGENTS.md              # AI agent delegation rules
├── SCHEMA.md              # Database documentation
├── SCHEMA_CONCEPTS.md     # Conceptual overview
├── turbo.json             # Turborepo config
└── pnpm-workspace.yaml    # Workspace definition

Apps

Each app is independently deployable:
AppPurposeDeployment
publisherBlog network frontendVercel
platformCreator tools portalVercel
agencyClient dashboardVercel
dashboardMain dashboardVercel
mcp (in services/)MCP tools APICloudflare Workers
docsDocumentation siteMintlify

Packages

Shared code imported by apps:

@trendingsociety/db

Supabase client and TypeScript types:
import { supabase, type Database } from '@trendingsociety/db'

// Fully typed queries
const { data } = await supabase
  .from('publisher_posts')
  .select('*')

@trendingsociety/ui

Shared React components:
import { Button, Card, Input } from '@trendingsociety/ui'

@trendingsociety/content-engine

Content generation utilities:
import { generateArticle, analyzeContent } from '@trendingsociety/content-engine'

Key Files

FilePurpose
AGENTS.mdAI agent capabilities, delegation rules
SCHEMA.mdDatabase table documentation
turbo.jsonBuild pipeline configuration
.cursorrulesCursor AI instructions
.mcp.jsonMCP server configuration

Package Management

We use pnpm workspaces with Turborepo for:
  • Efficient dependency hoisting
  • Parallel builds
  • Incremental caching
  • Dependency graph awareness

Common Commands

# Install all dependencies
pnpm install

# Run all apps in dev mode
pnpm dev

# Run specific app
pnpm dev --filter=publisher

# Build all packages
pnpm build

# Type check everything
pnpm typecheck

# Lint everything
pnpm lint

Adding New Apps

  1. Create folder in apps/:
    mkdir apps/new-app
    
  2. Add package.json:
    {
      "name": "@trendingsociety/new-app",
      "dependencies": {
        "@trendingsociety/db": "workspace:*",
        "@trendingsociety/ui": "workspace:*"
      }
    }
    
  3. Import shared packages:
    import { supabase } from '@trendingsociety/db'
    
  4. Add app-specific tables with {appname}_ prefix

Adding Apps Guide

Step-by-step guide for new applications