# austinemuangstubbs/luminary architecture

> Architecture diagram of the GitHub repository austinemuangstubbs/luminary, 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/austinemuangstubbs/luminary
- Repository: https://github.com/austinemuangstubbs/luminary

## Overview

##### Project Type and Purpose
- The project is a full-stack application that converts user-supplied text into an illuminated manuscript style. The README emphasizes features like text input, style selection, real-time preview, and export capabilities.
- It blends a modern React-based front end with a Node.js backend (as seen in the “server” folder), which handles manuscript processing or conversion logic.

##### File Structure
- Top-Level Directories:
- client: Contains the React components (e.g., App.js, RenderView.jsx, TemplateCard.jsx) and styling (in the scss subdirectory). This indicates the UI layer.
- server: Holds the backend logic with files like illuminate.js and server.js. This part is likely responsible for processing the conversion of text to manuscripts and handling API requests.
- data: Contains configuration JSON files that likely define manuscript styles, templates, and other properties used during conversion.
- build: Contains bundled assets (bundle.js and HTML) produced by webpack (as configured in webpack.config.js). This suggests the final build output of the client-side code.
- Supporting Files:
- package.json and package-lock.json: Manage dependencies.
- webpack.config.js: Indicates the use of webpack to bundle and manage the frontend assets.
- README.md: Provides a high-level overview and key features of the application.

##### Architectural Overview
- The system employs a clear separation of concerns:
- Frontend (client): Built with React, this layer handles user interaction (text input, style selection, preview rendering, and displaying export options).
- Backend (server): Likely uses Node.js to process the text, apply the manuscript styling logic (possibly modularized in illuminate.js), and manage API endpoints.
- Data Layer: The “data” folder houses configuration files (and possibly template definitions) that drive how manuscripts are rendered. This can be viewed as a configuration or resource store.
- Build Process: The webpack-based build process takes the client code and produces production-ready bundles in the “build” folder.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    U["User"]:::user

    %% Client/Frontend Layer
    subgraph "Client/Frontend"
        direction TB
        C["Client (React)"]:::frontend
        App["App Component"]:::frontend
        Render["RenderView Component"]:::frontend
        Template["TemplateCard Component"]:::frontend
        TextBox["TextBox Component"]:::frontend
        SCSS["SCSS Styles"]:::frontend
    end

    %% Server/Backend Layer
    subgraph "Server/Backend"
        direction TB
        S["Server (Node.js)"]:::backend
        ServerJS["server.js"]:::backend
        Illum["illuminate.js"]:::backend
    end

    %% Data Configurations Layer
    subgraph "Data Configurations"
        direction TB
        D["Configuration Resources"]:::data
        Configs["JSON Config Files"]:::data
        TemplateFile["template.json"]:::data
    end

    %% Build Process Layer
    subgraph "Build Process"
        direction TB
        B["Build Output"]:::build
        Bundle["bundle.js"]:::build
        Index["index.html"]:::build
        Webpack["webpack.config.js"]:::build
    end

    %% External Export Integration
    subgraph "Export Integration"
        direction TB
        Exp["Export Service (PDF/Image)"]:::external
    end

    %% Data Flow
    U -->|"inputs"| C
    C -->|"apiCall"| S
    S -->|"fetchConfig"| D
    S -->|"returnResult"| C
    C -->|"triggerExport"| Exp
    Exp -->|"deliverFile"| C
    B -->|"deliversBundle"| C

    %% Click Events for Client/Frontend
    click C "https://github.com/austinemuangstubbs/luminary/tree/main/client/"
    click App "https://github.com/austinemuangstubbs/luminary/blob/main/client/components/App.js"
    click Render "https://github.com/austinemuangstubbs/luminary/blob/main/client/components/RenderView.jsx"
    click Template "https://github.com/austinemuangstubbs/luminary/blob/main/client/components/TemplateCard.jsx"
    click TextBox "https://github.com/austinemuangstubbs/luminary/blob/main/client/components/TextBox.jsx"
    click SCSS "https://github.com/austinemuangstubbs/luminary/tree/main/client/scss"

    %% Click Events for Server/Backend
    click S "https://github.com/austinemuangstubbs/luminary/tree/main/server/"
    click ServerJS "https://github.com/austinemuangstubbs/luminary/blob/main/server/server.js"
    click Illum "https://github.com/austinemuangstubbs/luminary/blob/main/server/illuminate.js"

    %% Click Events for Data Configurations
    click D "https://github.com/austinemuangstubbs/luminary/tree/main/data/"
    click Configs "https://github.com/austinemuangstubbs/luminary/tree/main/data/configs"
    click TemplateFile "https://github.com/austinemuangstubbs/luminary/blob/main/data/template.json"

    %% Click Events for Build Process
    click B "https://github.com/austinemuangstubbs/luminary/tree/main/build/"
    click Bundle "https://github.com/austinemuangstubbs/luminary/blob/main/build/bundle.js"
    click Index "https://github.com/austinemuangstubbs/luminary/blob/main/build/index.html"
    click Webpack "https://github.com/austinemuangstubbs/luminary/blob/main/webpack.config.js"

    %% Styling Classes
    classDef user fill:#D6DBDF,stroke:#333,stroke-width:2px;
    classDef frontend fill:#CEF6F5,stroke:#333,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef data fill:#D5F5E3,stroke:#333,stroke-width:2px;
    classDef build fill:#F5EEF8,stroke:#333,stroke-width:2px;
    classDef external fill:#FADBD8,stroke:#333,stroke-width:2px;
```
