# inevitable-team/compiled-mcr-events architecture

> Architecture diagram of the GitHub repository inevitable-team/compiled-mcr-events, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inevitable-team/compiled-mcr-events
- Repository: https://github.com/inevitable-team/compiled-mcr-events

## Overview

##### Main System Components

a) Data Sources Layer
- External services (Meetup, Eventbrite, Google Calendar)
- API connections and authentication points
- GroupIds configuration files

b) Data Gathering Layer
- Center around the dataGather.js component
- Source-specific adapters (eventbrite.js, meetup.js, googleCalendar.js)
- Template processors (event.js, group.js)

c) Data Processing Layer
- Transformation flow from raw data to structured formats
- DataToHTML.js processor
- Different output formats (HTML, JSON, iCal)

d) Output Layer
- Static site generation components
- File outputs (_site directory)
- Web interface components

##### Architectural Flow

**[External Services] → [Source Adapters] → [Data Gatherer] → [Data Processors] → [Output Generators] → [Static Site]**

**[GitHub Actions] → [Cron Trigger] → [Netlify Build Hook] → [Site Deployment]**

##### Component Details

For each major component, include:
- Input/output formats
- Key dependencies
- Configuration requirements
- API endpoints (where applicable)

##### Important Elements to Highlight

- Template system architecture
- Data transformation pipeline
- Multiple output format generation
- Automation and deployment flow
- Configuration management

**┌─ External Services ─┐  ┌─ Data Processing ─┐  ┌─ Output Generation ─┐**
- Meetup           │  │ - Data Gathering   │  │ - HTML             │
- Eventbrite      │→ │ - Transformation   │→ │ - JSON             │
- Google Calendar  │  │ - Template Process │  │ - iCal             │
- ┘   └─────────────────┘   └──────────────────┘
- ↑                      ↑                      ↑
- Configuration Files ───────────────┘

##### Additional Notes

Annotations for:
- Environment variables requirements
- API key configurations
- Build process requirements
- Deployment prerequisites

Remember to highlight the automated nature of the system, showing how it periodically updates and regenerates the static site through GitHub Actions and Netlify deployment hooks.

This approach will give a clear understanding of how the system aggregates events from multiple sources, processes them, and generates various output formats while maintaining automated updates.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef external fill:#a8d1f0,stroke:#333
    classDef source fill:#90EE90,stroke:#333
    classDef process fill:#FFE5B4,stroke:#333
    classDef output fill:#FFA07A,stroke:#333
    classDef config fill:#D3D3D3,stroke:#333
    classDef automation fill:#DDA0DD,stroke:#333

    subgraph ExternalServices["External Services Layer"]
        Meetup["Meetup API"]:::external
        Eventbrite["Eventbrite API"]:::external
        GCal["Google Calendar API"]:::external
    end

    subgraph SourceAdapters["Source Adapters Layer"]
        MeetupAdapter["Meetup Adapter"]:::source
        EventbriteAdapter["Eventbrite Adapter"]:::source
        GCalAdapter["Google Calendar Adapter"]:::source
        GroupConfig["Group IDs Config"]:::config
    end

    subgraph DataGathering["Data Gathering Layer"]
        DataGatherer["Data Gatherer"]:::process
        GroupProcessor["Group Details Processor"]:::process
        EventTemplate["Event Template"]:::process
        GroupTemplate["Group Template"]:::process
    end

    subgraph DataProcessing["Data Processing Layer"]
        HTMLProcessor["HTML Data Processor"]:::process
        MainProcessor["Main Processing Script"]:::process
        Config["Configuration"]:::config
    end

    subgraph OutputLayer["Output Generation Layer"]
        LayoutGen["Layout Generator"]:::output
        StaticAssets["Static Assets"]:::output
        Styles["Main Styles"]:::output
        ClientScripts["Client-side Scripts"]:::output
    end

    subgraph Automation["Automation Layer"]
        GHActions["GitHub Actions"]:::automation
        Dependabot["Dependabot"]:::automation
    end

    %% Connections
    Meetup --> MeetupAdapter
    Eventbrite --> EventbriteAdapter
    GCal --> GCalAdapter

    MeetupAdapter & EventbriteAdapter & GCalAdapter --> DataGatherer
    GroupConfig --> DataGatherer
    
    DataGatherer --> GroupProcessor
    EventTemplate & GroupTemplate --> DataGatherer
    
    GroupProcessor --> HTMLProcessor
    HTMLProcessor --> MainProcessor
    Config --> MainProcessor
    
    MainProcessor --> LayoutGen
    LayoutGen --> StaticAssets
    Styles & ClientScripts --> StaticAssets

    GHActions --> MainProcessor
    Dependabot --> GHActions

    %% Click events
    click MeetupAdapter "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/sources/meetup.js"
    click EventbriteAdapter "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/sources/eventbrite.js"
    click GCalAdapter "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/sources/googleCalendar.js"
    click GroupConfig "https://github.com/inevitable-team/compiled-mcr-events/tree/master/_data/sources/groupIds/"
    click DataGatherer "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/dataGather.js"
    click GroupProcessor "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/groupDetails.js"
    click EventTemplate "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/sources/templates/event.js"
    click GroupTemplate "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_data/sources/templates/group.js"
    click HTMLProcessor "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_static/scripts/dataToHTML.js"
    click MainProcessor "https://github.com/inevitable-team/compiled-mcr-events/blob/master/script.js"
    click Config "https://github.com/inevitable-team/compiled-mcr-events/blob/master/config.json"
    click LayoutGen "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_layout/index.js"
    click StaticAssets "https://github.com/inevitable-team/compiled-mcr-events/tree/master/_static/"
    click Styles "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_static/style.css"
    click ClientScripts "https://github.com/inevitable-team/compiled-mcr-events/blob/master/_static/scripts/main.js"
    click GHActions "https://github.com/inevitable-team/compiled-mcr-events/blob/master/.github/workflows/main.yml"
    click Dependabot "https://github.com/inevitable-team/compiled-mcr-events/blob/master/.github/dependabot.yml"

    %% Legend
    classDef legend fill:#f9f9f9,stroke:#333
    subgraph Legend
        L1["External Services"]:::external
        L2["Source Components"]:::source
        L3["Processing Components"]:::process
        L4["Output Components"]:::output
        L5["Configuration Files"]:::config
        L6["Automation Components"]:::automation
    end
```
