How enricoros/big-agi works
Main Components
• Backend API & Server Layer: Shown in the “app/api”, “src/server”, and “src/server/trpc” directories. These include REST‑like endpoints integrated with TRPC routers, environment configurations, and Prisma (database) configurations.
• Core Modules and Business Logic: The “src/modules” directory indicates a significant amount of business logic split into sub-modules (for LLM integration, beam processing, synchronization, file handling, external vendor integrations such as localAI, Ollama, and many others).
• Data & Database Layer: The “src/server/prisma” folder (including schema.prisma) suggests a relational database managed via Prisma.
• Providers & Shared Utilities: The “src/common” directory holds shared configuration, theming, state management (various “stores”), loggers, hooks, and utility functions which tie together frontend and backend functionality.
• Infrastructure & Deployment: With files like Dockerfile, docker-compose.yaml, and the “docs” folder that contains deployment and configuration guides (for Kubernetes, Cloudflare, Docker, etc.), infrastructure elements are clearly defined.
Relationships and Interactions
• Shared utilities and providers (in “src/common”) are used throughout the system (both client and server). Mark these as common libraries that “inject” functionality into various components.
Architectural Patterns and Design Principles
• Component-Based UI: The frontend is built using React with a folder structure that groups components, hooks, and layouts.
• API Gateway/Router Pattern: TRPC routers consolidate API calls and manage data transformation, acting as a gateway between user requests and business logic.
• Containerization and Deployment: Clearly note Docker, docker-compose, and assorted docs for deployment strategies (Kubernetes, Cloudflare, etc.), indicating that the system is built with cloud and edge deployment in mind.
Relevant Technologies, Frameworks, and Libraries
• Frontend: Next.js, React, various React hooks and state management solutions.
• API/Backend: TRPC, Node.js, Next.js API routes.
• Database: Prisma with a relational database.
• Deployment: Docker, Kubernetes (via provided YAML files), Cloudflare.
• Integrations: Multiple AI model vendors (OpenAI, Anthropic, Gemini, etc.), external integrations (Browserless, Google CSE, CodePen, etc.).