# jrmedd/delible architecture

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

- Interactive diagram: https://gitdiagram.com/jrmedd/delible
- Repository: https://github.com/jrmedd/delible

## Overview

##### Main Components to Identify
- Public Assets: Show the “public” directory as a component that provides static files (like index.html, manifest.json, robots.txt, etc.) for the web app. This is essential for supporting PWA functionality and installation on various platforms.
- Source Code (src): Break this into subcomponents for clarity:
- App Component (src/App.jsx): Acts as the top-level container for the app’s UI.
- Utility Logic: For example, the “src/SimpleCrypto.js” file, which implements encryption for securing the data in localStorage.
- UI Components: Represent the various UI components (like Layout, Button, Modal, FadingText, Typography, etc.) as grouped elements that build up the interface.
- Theming: The “src/theme.js” and other styling related modules that define the presentation look and feel.
- Entry Point: The “src/main.jsx” which initializes and renders the React application.

##### Relationships and Interactions
- Entry point (main.jsx) to the App component, indicating that main.jsx bootstraps the React application.
- That the App component interacts with both UI components and utility logic (e.g., calling functionality from SimpleCrypto.js for encryption).

##### Architectural Patterns and Design Principles
- That the project is organized as a single-page application (SPA), following common React modularization practices.
- Separation between UI logic (components in the src/components directory) and business/utility functionality (like encryption in SimpleCrypto.js).

##### Detailed Elements
- “index.html” (serving as the landing page loaded from the public folder).
- “Delible ink Frontend (React App)” showing the overall client-side application.
- “Components Layer” (each subcomponent can be grouped here).
- “Utility/Encryption Module” (SimpleCrypto.js).
- “Entry Point” (main.jsx).
- “Browser localStorage” with an annotation about encryption and data expiration at midnight.
- How main.jsx initializes the App component.
- How App interacts and renders the various UI components.
- That on user input, text is passed to the encryption utility before being saved to localStorage.
- Brief notes or comments next to each component to emphasize design decisions (e.g., “No backend dependency – all data remains in browser” or “PWA-ready static files here”).

- The overall client-side, React-based architecture.
- Separation of concerns between the UI (components), the utility logic (SimpleCrypto), and the environmental dependency (localStorage and static assets).
- Clear flow from application initialization to user interaction, processing, encrypted storage, and eventual data deletion at midnight.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs for main application and public assets
    subgraph "Delible ink Frontend (React/Vite Application)"
        subgraph "Source Code (src)"
            EntryStep("Entry Point (main.jsx)"):::frontend
            AppComp("App Component (App.jsx)"):::frontend
            Util("Utility/Encryption Module (SimpleCrypto.js)"):::utility
            Theme("Theming (theme.js)"):::utility
            UIComp("UI Components (src/components)"):::ui
            IconComp("Icon Components (src/components/icons)"):::ui
        end
        subgraph "Public Assets"
            IndexHTML("index.html"):::public
            PubDir("Public Assets (static files)"):::public
        end
    end

    BrowserLS("Browser LocalStorage (Encrypted)"):::storage
    UserInput("User Interaction"):::ui

    %% Relationships and Data Flow
    EntryStep -->|"Initializes"| AppComp
    AppComp -->|"UsesTheming"| Theme
    AppComp -->|"Renders"| UIComp
    UIComp -->|"IncludesIcons"| IconComp
    AppComp -->|"UsesEncryption"| Util
    UserInput -->|"TypesText"| UIComp
    UIComp -->|"EncryptsText"| Util
    Util -->|"StoresData"| BrowserLS
    IndexHTML -->|"ServesLandingPage"| PubDir
    PubDir -->|"ProvidesStaticFilesFor"| AppComp

    %% Styling Classes
    classDef frontend fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef utility fill:#C1E1C1,stroke:#333,stroke-width:2px;
    classDef ui fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef storage fill:#FFD1DC,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5;
    classDef public fill:#E0BBE4,stroke:#333,stroke-width:2px;

    %% Click Events for Component Mapping
    click EntryStep "https://github.com/jrmedd/delible/blob/main/src/main.jsx"
    click AppComp "https://github.com/jrmedd/delible/blob/main/src/App.jsx"
    click Util "https://github.com/jrmedd/delible/blob/main/src/SimpleCrypto.js"
    click UIComp "https://github.com/jrmedd/delible/tree/main/src/components/"
    click IconComp "https://github.com/jrmedd/delible/tree/main/src/components/icons/"
    click Theme "https://github.com/jrmedd/delible/blob/main/src/theme.js"
    click IndexHTML "https://github.com/jrmedd/delible/blob/main/index.html"
    click PubDir "https://github.com/jrmedd/delible/tree/main/public/"
```
