# g3lasio/andy-ai-by-claude architecture

> Architecture diagram of the GitHub repository g3lasio/andy-ai-by-claude, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/g3lasio/andy-ai-by-claude
- Repository: https://github.com/g3lasio/andy-ai-by-claude

## Overview

##### Project’s Main Components
- Frontend Presentation Layer: Represented by the Next.js “app” directory (e.g., app/page.tsx, layout.tsx, globals.css). This forms the user interface and client-side logic.
- Business Logic / Core Services: Under “src/core”, you have the chat and documents subdirectories. These include various service modules (chat.service, document.service, validation, etc.) and support utilities (e.g., intent-analyzer). This layer handles core functionalities like messaging, document management, and processing logic.
- Specialized Domain Modules: Under “src/modules/taxAdvisor”, the project implements specific services for tax advisory functions (e.g., IRS communication, tax form processing, tax tracking, etc.). This clearly indicates domain-specific business logic.
- Shared and Supporting Infrastructure: The “src/shared” directory holds configuration aspects (Firebase config, caching, error handling, logging, etc.) and common types & utilities that are reused across other parts of the system.
- External Tools & Infrastructure:
- Configuration files and scripts (e.g., nodemon.json, jest.config.js, vitest.config.ts) indicate testing strategy and deployment configurations.
- The presence of a “public” directory and assets suggests static file handling.
- Integration points may include external services such as Firebase and possibly external tax-related APIs.

##### Out the Relationships
- How the user interacts with the Frontend, initiating requests that are handled server-side using Next.js’s server functions.
- Specialized Module (taxAdvisor) as a distinct component that may interact with the core services or directly with the frontend if there are dedicated tax-related pages.
- Shared layer interacting with all other components, providing configuration, shared utilities (e.g., caching, logging, error handling), and common types.
- If applicable, illustrate external integrations (like Firebase) feeding into the Shared layer or Core services, depending on how they’re utilized.

##### Architectural Patterns and Design Principles
- Component-Based Separation: The project is clearly organized by separation of concern–with the frontend, core business logic, specialized modules, and shared utilities in distinct directories.
- Testing & Quality Assurance Layers: With dedicated test directories (using Jest and Vitest), indicate testing as part of the development pipeline. This isn’t a component per se in the runtime architecture but shows the design emphasis on correctness and reusability.
- Dependency Management & Configuration: Emphasize the configuration files (like next.config.js, tailwind.config.ts, firebase.config.ts) as key enablers that bind various parts of the system together.

##### Following Elements
- Clear Labels: Each component should be clearly named (e.g., “Next.js Frontend”, “Chat Service”, “Document Service”, “TaxAdvisor Module”, “Shared Utilities”).
– Rectangles for major modules (Frontend, Core Services, Domain Modules).
– Ovals for utility services or external integrations.

##### Details to Emphasize
- Essential architectural elements by considering every major directory in “src” that holds business-critical code.
- Logical layering: UI (Next.js app), business logic (core chat and document processing), domain-specific modules (tax adivory), and shared infra (configurations, utilities).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Presentation Layer"
        FE["Next.js Frontend"]:::frontend
    end

    subgraph "Business Logic / Core Services"
        CS["Chat Service"]:::core
        DS["Document Service"]:::core
    end

    subgraph "Specialized Domain Modules"
        TA["TaxAdvisor Module"]:::specialized
    end

    SI["Shared Infrastructure & Utilities"]:::shared

    FE -->|"APIRequest"| CS
    FE -->|"APIRequest"| DS
    FE -->|"TaxOperations"| TA

    CS -->|"Uses"| SI
    DS -->|"Uses"| SI
    TA -->|"Uses"| SI

    click FE "https://github.com/g3lasio/andy-ai-by-claude/tree/main/src/app"
    click CS "https://github.com/g3lasio/andy-ai-by-claude/tree/main/src/core/chat"
    click DS "https://github.com/g3lasio/andy-ai-by-claude/tree/main/src/core/documents"
    click TA "https://github.com/g3lasio/andy-ai-by-claude/tree/main/src/modules/taxAdvisor"
    click SI "https://github.com/g3lasio/andy-ai-by-claude/tree/main/src/shared"

    classDef frontend fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef core fill:#ABEBC6,stroke:#229954,stroke-width:2px;
    classDef specialized fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef shared fill:#FADBD8,stroke:#922B21,stroke-width:2px;
```
