# makevoid/raudo architecture

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

- Interactive diagram: https://gitdiagram.com/makevoid/raudo
- Repository: https://github.com/makevoid/raudo

## Overview

##### Project Type and Purpose
- Raudo is a Ruby-based web application with a clear focus on deployment and task management. The application incorporates OAuth integration (specifically via Google OAuth2), and its UI is built to be mobile friendly (using Materialize CSS).
- The project uses a Rack-based setup (note the config.ru file) and follows an MVC-like pattern, given the presence of directories such as models, views, and the main app.rb.

##### Analyzing the File Structure
- Root files (Gemfile, Rakefile, Readme.md, config.ru) indicate a Ruby project managed by Bundler and Rake, with a Rack configuration to start the application.
- The app.rb file likely acts as the central controller or router for incoming web requests.
- The app includes:
- a models directory containing Ruby classes (like Action, Machine, Domain, etc.) which encapsulate business logic.
- a views directory with HAML files that render the UI.
- a public folder holding static assets (CSS, JavaScript, images, fonts).
- a config directory with environment-specific files, deployment scripts, and server configuration (vhost.conf).
- a lib directory comprising helper modules or classes (like event_stream, notify, and remote_execution) which support various functionalities.
- External dependency management is done through npm (package.json), Bower (bower.json), and RubyGems.

##### Components & Their Relationships
- Main Application Layer:
- app.rb: Acts as the entry point; orchestrates routing and request handling.
- config.ru: Bootstraps the Ruby web application with Rack.
- Presentation Layer:
- views: Houses all the HAML files for generating dynamic HTML.
- public: Contains static resources (JS, CSS, images) necessary for the front-end.
- Business Logic and Persistence:
- models: Contains domain-specific objects (for example, for actions, tasks, and machine management).
- Service Infrastructure & Helper Components:
- lib: Provides reusable modules (like event streaming, remote execution, or notify services) that support background tasks and other auxiliary functionalities.
- External Integration:
- OAuth (using Google OAuth2): Set up via the README instructions and integrated into the app to handle authentication.
- DevOps & Deployment:
- config: Manages environment variables, deployment configurations, and server settings.
- Shell scripts (run.sh, rrun.sh) might be used for bootstrapping or operational tasks.

##### Key Architectural Patterns
- MVC Pattern: Clearly visible through the segregation of model (logic), view (presentation), and controller layers (in app.rb).
- Layered Architecture: Distinguished separation between configuration, application core, service helpers, and the UI components.
- External API Integration: The OAuth component and possibly future integrations mentioned in TODO (e.g., Slack, nginx/mruby) are key extensions to the core system.

##### Diagrammatic Elements
- Connections between the “Backend/Application” and the external OAuth service representing authentication flow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend/UI Layer
    subgraph "Frontend/UI Layer"
        F1["Views (HAML)"]:::frontend
        F2["Public (assets)"]:::frontend
    end

    %% Backend/Application Layer
    subgraph "Backend/Application Layer"
        B1["config.ru"]:::backend
        B2["app.rb"]:::backend
    end

    %% Domain/Business Logic
    subgraph "Domain/Business Logic"
        D1["Action"]:::domain
        D2["Machine"]:::domain
        D3["Domain"]:::domain
    end

    %% Service & Utility Components
    subgraph "Service & Utility Components"
        S1["Event Stream"]:::utility
        S2["Remote Execution"]:::utility
        S3["Notify"]:::utility
    end

    %% Configuration & Deployment
    subgraph "Configuration & Deployment"
        C1["Config"]:::config
        C2["run.sh"]:::config
        C3["rrun.sh"]:::config
    end

    %% External Integration
    E1["Google OAuth2"]:::external

    %% Connections
    F1 -->|"HTTP_Request"| B2
    F2 -->|"HTTP_Request"| B2
    B1 -->|"Bootstraps"| B2
    B2 -->|"Executes"| D1
    B2 -->|"Executes"| D2
    B2 -->|"Executes"| D3
    B2 -->|"Triggers"| S1
    B2 -->|"Triggers"| S2
    B2 -->|"Triggers"| S3
    B2 -->|"Authenticates"| E1
    B2 -->|"Configured_by"| C1
    C1 -->|"Uses_script"| C2
    C1 -->|"Uses_script"| C3

    %% Click Events
    click B2 "https://github.com/makevoid/raudo/blob/master/app.rb"
    click B1 "https://github.com/makevoid/raudo/blob/master/config.ru"
    click F1 "https://github.com/makevoid/raudo/blob/master/views/index.haml"
    click F2 "https://github.com/makevoid/raudo/blob/master/public/main.css"
    click D1 "https://github.com/makevoid/raudo/blob/master/models/action.rb"
    click D2 "https://github.com/makevoid/raudo/blob/master/models/machine.rb"
    click D3 "https://github.com/makevoid/raudo/blob/master/models/domain.rb"
    click S1 "https://github.com/makevoid/raudo/blob/master/lib/event_stream.rb"
    click S2 "https://github.com/makevoid/raudo/blob/master/lib/remote_execution.rb"
    click S3 "https://github.com/makevoid/raudo/blob/master/lib/notify.rb"
    click C1 "https://github.com/makevoid/raudo/blob/master/config/deploy.rb"
    click C2 "https://github.com/makevoid/raudo/blob/master/run.sh"
    click C3 "https://github.com/makevoid/raudo/blob/master/rrun.sh"

    %% Styles
    classDef frontend fill:#add8e6,stroke:#333,stroke-width:2px;
    classDef backend fill:#90ee90,stroke:#333,stroke-width:2px;
    classDef domain fill:#ffeb99,stroke:#333,stroke-width:2px;
    classDef utility fill:#d3d3d3,stroke:#333,stroke-width:2px;
    classDef config fill:#ffc0cb,stroke:#333,stroke-width:2px;
    classDef external fill:#ffa500,stroke:#333,stroke-width:2px;
```
