# yousefbilal/banner-to-google-calendar architecture

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

- Interactive diagram: https://gitdiagram.com/yousefbilal/banner-to-google-calendar
- Repository: https://github.com/yousefbilal/banner-to-google-calendar

## Overview

##### Main Components
- Chrome Extension Code: Represent all files under the “extension” directory. These include:
- Manifest file (manifest.json) specifying the extension’s behavior, permissions, and entry points.
- Content scripts (e.g., content_script.js) that interact with the webpage, and background/popup scripts (e.g., popup.js, errors.js, etc.) managing UI interactions.
- UI Assets like popup.html and popup.css.
- Dependencies and build configuration (package.json, package-lock.json) indicating the use of NPM, Parcel as the bundler, and moment.js for date formatting.
- Build & Bundling Process: Illustrate the bundler step that takes raw source files and produces the optimized output in “extension/dist/”. Highlight that the Parcel bundler (or an alternative) is used along with specific build scripts (build and build:test) defined in package.json.
- Google Calendar & Chrome Identity Integration:
- Hugo Static Website:
- “site” directory containing Hugo configuration (hugo.toml), content (under site/content), archetypes, static assets, and themes (with the PaperMod theme inside “site/themes/PaperMod”).
- Integration with GitHub Actions workflows (in .github/workflows/hugo-deploy.yaml and theme-specific workflows) that automate the website deployment.

##### Relationships and Interactions
- From the extension’s UI (popup.html and popup.js) → Triggering the OAuth flow using Chrome Identity API.
- From the extension logic → Formatting dates with moment.js.
- From the extension → Exporting event data into Google Calendar.
- In another section, outline how the Hugo site is built:
- “Hugo Source (site directory)” → “GitHub Actions / Build Scripts” → “Deployed Website” (possibly hosted via GitHub Pages).
- That the website serves as documentation and promotion for the extension.

##### Architectural Patterns & Design Principles
- Modularity: Separate the extension’s functionality (UI, background, content scripts) from its build process.
- CI/CD Integration: Inclusion of GitHub Actions workflows implies an automated build/deploy pipeline for the Hugo site.
- Dependency Management: Use of NPM for managing dependencies and Parcel for module bundling.
- Separation of Concerns: The extension and its UI are completely separate from the documentation website.

##### Relevant Technologies, Frameworks, and Libraries
- Chrome Extensions (Manifest V3 compliance)
- Parcel Bundler (for handling module imports and optimization)
- NPM (package management)
- moment.js (for date/time formatting)
- Hugo (static site generator) with the PaperMod theme for the website
- GitHub Actions for deployment automation

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Chrome Extension"
        subgraph "Extension Development"
            A["Extension Source Code"]:::extension
            B["Manifest & Popup Scripts"]:::extension
            C["Dependency & Build Config"]:::extension
            A --> B
            A --> C
        end
        D["Parcel Bundler"]:::extension
        E["Built Extension"]:::extension
        H["moment.js"]:::extension
        A --> D
        B --> D
        C --> D
        D --> E
        E --> H
        F["Chrome Browser"]:::runtime
        E --> F
        G["Google Calendar API"]:::runtime
        F -->|"OAuth2authentication&scheduleexport"| G
    end

    subgraph "Hugo Static Website"
        I["Hugo Site Source"]:::website
        J["GitHub Actions (hugo-deploy)"]:::ci
        K["Deployed Website"]:::website
        L["Hugo PaperMod Theme"]:::website
        I -->|"build/deploy"| J
        J --> K
        I -->|"ThemeIntegration"| L
    end

    click A "https://github.com/yousefbilal/banner-to-google-calendar/tree/main/extension/"
    click B "https://github.com/yousefbilal/banner-to-google-calendar/blob/main/extension/manifest.json"
    click C "https://github.com/yousefbilal/banner-to-google-calendar/blob/main/extension/package.json"
    click I "https://github.com/yousefbilal/banner-to-google-calendar/tree/main/site/"
    click J "https://github.com/yousefbilal/banner-to-google-calendar/blob/main/.github/workflows/hugo-deploy.yaml"
    click L "https://github.com/yousefbilal/banner-to-google-calendar/tree/main/site/themes/PaperMod/"

classDef extension fill:#AED6F1,stroke:#1B4F72,stroke-width:2px,color:#1B4F72;
classDef runtime fill:#ABEBC6,stroke:#145A32,stroke-width:2px,color:#145A32;
classDef website fill:#F9E79F,stroke:#B7950B,stroke-width:2px,color:#B7950B;
classDef ci fill:#F5B7B1,stroke:#943126,stroke-width:2px,color:#943126;
```
