Platform Overview
AICodeRally is a comprehensive AI-native platform with a sophisticated module-first architecture.
See Also: Unified System Architecture - Complete AICodeRally ecosystem including Rally Stack, Rally AI, Agent Protocol, and Franchise System
Architecture
Monorepo Structure
The platform uses Turborepo + pnpm workspaces for efficient monorepo management:
aicoderally-stack/
├── apps/ # Customer-facing applications
│ ├── studio/ # Entry-level workshop platform
│ ├── edge/ # SMB AI transformation
│ ├── summit/ # Enterprise platform
│ ├── website/ # Public marketing site
│ └── docs/ # This documentation site
├── packages/ # Shared code
│ ├── core/ # Type definitions and contracts
│ ├── modules/ # 86 reusable modules
│ ├── connectors/ # Integration adapters
│ └── ui/ # Shared UI components
├── prisma/ # Database schema
└── tools/ # Automation & helpers
Tech Stack
Frontend:
- Next.js 15 with App Router
- React 19
- TypeScript 5
- Tailwind CSS 3.4
- Lucide React (icons)
Backend:
- Prisma ORM with PostgreSQL
- NextAuth v5 (authentication)
- Vercel Blob (file storage)
- Pusher (realtime updates)
Infrastructure:
- Vercel (serverless hosting)
- Prisma Postgres (database)
- Turborepo (build orchestration)
- pnpm (package management)
Architecture 3.0: Four-Layer System
AICodeRally uses a 4-layer architecture that provides clear separation of concerns and enables powerful reuse:
Layer 1: Modules (Capability Library)
Location: packages/modules/*
Purpose: Shared capability library (internal only)
Key Points:
- 86+ reusable modules (donors, grants, pipeline, brand assets, etc.)
- Never visible to end users
- Used by all layers above
- Provides types, logic, and optional shared UI
Examples:
donor-managementgrant-trackingpipeline-managementbrand-assets-librarycontent-calendarcampaigns-manager
Layer 2: Ideation Studio (One Idea → One App)
Location: apps/studio
URL: studio.aicoderally.com
Tagline: One Idea → One App
Purpose: Turn a single idea into a working app (web, mobile, or website)
Focus:
- UX and value delivery
- Simple flows and forms
- Basic data structures
- Zero friction creation
Examples:
- Birthday event app
- PTA signup app
- Brand lookbook app
- Club roster app
- Mini nonprofit landing page
What it's NOT:
- Full business operations (no billing, no pipeline management)
- Multi-app orchestration
- Enterprise governance
Layer 3: Edge Portal (Business Operations)
Location: apps/edge
URL: edge.aicoderally.com
Tagline: Run the Business Around Your Ideas
Purpose: Add business operations layer around apps
Features:
- Customer & account management
- Billing and pipeline
- Projects and operations
- Dashboards and automations
- Vertical solutions
Edge Solutions:
edge-designer-biz-kit– Creative studiosedge-brand-hub– Brand/marketing teamsedge-nonprofit-fundraiser– Nonprofitsedge-restaurant-refresh– Restaurants
Uses:
- Modules from
packages/modules/* - Edge solutions from
packages/solutions/* - Shared UI from
@rally/ui
Layer 4: Summit Solutions (Enterprise Orchestration)
Location: apps/summit
URL: summit.aicoderally.com
Tagline: Custom. Cross-App. Cross-Business. Scale.
Purpose: Custom solutions spanning multiple Edge portals and Studio apps
Features:
- Cross-org analytics
- Governance and compliance
- Complex workflows across entities
- Multi-tenant data views
- AI agent orchestration
- Enterprise-grade security
Summit Solutions:
summit-bhg-spm-suite– SPM consulting platformsummit-enterprise-spm-accelerator– Enterprise SPM governance
Target Customers:
- Enterprises (1000+ employees)
- Multi-location organizations
- Complex nonprofits
- Institutions requiring cross-business orchestration
The Power of This Architecture
This 4-layer structure provides:
- Clear Narrative - Easy for anyone to understand
- Technical Sanity - Scalable, maintainable system
- Zero Overlap - Each layer has distinct responsibilities
- Clean Value Chain - From idea → app → business → enterprise
- Module Reuse - Shared capabilities across all layers
- Clear Boundaries - For developers and AI agents
- Perfect Franchise Story - Sellable at every layer
See the Architecture 3.0 documentation for complete details.
Module System
Module Architecture
Every module exports standardized metadata:
export const module: RallyModule = {
meta: {
id: string, // kebab-case
name: string,
description: string,
version: string, // semver
category: string,
route: string,
tier: string[], // studio, edge, summit
domain?: string[], // nonprofit, spm, dev, etc.
connectors?: {
database?: boolean,
auth?: boolean,
storage?: boolean,
ai?: boolean,
email?: boolean,
}
}
}
Module Categories
86 modules across 10 categories:
- Accounting & Finance (5 modules)
- Analytics & Intelligence (4 modules)
- Content & Marketing (8 modules)
- CRM & Sales (8 modules)
- Events & Community (3 modules)
- Nonprofit/Social Impact (15 modules)
- Operations & Logistics (8 modules)
- People & HR (8 modules)
- Planning & Governance (7 modules)
- Tools & Utilities (11 modules)
See the Module Reference for complete details.
Database Architecture
Prisma Schema
Total: 2,675 lines, 100+ tables
Key Areas:
- Authentication system (users, sessions, OAuth)
- Module-specific tables (donors, grants, SOWs, etc.)
- Pit Wall collaboration (threads, comments, reactions)
- Knowledge management (documents, sessions)
- Nomenclature system (categories, domains, wrappers)
Connection Strategy
- Direct Connection - For migrations, Prisma Studio, scripts
- Prisma Accelerate - For production (connection pooling, caching)
Deployment Strategy
Development
- Local development with hot reload
- Development database (aicoderally-dev-db)
- Direct Prisma connections
Preview
- Vercel preview deployments
- Development database
- Full feature testing
Production
- Vercel production deployment
- Production database (aicoderally-prod-db)
- Prisma Accelerate connection pooling
- Auto-scaling
See the Deployment Guide for details.
Security
Authentication
- NextAuth v5 with multiple providers
- Google OAuth
- Apple OAuth
- Email/Password
Authorization
- Role-based access control (RBAC)
- Tenant isolation
- API route protection
Best Practices
- Environment variable secrets
- CSRF protection
- XSS prevention
- Rate limiting
- Input validation
Performance
Optimization Strategies
- Code splitting
- Image optimization (next/image)
- Bundle analysis
- Database query optimization
- Connection pooling (Prisma Accelerate)
- API response caching
Monitoring
- Vercel Analytics
- Error tracking (planned: Sentry)
- Performance metrics
- Database query profiling