# gabrielcartier/eliza-bootstrap architecture

> Architecture diagram of the GitHub repository gabrielcartier/eliza-bootstrap, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gabrielcartier/eliza-bootstrap
- Repository: https://github.com/gabrielcartier/eliza-bootstrap

## Overview

##### Project type and purpose
- This is a full‐stack web application (“Eliza bootstrap”) comprising a React/Next.js frontend and a Bun/TypeScript backend that implements an Eliza‐style chatbot API.

##### File structure
- Top‐level folders:
- frontend/ – Next.js 13 App Router code (UI components, layouts, pages, Tailwind config).
- backend/ – Bun/TypeScript REST API broken into api (route definitions), controllers (HTTP handlers), services (business logic), clients (external calls), cache (DB cache initializer), plugins/adapter-postgres (Postgres persistence), templates (Eliza response templates), utils and types.
- Config and build files: bun.lock, biome.json, .env.* for production, package.json scripts, tsconfig.json in both frontend and backend.

##### README for additional insights
- Confirms use of Bun as the runtime, commands to install and launch both frontend and backend.

## Diagram (Mermaid)

```mermaid
graph TB
    Browser["Web Browser"]:::external
    Browser -->|"HTTP/HTTPS"| FApp

    subgraph "Frontend Tier"
        FApp["Next.js Frontend"]:::frontend
        GlobalsCSS["Global Stylesheet"]:::frontend
        RootLayout["Root Layout"]:::frontend
        HomePage["Home Page"]:::frontend
        UILib["UI Component Library"]:::frontend
        LayoutComps["Layout Components"]:::frontend
        PageComps["Page-specific Components"]:::frontend
        HTTPUtils["Frontend Utilities"]:::utils
        TailwindCFG["Tailwind Configuration"]:::frontend
    end

    FApp --> GlobalsCSS
    FApp --> RootLayout
    FApp --> HomePage
    FApp --> UILib
    FApp --> LayoutComps
    FApp --> PageComps
    FApp --> HTTPUtils
    FApp --> TailwindCFG
    GlobalsCSS --> TailwindCFG
    RootLayout --> PageComps
    PageComps --> HomePage

    HTTPUtils -->|"calls API"| ApiRouter

    subgraph "Backend Tier"
        BEntry["Backend Entry Point"]:::backend
        ApiRouter["API Router Definitions"]:::api
        MsgController["Message Controller"]:::controller
        MsgService["Message Service"]:::service
        ElizaCore["Eliza Engine Core"]:::service
        ElizaChar["Eliza Character Definitions"]:::service
        BaseTemplates["Base Response Templates"]:::service
        ClientsModule["External Clients Module"]:::client
        CacheInit["Cache Initialization Script"]:::service
        PGAdapter["Postgres Persistence Adapter"]:::plugin
        BConfig["Backend Configuration"]:::config
        ApiRoutes["API Routes Config"]:::config
        ReqTypes["Request Type Definitions"]:::types
        BUtils["Backend Utilities"]:::utils
        BPackage["Backend package.json"]:::config
    end

    HTTPUtils --> ApiRouter
    ApiRouter --> MsgController
    MsgController --> MsgService
    MsgService --> ElizaCore
    ElizaCore --> ElizaChar
    ElizaCore --> BaseTemplates
    MsgService --> ClientsModule
    MsgService --> CacheInit
    CacheInit --> PGAdapter
    ClientsModule --> PGAdapter
    PGAdapter --> PostgresDB
    BEntry --> BConfig
    BEntry --> BPackage
    BConfig --> ApiRoutes
    ApiRouter --> ReqTypes
    MsgController --> ReqTypes
    MsgController --> BUtils

    PostgresDB[(Postgres DB)]:::db

    click FApp "https://github.com/gabrielcartier/eliza-bootstrap/tree/main/frontend/src/app"
    click GlobalsCSS "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/app/globals.css"
    click RootLayout "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/app/layout.tsx"
    click HomePage "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/app/page.tsx"
    click UILib "https://github.com/gabrielcartier/eliza-bootstrap/tree/main/frontend/src/components/ui"
    click LayoutComps "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/components/layouts/main-layout.tsx"
    click PageComps "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/components/pages/home.tsx"
    click HTTPUtils "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/src/lib/utils.ts"
    click TailwindCFG "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/frontend/tailwind.config.js"
    click BEntry "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/index.ts"
    click ApiRouter "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/api/api.ts"
    click MsgController "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/controllers/message-controller.ts"
    click MsgService "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/services/message-service.ts"
    click ElizaCore "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/eliza/index.ts"
    click ElizaChar "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/eliza/character.ts"
    click BaseTemplates "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/templates/base-templates.ts"
    click PGAdapter "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/plugins/adapter-postgres/index.ts"
    click CacheInit "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/cache/initialize-db-cache.ts"
    click ClientsModule "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/clients/index.ts"
    click BConfig "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/config/index.ts"
    click ApiRoutes "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/config/api-routes.ts"
    click ReqTypes "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/types/requests/message-request.ts"
    click BUtils "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/src/utils/action.ts"
    click BPackage "https://github.com/gabrielcartier/eliza-bootstrap/blob/main/backend/package.json"

    classDef external fill:#8dd3c7,stroke:#333,stroke-width:1px
    classDef frontend fill:#b3cde3,stroke:#333,stroke-width:1px
    classDef utils fill:#fdb462,stroke:#333,stroke-width:1px
    classDef backend fill:#ccebc5,stroke:#333,stroke-width:1px
    classDef api fill:#ffffb3,stroke:#333,stroke-width:1px
    classDef controller fill:#fb8072,stroke:#333,stroke-width:1px
    classDef service fill:#80b1d3,stroke:#333,stroke-width:1px
    classDef client fill:#fdb462,stroke:#333,stroke-width:1px
    classDef plugin fill:#fccde5,stroke:#333,stroke-width:1px
    classDef config fill:#d9d9d9,stroke:#333,stroke-width:1px
    classDef types fill:#bc80bd,stroke:#333,stroke-width:1px
    classDef db fill:#b3de69,stroke:#333,stroke-width:1px
```
