# nickisnoble/hygge_quest_public architecture

> Architecture diagram of the GitHub repository nickisnoble/hygge_quest_public, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nickisnoble/hygge_quest_public
- Repository: https://github.com/nickisnoble/hygge_quest_public

## Overview

##### Main System Components

a) Client Layer
- Web Browser Interface
- Progressive Web App (PWA) Support
- Hotwire/Turbo/Stimulus Components

b) Application Layer
- Authentication System (Passwordless)
- Guest Management
- Party Management
- Guild System
- Location/Map Services
- Mailing System
- Admin (Dungeon Master) Interface

c) Storage Layer
- SQLite Database
- AWS S3 (Active Storage)
- File System Cache

##### Component Relationships

**[Client Layer]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Storage Layer]**

##### Detailed Component Breakdown

- Rectangles (Blue): Core Features
- Guest Management
- Party Management
- Guild System
- Location Services

- Hexagons (Green): External Services
- AWS S3
- Resend Email
- Geocoding Service

- SQLite Database
- File System

- Rounded Rectangles (Purple): Frontend Components
- Turbo Frames
- Stimulus Controllers
- PWA Components

##### Key Workflows to Highlight

a) Guest RSVP Flow:
**Browser → Passwordless Auth → Party Controller → Guest Management → Database**

b) Admin (DM) Flow:
**DM Interface → Cerberus Authentication → Admin Controllers → Data Management**

c) Mailing System:
**Mailer Controller → Resend Service → Guest Email**

##### Technology Stack Labels

- Rails 7.1
- TailwindCSS
- Hotwire/Turbo/Stimulus
- SQLite
- AWS S3
- Resend
- Leaflet Maps

##### Security Layer

Security components:
- Passwordless authentication
- Cerberus admin protection
- Session management

Remember to include a clear indication of the temporary nature of the application and its specific purpose as a wedding RSVP system, as this influences architectural decisions like the use of SQLite and file-based storage.

This system design should effectively communicate both the technical architecture and the unique themed aspects of the application, making it clear how the various components work together to create this specialized wedding RSVP experience.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        PWA["PWA Support"]:::pwa
        Hotwire["Hotwire/Turbo/Stimulus"]:::frontend
    end

    subgraph Application
        Auth["Authentication System"]:::auth
        GuestMgmt["Guest Management"]:::core
        PartyMgmt["Party Management"]:::core
        GuildSys["Guild System"]:::core
        LocationSvc["Location Services"]:::core
        MailSys["Mailing System"]:::service
        AdminUI["Admin (DM) Interface"]:::admin
        Security["Security Layer"]:::security
    end

    subgraph Storage
        DB[(SQLite Database)]:::storage
        S3[("AWS S3")]:::external
        Cache[("File System Cache")]:::storage
    end

    subgraph External
        Resend["Resend Email"]:::external
        Geocoding["Geocoding Service"]:::external
    end

    %% Client Layer Connections
    Browser --> PWA
    Browser --> Hotwire
    PWA --> Auth
    Hotwire --> Auth

    %% Auth Connections
    Auth --> GuestMgmt
    Auth --> PartyMgmt
    Auth --> Security

    %% Core Feature Connections
    GuestMgmt --> DB
    PartyMgmt --> DB
    GuildSys --> DB
    LocationSvc --> Geocoding
    LocationSvc --> DB

    %% Admin Connections
    AdminUI --> Security
    Security --> GuestMgmt
    Security --> PartyMgmt
    Security --> GuildSys

    %% Storage Connections
    GuestMgmt --> S3
    PartyMgmt --> Cache
    LocationSvc --> Cache

    %% Mailing System Connections
    MailSys --> Resend
    MailSys --> DB

    %% Click Events
    click PWA "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/pwa_controller.rb"
    click Hotwire "https://github.com/nickisnoble/hygge_quest_public/tree/main/app/javascript/controllers"
    click Auth "https://github.com/nickisnoble/hygge_quest_public/blob/main/config/initializers/passwordless.rb"
    click GuestMgmt "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/guests_controller.rb"
    click PartyMgmt "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/parties_controller.rb"
    click GuildSys "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/guilds_controller.rb"
    click LocationSvc "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/locations_controller.rb"
    click MailSys "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/mailers/guest_mailer.rb"
    click AdminUI "https://github.com/nickisnoble/hygge_quest_public/tree/main/app/controllers/dungeon_master"
    click Security "https://github.com/nickisnoble/hygge_quest_public/blob/main/app/controllers/concerns/dungeon_master/cerberus.rb"

    %% Styling
    classDef core fill:#3b82f6,color:white
    classDef frontend fill:#9333ea,color:white
    classDef external fill:#22c55e,color:white
    classDef storage fill:#6b7280,color:white
    classDef service fill:#f59e0b,color:white
    classDef security fill:#dc2626,color:white
    classDef admin fill:#7c3aed,color:white
    classDef auth fill:#0891b2,color:white
    classDef pwa fill:#db2777,color:white
```
