# imobrb/site architecture

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

- Interactive diagram: https://gitdiagram.com/imobrb/site
- Repository: https://github.com/imobrb/site

## Overview

##### Project type and purpose
- This is a content-driven, marketing and listing website for “Imobiliária Rio Branco.”
- It uses Astro as a Static Site Generator (SSG) with partial hydration via Vue for interactive widgets.
- The end result is deployed to a CDN (Azion Edge) to serve as a fast, global static site with client-side interactivity.

##### File structure
- Top level: configuration files (.editorconfig, .gitignore, tsconfig.json, tailwind.config.js, astro.config.mjs, vue.config.js)
- env/: environment constants for dev, stage, prod (build-time variables)
- public/: static assets (PDF manual, videos, images)
- src/
- pages/: Astro page entries → builds a page per route
- layouts/: site-wide wrappers (BaseLayout, Default)
- components/astro/: pure Astro components used in templates
- components/vue/: Vue components that hydrate for dynamic behavior
- content/: JSON files that feed static content into pages
- services/: JS modules that fetch real-estate data (or mock data)
- stores/ & composables/: client-side state management (Vue store)
- styles/: global CSS and PrimeVue theme files
- utils/: helper functions for formatting and parsing

##### Key insights from README
- Production vs. development URLs
- No mention of a custom backend—data either comes from external APIs or mock files at build time or runtime

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Deploy Layer
    subgraph "Build & Deploy Layer"
        direction TB
        CI["CI Pipeline\n(GitHub Actions)"]:::build
        click CI "https://github.com/imobrb/site/blob/main/.github/workflows/prod.yml"
        Env["Environment Configuration\n(env consts)"]:::build
        click Env "https://github.com/imobrb/site/blob/main/env/consts.prod.ts"
        AstroCfg["Astro Build\n(astro.config.mjs)"]:::build
        click AstroCfg "https://github.com/imobrb/site/blob/main/astro.config.mjs"
        CI -->|triggers build| AstroCfg
        Env -->|injects vars| AstroCfg

        subgraph "SSG Inputs"
            direction TB
            Pages["Astro Pages\n(src/pages/)"]:::build
            click Pages "https://github.com/imobrb/site/tree/main/src/pages/"
            Layouts["Layouts\n(src/layouts/)"]:::build
            click Layouts "https://github.com/imobrb/site/blob/main/src/layouts/BaseLayout.astro"
            click Layouts "https://github.com/imobrb/site/blob/main/src/layouts/Default.astro"
            Content["Static Content\n(src/content/)"]:::build
            click Content "https://github.com/imobrb/site/tree/main/src/content/"
            AstroComp["Astro Components\n(src/components/astro/)"]:::build
            click AstroComp "https://github.com/imobrb/site/tree/main/src/components/astro/"
            PublicAssets["Public Assets\n(public/)"]:::build
            click PublicAssets "https://github.com/imobrb/site/tree/main/public/"
        end

        Pages --> AstroCfg
        Layouts --> AstroCfg
        Content --> AstroCfg
        AstroComp --> AstroCfg
        PublicAssets --> AstroCfg

        AstroCfg -->|outputs static assets| CDN
    end

    %% CDN Layer
    CDN["CDN / Hosting\n(Azion Edge)"]:::deploy

    %% Runtime Layer
    subgraph "Client-Side Runtime"
        direction TB
        Browser["Browser"]:::runtime

        subgraph "Client UI"
            direction TB
            VueComp["Vue Components\n(src/components/vue/)"]:::runtime
            click VueComp "https://github.com/imobrb/site/tree/main/src/components/vue/"
            Stores["State & Composables\n(src/stores/ & src/composables/)"]:::runtime
            click Stores "https://github.com/imobrb/site/blob/main/src/stores/favorite.js"
            click Stores "https://github.com/imobrb/site/blob/main/src/composables/useBreadcrumb.ts"
            Utils["Utilities\n(src/utils/)"]:::runtime
            click Utils "https://github.com/imobrb/site/blob/main/src/utils/formatReal.js"
            click Utils "https://github.com/imobrb/site/blob/main/src/utils/parserCardImovelData.js"
            Styles["Styles\n(Tailwind & PrimeVue)"]:::runtime
            click Styles "https://github.com/imobrb/site/blob/main/tailwind.config.js"
            click Styles "https://github.com/imobrb/site/tree/main/src/styles/primevue/"
        end

        Browser --> VueComp
        Browser --> Stores
        Browser --> Utils
        Browser --> Styles

        VueComp -->|calls service| Imoveis
    end

    %% Data/API Layer
    subgraph "Data / API Layer"
        direction TB
        Imoveis["Real Estate Service\n(src/services/Imoveis.js)"]:::external
        click Imoveis "https://github.com/imobrb/site/blob/main/src/services/Imoveis.js"
        API["External Real-Estate API"]:::external
        Mock["Mock Data\n(src/mock/)"]:::external
        click Mock "https://github.com/imobrb/site/blob/main/src/mock/get-exclusives.js"
    end

    Browser -->|fetch data| Imoveis
    Imoveis -->|runtime fetch| API
    Imoveis -->|fallback| Mock

    %% Connections
    CDN -->|serves HTML/CSS/JS| Browser

    %% Styles
    classDef build fill:#D0E8FF,stroke:#0366d6,color:#0366d6;
    classDef deploy fill:#FFE8D0,stroke:#d66306,color:#d66306;
    classDef runtime fill:#E0FFD4,stroke:#2d8a0e,color:#2d8a0e;
    classDef external fill:#FFF3CD,stroke:#d69f00,color:#d69f00;
```
