blackroad-os-monorepo/
├── apps/ # End-user applications
│ ├── web/ # Main web app (migrated)
│ ├── console/ # (Ready for migration)
│ ├── dashboard/ # (Ready for migration)
│ └── mobile/ # (Ready for migration)
│
├── services/ # Backend microservices
│ ├── api/ # (Ready for migration)
│ ├── auth/ # (Ready for migration)
│ ├── billing/ # (Ready for migration)
│ └── gateway/ # (Ready for migration)
│
├── packages/ # Shared libraries
│ ├── shared/ # ✅ Common utilities & constants
│ ├── agent-sdk/ # ✅ Agent development SDK
│ ├── ui/ # (Ready for components)
│ ├── types/ # (Ready for TypeScript definitions)
│ └── config/ # (Ready for shared configs)
│
├── agents/ # AI Agent ecosystem
│ ├── definitions/ # (Ready for 1000+ agent configs)
│ ├── orchestration/ # (Ready for LangGraph/CrewAI)
│ ├── memory/ # (Ready for PS-SHA∞ system)
│ └── communication/ # (Ready for NATS integration)
│
├── infrastructure/ # Infrastructure as Code
│ ├── cloudflare/ # (Ready for Workers/Pages configs)
│ ├── railway/ # (Ready for Railway configs)
│ ├── kubernetes/ # (Ready for K3s manifests)
│ └── raspberry-pi/# (Ready for local LLM configs)
│
└── tooling/ # Developer tools
├── cli/ # (Ready for BlackRoad CLI)
├── scripts/ # (Ready for automation scripts)
├── deployment/ # (Ready for CI/CD)
└── monitoring/ # (Ready for observability)
✅ Turborepo Configuration
- Selective builds based on changes
- Intelligent caching
- Parallel task execution
- Build dependency management
✅ pnpm Workspaces
- Monorepo package management
- Workspace dependencies (
workspace:*) - Fast, efficient installs
- Content-addressable storage
✅ Shared Packages
@blackroad/shared - Common utilities:
- Constants (domains, services, agent limits)
- Utilities (sleep, formatBytes, generateId, retry)
- TypeScript support
@blackroad/agent-sdk - Agent development:
- Base
Agentclass AgentMemorywith PS-SHA∞ hashingAgentCommunicationfor NATS pub/sub- Full TypeScript types
✅ CI/CD Workflows
ci.yml- Continuous integration (lint, type-check, build, test)deploy-cloudflare.yml- Cloudflare deployment automation
✅ Documentation
README.md- Complete monorepo guidedocs/ARCHITECTURE.md- System architecture & designdocs/MIGRATION.md- Service migration guide
cd ~/blackroad-os-monorepo
pnpm install# Run all services
pnpm dev
# Run specific service
pnpm dev --filter=@blackroad/web
# Build all
pnpm build
# Build specific package
pnpm build --filter=@blackroad/agent-sdkpnpm lint
pnpm type-check
pnpm testHigh Priority:
- Migrate Prism Console →
apps/console/ - Migrate API service →
services/api/ - Migrate operator →
services/operator/
Medium Priority:
- Migrate dashboard →
apps/dashboard/ - Migrate auth service →
services/auth/ - Create UI component library →
packages/ui/
Low Priority:
- Migrate mobile app →
apps/mobile/ - Create TypeScript types package →
packages/types/ - Set up monitoring tools →
tooling/monitoring/
# Copy existing agent definitions
cp -r ~/agents/* agents/definitions/
# Set up orchestration
# (LangGraph + CrewAI configurations)
# Integrate NATS
# (Event bus for agent communication)
# Set up Milvus
# (Vector storage for agent memory)Cloudflare:
cd infrastructure/cloudflare
# Add wrangler.toml configs for Workers
# Add Pages deployment configsRailway:
cd infrastructure/railway
# Add railway.json for each service
# Configure environment variablesKubernetes:
cd infrastructure/kubernetes
# Add K3s manifests
# Configure Alice/Octavia clusterRequired Secrets:
CLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDRAILWAY_TOKENGITHUB_TOKEN
Add in: Settings → Secrets and variables → Actions
# Copy automation scripts
cp ~/scripts/*.sh tooling/scripts/
# Update paths to use monorepo structure
# Test each scriptpnpm dev # Run all in dev mode
pnpm dev --filter=@blackroad/web # Run specific service
pnpm build # Build all
pnpm build --filter="@blackroad/*" # Build all BlackRoad packagespnpm lint # Lint all
pnpm type-check # TypeScript check all
pnpm test # Run all testspnpm deploy:cloudflare # Deploy to Cloudflare
pnpm deploy:railway # Deploy to Railway
pnpm deploy:edge # Deploy edge functionspnpm add <package> --filter=@blackroad/web # Add dependency
pnpm remove <package> --filter=@blackroad/web # Remove dependency
pnpm update # Update allturbo run build --graph # Show build graph
turbo run build --filter=[HEAD^1] # Build only changed
turbo run build --dry-run # Show what would run
turbo prune --scope=@blackroad/web # Prune for specific packageFor each service:
- Copy files:
cp -r ~/services/web apps/web/ - Update package.json: Change name to
@blackroad/web - Add workspace deps:
@blackroad/shared,@blackroad/types - Test locally:
pnpm dev --filter=@blackroad/web - Update imports: Use workspace packages
- Test build:
pnpm build --filter=@blackroad/web - Commit:
git add apps/web && git commit - Push:
git push
- Fast: Intelligent caching, parallel execution
- Simple: Minimal config, works out of the box
- Scalable: Handles 100+ packages easily
- Efficient: Content-addressable storage
- Fast: Parallel installs
- Workspace native: First-class monorepo support
- Separation of concerns: Apps vs services vs packages
- Clear boundaries: Each directory has specific purpose
- Scalable: Easy to add new packages
- Standard: Follows community best practices
- Repository: https://github.com/blackboxprogramming/blackroad-os-monorepo
- Documentation:
docs/ - Migration Guide:
docs/MIGRATION.md - Architecture:
docs/ARCHITECTURE.md
Issue: pnpm install fails
rm -rf node_modules pnpm-lock.yaml
pnpm installIssue: Build fails with module not found
pnpm install
turbo run build --forceIssue: TypeScript errors
pnpm type-check
# Fix errors, then
pnpm buildYour monorepo is ready! Start by:
- Installing dependencies:
pnpm install - Migrating a service: Follow
docs/MIGRATION.md - Testing the setup:
pnpm dev
Created: 2026-02-13
Repository: blackroad-os-monorepo
Scale Target: 30K agents → 1M users → 30B users