# fjordllc/bootcamp architecture

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

## Overview

##### Major Architectural Layers and Components
- Client / Browser Layer:
– End-user devices running modern browsers that load the UI.
– These clients interact with the Rails application through web requests and load dynamic content from the front-end JavaScript modules (located under app/javascript) for interactive and rich experiences.
- Web Server and Rails Application (Presentation & Business logic layers):
– The Rails monolith implements controllers (both web and API controllers), models, views, jobs, mailers, decorators, and helpers.
- Controllers (e.g., in app/controllers and its API, admin, mentor subdirectories)
- Models (app/models) that encapsulate business logic along with decorators and concerns.
- Views/templates (app/views) and embedded front-end assets.
- Background Jobs (app/jobs) that handle asynchronous tasks like email notifications, Discord communication, scheduling daily tasks, etc.
- Frontend Assets:
– This includes JavaScript (and possibly Vue or React components under app/javascript) and style assets (SASS files, Tailwind CSS configuration, etc.).
– Show that they are bundled by Webpacker and deployed with the web server.
- Data Layer (Database & Active Storage):
– The system uses a relational database (as configured in config/database.yml) for storing user data, course content, reports, etc.
– Active Storage (config/initializers/active_storage.rb, db/migrate/…create_active_storage_tables) is used for file uploads/images.
- External Services and Integrations:
– Third-party external service integrations are visible throughout:
∗ Discord integration (models and controllers under app/models/discord, app/controllers/connection/discord_controller.rb, Discord jobs, and related cassettes),
∗ GitHub integration (e.g., github_grass),
∗ Payment processing with Stripe (see config/initializers/stripe.rb and stripe/webhooks_controller.rb),
∗ reCAPTCHA (config/initializers/recaptcha.rb),
∗ Email delivery (mailers under app/mailers).
- Background Processing Infrastructure:
– Background jobs run using ActiveJob (and possibly a queuing adapter such as “good_job” or Sidekiq) to process asynchronous tasks.
– They serve tasks such as sending notifications, processing image uploads, running scheduled jobs, and more.
- CI/CD and Deployment Components:
– The project has CircleCI integration (as shown by the CircleCI config files in .circleci) and Google Cloud build scripts.
– The Dockerfiles and devcontainer configurations indicate that developers can run containers locally (with Docker Compose) for consistent environments.
– Deployment orchestration (Procfile.dev, Foreman) should be represented along with the pipelines.

##### Interactions and Data Flow
- Rails app to the Database and Active Storage.

##### Architectural Patterns and Deployment
- That the project uses the MVC pattern and service objects (decorators, concerns) in its business logic.
- Extensive test suite (unit, integration, system tests) and that automated linting is enforced (with RuboCop, ESLint, etc.), which influences the quality and reliability of the system.
– Rectangles for application components (Rails app, database, external services),

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    A["Client Browsers"]:::client
    B["Frontend Assets"]:::frontend
    A -->|"HTTP/HTTPS"| B

    %% Rails Application Subgraph
    subgraph "Rails Application"
        C["Main Web UI"]:::rails
        D["API Endpoints"]:::rails
        E["Controllers"]:::rails
        F["Models & Business Logic"]:::rails
        G["Views/Templates"]:::rails
        H["Background Jobs"]:::jobs
        I["Mailers"]:::rails
        J["Decorators & Helpers"]:::rails
        K["Job Queue (GoodJob)"]:::jobs
    end

    %% Connections from Frontend to Rails
    B -->|"Loads UI"| C
    B -->|"Loads API"| D
    C -->|"Utilizes"| E
    D -->|"Utilizes"| E
    E -->|"Accesses"| F
    F -->|"Renders"| G
    E -->|"Triggers"| H
    H -->|"Enters"| K
    E -->|"Sends"| I
    E -->|"Uses"| J

    %% Data Layer Subgraph
    subgraph "Data Layer"
        L["Database"]:::database
        M["Active Storage"]:::database
    end

    F -->|"CRUD Operations"| L
    F -->|"File Uploads"| M

    %% External Integrations Subgraph
    subgraph "External Integrations"
        N["Discord API"]:::external
        O["Stripe API"]:::external
        P["GitHub Integration"]:::external
        Q["reCAPTCHA"]:::external
    end

    E -->|"Calls"| N
    E -->|"Calls"| O
    E -->|"Calls"| P
    E -->|"Verifies"| Q

    %% CI/CD & Deployment Subgraph
    subgraph "CI/CD & Deployment"
        R["CI/CD Pipeline"]:::ci
        S["Containerization (Docker/DevContainer)"]:::ci
    end

    R -->|"Deploys"| C
    R -->|"Deploys"| D

    %% Test Suite Subgraph
    subgraph "Test Suite"
        T["Automated Tests"]:::tests
    end

    T -->|"Validates"| C

    %% Click Events
    click B "https://github.com/fjordllc/bootcamp/tree/main/app/javascript"
    click E "https://github.com/fjordllc/bootcamp/tree/main/app/controllers"
    click F "https://github.com/fjordllc/bootcamp/tree/main/app/models"
    click G "https://github.com/fjordllc/bootcamp/tree/main/app/views"
    click H "https://github.com/fjordllc/bootcamp/tree/main/app/jobs"
    click I "https://github.com/fjordllc/bootcamp/tree/main/app/mailers"
    click J "https://github.com/fjordllc/bootcamp/tree/main/app/decorators"
    click L "https://github.com/fjordllc/bootcamp/blob/main/config/database.yml"
    click M "https://github.com/fjordllc/bootcamp/blob/main/config/initializers/active_storage.rb"
    click N "https://github.com/fjordllc/bootcamp/tree/main/app/models/discord"
    click O "https://github.com/fjordllc/bootcamp/blob/main/config/initializers/stripe.rb"
    click P "https://github.com/fjordllc/bootcamp/blob/main/app/models/github_grass.rb"
    click Q "https://github.com/fjordllc/bootcamp/blob/main/config/initializers/recaptcha.rb"
    click R "https://github.com/fjordllc/bootcamp/blob/main/.circleci"
    click T "https://github.com/fjordllc/bootcamp/tree/main/test/"

    %% Styles
    classDef client fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef frontend fill:#AEDFF7,stroke:#333,stroke-width:2px;
    classDef rails fill:#C8E6C9,stroke:#333,stroke-width:2px;
    classDef jobs fill:#FFE0B2,stroke:#333,stroke-width:2px;
    classDef database fill:#B3E5FC,stroke:#333,stroke-width:2px;
    classDef external fill:#FFCCBC,stroke:#333,stroke-width:2px;
    classDef ci fill:#E0E0E0,stroke:#333,stroke-width:2px;
    classDef tests fill:#D1C4E9,stroke:#333,stroke-width:2px;
```
