# anhsirk0/landslides architecture

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

- Interactive diagram: https://gitdiagram.com/anhsirk0/landslides
- Repository: https://github.com/anhsirk0/landslides

## Overview

##### Main Components
- Entry Point & Build Tools:
- Index.html that loads the app.
- Vite configuration (vite.config.js) alongside build integrations such as tailwind.config.cjs and postcss.config.cjs. These indicate how the styling (Tailwind CSS/DaisyUI) is applied.
- Application Core:
- Primary application within the src directory, notably App.res and Main.res, which form the core of the application.
- Pages & Routing:
- “src/pages” folder which contains individual landing pages (e.g., Home, Bluesky, Google, Linkedin, Netflix, Reddit, Spotify, Twitter, Youtube, and a specific ErrorPage). Each page (with a corresponding .res file) should be shown as a separate component, reflecting a routing-based design.
- Reusable Components & Shared Logic:
- Under “src/components” and “src/shared”, show the encapsulated reusable UI components (ThemeCard.res, ThemeList.res, OptionsFab.res) and shared utilities, type definitions, hooks, and routing (Route.res) that are used across the application.
- Assets:

##### Relationships & Interactions
- That components under “src/components” and utilities in “src/shared” are imported and used within different pages.
- That the build tools (Vite, Tailwind, DaisyUI) are globally affecting the application through processing and bundling.

##### Architectural Patterns & Design Principles
- Modular Structure: Illustrate the modular decomposition where each “page” is a self-contained view.
- Reusability: Show how “shared” modules and “components” are designed for reusability and maintainability.
- Configuration-Driven Styling: Include how Tailwind and DaisyUI (indicated via tailwind.config.cjs and resources in the README) impact the UI.
- Separation of Concerns: Separate the presentation (React/ReScript pages, components) from the static assets and configuration.

##### Technologies & Tools
- ReScript is used for writing the application logic and UI components.
- Vite acts as the build and development server, while Node (and pnpm) manage dependencies.
- Tailwind CSS (and DaisyUI) is used for styling.
- The project structure supports a clear routing mechanism and modular design, making it ideal for a single-page application with multiple landing pages.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Config Layer
    subgraph "Build & Config Layer"
        indexHtml["index.html"]:::build
        viteConfig["vite.config.js"]:::build
        tailwindConfig["tailwind.config.cjs"]:::build
        postcssConfig["postcss.config.cjs"]:::build
    end

    %% Application Layer
    subgraph "Application Layer"
        appRes["App.res"]:::application
        mainRes["Main.res"]:::application
        sharedUtil["Route/Shared Utilities"]:::shared
    end

    %% Presentation Layer
    subgraph "Presentation Layer"
        subgraph "Pages & Routing"
            homePage["Home.res"]:::page
            blueskyPage["Bluesky.res"]:::page
            googlePage["Google.res"]:::page
            linkedinPage["Linkedin.res"]:::page
            netflixPage["Netflix.res"]:::page
            redditPage["Reddit.res"]:::page
            spotifyPage["Spotify.res"]:::page
            twitterPage["Twitter.res"]:::page
            youtubePage["Youtube.res"]:::page
            errorPage["ErrorPage.res"]:::page
        end
        subgraph "Reusable Components"
            themeCard["ThemeCard.res"]:::component
            themeList["ThemeList.res"]:::component
            optionsFab["OptionsFab.res"]:::component
        end
    end

    %% Assets & Public Content
    subgraph "Assets & Public Content"
        fonts["Fonts: Manrope"]:::asset
        publicAssets["Public Assets"]:::asset
    end

    %% Connections between layers
    indexHtml -->|"loads"| appRes
    indexHtml -->|"loads"| mainRes
    viteConfig -->|"bundles"| appRes
    viteConfig -->|"bundles"| mainRes
    tailwindConfig -->|"styles"| appRes
    postcssConfig -->|"styles"| appRes

    appRes -->|"managesRouting"| sharedUtil
    mainRes -->|"managesRouting"| sharedUtil

    sharedUtil -->|"routesTo"| homePage
    sharedUtil -->|"routesTo"| blueskyPage
    sharedUtil -->|"routesTo"| googlePage
    sharedUtil -->|"routesTo"| linkedinPage
    sharedUtil -->|"routesTo"| netflixPage
    sharedUtil -->|"routesTo"| redditPage
    sharedUtil -->|"routesTo"| spotifyPage
    sharedUtil -->|"routesTo"| twitterPage
    sharedUtil -->|"routesTo"| youtubePage
    sharedUtil -->|"routesTo"| errorPage

    homePage -->|"uses"| themeCard
    homePage -->|"uses"| themeList
    homePage -->|"uses"| optionsFab
    blueskyPage -->|"uses"| themeCard
    googlePage -->|"uses"| themeCard
    linkedinPage -->|"uses"| themeList

    appRes -->|"loadsFonts"| fonts
    homePage -->|"loadsAssets"| publicAssets

    %% Styles
    classDef build fill:#FFCCCC,stroke:#660000,stroke-width:2px;
    classDef application fill:#CCFFCC,stroke:#006600,stroke-width:2px;
    classDef shared fill:#CCCCFF,stroke:#000066,stroke-width:2px;
    classDef page fill:#FFFFCC,stroke:#666600,stroke-width:2px;
    classDef component fill:#CCFFFF,stroke:#006666,stroke-width:2px;
    classDef asset fill:#FFCC99,stroke:#663300,stroke-width:2px;

    %% Click Events
    click indexHtml "https://github.com/anhsirk0/landslides/blob/main//index.html"
    click viteConfig "https://github.com/anhsirk0/landslides/blob/main//vite.config.js"
    click tailwindConfig "https://github.com/anhsirk0/landslides/blob/main//tailwind.config.cjs"
    click postcssConfig "https://github.com/anhsirk0/landslides/blob/main//postcss.config.cjs"
    click appRes "https://github.com/anhsirk0/landslides/blob/main//src/App.res"
    click mainRes "https://github.com/anhsirk0/landslides/blob/main//src/Main.res"
    click sharedUtil "https://github.com/anhsirk0/landslides/blob/main//src/shared/Route.res"
    click homePage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Home/Home.res"
    click blueskyPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Bluesky/Bluesky.res"
    click googlePage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Google/Google.res"
    click linkedinPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Linkedin/Linkedin.res"
    click netflixPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Netflix/Netflix.res"
    click redditPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Reddit/Reddit.res"
    click spotifyPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Spotify/Spotify.res"
    click twitterPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Twitter/Twitter.res"
    click youtubePage "https://github.com/anhsirk0/landslides/blob/main//src/pages/Youtube/Youtube.res"
    click errorPage "https://github.com/anhsirk0/landslides/blob/main//src/pages/ErrorPage.res"
    click themeCard "https://github.com/anhsirk0/landslides/blob/main//src/components/ThemeCard.res"
    click themeList "https://github.com/anhsirk0/landslides/blob/main//src/components/ThemeList.res"
    click optionsFab "https://github.com/anhsirk0/landslides/blob/main//src/components/OptionsFab.res"
    click fonts "https://github.com/anhsirk0/landslides/tree/main//src/assets/fonts/Manrope"
    click publicAssets "https://github.com/anhsirk0/landslides/tree/main//public"
```
