# anderrodsan/andr architecture

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

- Interactive diagram: https://gitdiagram.com/anderrodsan/andr
- Repository: https://github.com/anderrodsan/andr

## Overview

##### Main Components Identification
- Frontend Application: Represented by the NextJS framework, utilizing the new app router (see src/app) to handle different site routes (Home, About, Blog, Projects, and Bookmarks).
- MDX Content Layer: The content directory holds Markdown (MDX) files for the blog and project posts. This layer is processed via next-mdx-remote, enabling dynamic rendering of static MDX content.
- UI and Component Library: The src/components folder is full of sub-directories that group functionality (e.g., shared styling, UI components, animations using framer-motion, themed components, and more). This encapsulates design elements and interactive components.
- API Routes: Although the site is static, there is an API folder (src/app/api) that provides server-side functionalities (for example, generating OG images for social sharing).
- Database (Local Content): Instead of an external backend, "db" files in src/db (e.g., blog.ts, projects.ts) are likely used as in-memory or static JSON-like data sources for various parts of the site.
- Public Assets: The public folder contains static assets like images, SVGs, logos, and other static files that are loaded by the client.

##### Relationships and Interactions
- The NextJS App layer (routes under src/app) controls page rendering. Each page imports and composes various components from src/components to render content.
- The MDX files in the content directory are parsed and rendered into React components via next-mdx-remote, interfacing with custom MDX components (located in src/components/mdx).
- API routes (e.g., for OG images) interact with client requests and serve dynamically generated content.
- The UI component system (shared components, custom UI elements, animations) provides a consistent look and feel across the website, often interacting with theming and state management (e.g., using next-themes for dark mode toggling).

##### Architectural Patterns & Design Principles
- File-based Routing & Modular Component Design: The project leverages NextJS’s file-based routing (each page or API route is a file) and a modular design where components are reused in multiple areas.
- Responsive & Interactive Design: Use of RadixUI, ShadcnUI, and framer-motion components indicate a design that is not only functional but also interactive and responsive.
- Static Site Generation & MDX-based Content: By placing markdown content in the /content folder and using MDX, the project embraces a content-focused, development-friendly strategy.

##### Technologies, Frameworks, and Libraries (to include
- NextJS (React framework with app directory structure and file-based routing).
- TypeScript.
- TailwindCSS (for styling and responsive design).
- MDX / next-mdx-remote for processing markdown to React components.
- RadixUI & ShadcnUI for UI components.
- Framer-motion for animations.
- next-themes for dark/light mode support.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Application"
        A["NextJS App Routes"]:::nextjs
    end

    subgraph "MDX Content Processing"
        B1["MDX Content Files"]:::mdx
        B2["MDX Custom Components"]:::mdx
        B1 -->|"uses"| B2
    end

    subgraph "UI Component Library"
        C["UI Components"]:::ui
    end

    subgraph "API Services"
        D["API Routes (OG Generation)"]:::api
    end

    subgraph "Local Data Sources"
        E["Local Database (db files)"]:::db
    end

    subgraph "Static Assets"
        F["Public Assets"]:::public
    end

    subgraph "External Libraries & Tools"
        G["NextJS, TypeScript, TailwindCSS"]:::external
        H["MDX/next-mdx-remote"]:::external
        I["RadixUI, ShadcnUI, framer-motion, next-themes"]:::external
        J["Additional Libraries (lucide-react, react-icons, nextjs-toploader, sugar-high)"]:::external
    end

    %% Main Data Flows
    A -->|"renders pages"| C
    A -->|"parses markdown"| B1
    B1 -->|"processed to UI"| C
    A -->|"calls"| D
    C -->|"reads data from"| E
    A -->|"loads"| F

    %% External Library Dependencies
    A -.->|"powered by"| G
    B1 -.->|"handled by"| H
    C -.->|"styled and animated using"| I
    A & C -.->|"enhanced by"| J

    %% Click Events for Components
    click A "https://github.com/anderrodsan/andr/tree/main/src/app"
    click B1 "https://github.com/anderrodsan/andr/tree/main/content"
    click B2 "https://github.com/anderrodsan/andr/tree/main/src/components/mdx"
    click C "https://github.com/anderrodsan/andr/tree/main/src/components"
    click D "https://github.com/anderrodsan/andr/tree/main/src/app/api"
    click E "https://github.com/anderrodsan/andr/tree/main/src/db"
    click F "https://github.com/anderrodsan/andr/tree/main/public"

    %% Styles
    classDef nextjs fill:#AEDFF7,stroke:#1F8AC0,stroke-width:2px;
    classDef mdx fill:#FFF4A3,stroke:#CCB800,stroke-width:2px;
    classDef ui fill:#C3F7C0,stroke:#3B8E3B,stroke-width:2px;
    classDef api fill:#F7C3C3,stroke:#C03B3B,stroke-width:2px;
    classDef db fill:#E3E3E3,stroke:#7D7D7D,stroke-width:2px;
    classDef public fill:#D3D3F7,stroke:#5858B2,stroke-width:2px;
    classDef external fill:#FCE4EC,stroke:#D81B60,stroke-width:2px;
```
