A modern TypeScript monorepo for ReplyGuy AI-powered social media reply system, built with TurboRepo and standard TypeScript tooling.
This monorepo uses a clean architecture with clear separation between apps and packages:
apps/- Deployable runtime servicespackages/- Reusable, side-effect-free libraries
.
βββ apps/ # β Deployable services
β βββ ingestion/ # Webhook intake β queue
β βββ worker/ # Queue worker β OpenAI etc.
β βββ ai_agent/ # Python AI agent service
β βββ web/ # Next.js dashboard & mini-app
β
βββ packages/ # β Reusable libraries
β βββ core/ # Types, logger, errors
β βββ db/ # Supabase typed queries
β βββ queue/ # Redis abstraction
β βββ ai_service/ # OpenAI client with cost controls
β βββ neynar/ # Farcaster/Neynar API client
β βββ user/ # User management utilities
β βββ ui/ # React components (shadcn/ui)
β βββ config/ # Shared tooling configurations
β
βββ infra/ # Infrastructure as Code
This project does NOT use tsup. Instead, it uses standard TypeScript tooling:
- Build:
tsc -p tsconfig.build.json - Dev:
tsc -p tsconfig.build.json --watch - Type Check:
tsc --noEmit
- Build:
tsc -p tsconfig.build.json - Dev:
tsx watch src/index.ts - Type Check:
tsc --noEmit
We use shared TypeScript configurations from packages/config/tsconfig/:
base.json- Common settings for all projectslibrary.json- For packages/librariesnode.json- For Node.js applications
- Node.js 18+
- pnpm 8.15.4+
pnpm install# Start all services in development mode
pnpm dev
# Build all packages and apps
pnpm build
# Run type checking across all projects
pnpm check-types
# Lint all code
pnpm lint
# Run tests
pnpm test
# Format code
pnpm format
# Clean all build outputs
pnpm clean# Work on a specific package
cd packages/core
pnpm dev
# Work on a specific app
cd apps/worker
pnpm devpnpm dev- Start all services in development modepnpm build- Build all packages and applicationspnpm test- Run tests across all projectspnpm lint- Lint all TypeScript codepnpm check-types- Type check all projectspnpm format- Format code with Prettierpnpm clean- Remove all build artifacts
Each package and app has these scripts:
build- Build the package/appdev- Start in development modecheck-types- Type check onlylint- Lint the codetest- Run tests (where applicable)clean- Remove build artifacts
- TypeScript - Type-safe JavaScript
- tsx - TypeScript execution and watch mode for apps
- TurboRepo - Monorepo build system with caching
- ESLint - Code linting
- Prettier - Code formatting
- Jest - Testing framework
@replyguy/core- Core utilities used by all packages@replyguy/config- Shared configurations
@replyguy/db- Database layer (Supabase)@replyguy/queue- Queue abstraction (Redis)@replyguy/neynar- Farcaster API client@replyguy/ai_service- OpenAI integration@replyguy/user- User management
# All services
pnpm dev
# Individual services
cd apps/ingestion && pnpm dev
cd apps/worker && pnpm dev
cd apps/web && pnpm dev# Build everything first
pnpm build
# Start services
cd apps/ingestion && pnpm start
cd apps/worker && pnpm start
cd apps/web && pnpm startThe project uses TypeScript project references for efficient type checking:
# Check types for everything
pnpm check-types
# Check types for specific package
cd packages/core && pnpm check-types# Run all tests
pnpm test
# Run tests for specific package
cd packages/db && pnpm testCore utilities, types, and logging functionality used across all packages.
Supabase client with typed queries and database abstractions.
Queue abstraction layer supporting Redis Streams.
OpenAI client with cost controls and token management.
Neynar API client for Farcaster protocol integration.
User management and authentication utilities.
Reusable React components built with shadcn/ui and Tailwind CSS.
Shared ESLint, Prettier, and TypeScript configurations.
Each app in apps/ is designed to be independently deployable:
- ingestion - Webhook ingestion service
- worker - Background job processor
- web - Next.js web application
- ai_agent - Python-based AI service
- Make sure all types check:
pnpm check-types - Ensure code is formatted:
pnpm format - Run linting:
pnpm lint - Run tests:
pnpm test - Build successfully:
pnpm build
This project is private and proprietary to ReplyGuy.