# pclubiitk/pclub-website architecture

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

- Interactive diagram: https://gitdiagram.com/pclubiitk/pclub-website
- Repository: https://github.com/pclubiitk/pclub-website

## Overview

##### Project type and purpose
- This is a Jekyll-based static site (a blog/documentation website) with a custom theme.
- The repository holds content (Markdown posts/pages), theme templates (layouts, includes, Sass), assets (images, JS), build scripts, and GitHub Actions workflows for CI/CD.

##### Main components
a. Content layer
- _posts/, _pages/, _includes/, _layouts/ – Markdown and HTML templates with YAML front matter
- _sass/ – SCSS modules and settings for styling
- js/ and images/ – client-side assets
b. Build pipeline
- Bundler + Gemfile – Ruby dependency manager
- Jekyll engine – static site generator
- Custom updating-scripts – Python script (CSV→YAML) under updating-scripts/ for automating content updates
c. CI/CD
- .github/workflows/jekyll.yml – GitHub Actions that install Ruby, bundle install, run jekyll build, and deploy to GitHub Pages
d. Hosting
- GitHub Pages – serves the generated static HTML/CSS/JS
e. Developer environment
- Local machine with Ruby, gem, bundle; developer runs bundle exec jekyll serve with or without livereload

##### Relationships and data flow
- Developer → clones repo → runs `bundle exec jekyll serve` → Bundler installs gems → Jekyll reads content/templates → compiles HTML/CSS/JS → serves at localhost:4000
- On git push → GitHub Actions triggers → installs Ruby + bundle → runs Jekyll build → outputs `_site/` → deploys to GitHub Pages → Site goes live
- Optional: updating-scripts take CSV inputs → generate YAML data → gets picked up by Jekyll during build

##### Architectural patterns and design principles
- Static Site Generation (SSG): separation of content, templates, and build logic
- Convention over configuration: Jekyll folder layout drives routing and page generation
- CI/CD pipeline automates build & deploy on push
- Modular styling with SCSS partials

##### Detailed elements
- Dependency graph: Gemfile → Jekyll, Sass → CSS

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Local Workflow
    subgraph "Developer Local Workflow"
        Dev["Developer"]:::dev
        Code["Codebase (Repo)"]:::dev
        Dev -->|"git clone"| Code
        Code -->|"bundle exec jekyll serve"| Bundler
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        Bundler["Bundler & Gems"]:::build
        Posts["_posts/"]:::build
        Pages["_pages/"]:::build
        Includes["_includes/"]:::build
        Layouts["_layouts/"]:::build
        Sass["_sass/"]:::build
        JS["js/"]:::build
        Images["images/"]:::build
        ScriptsDir["updating-scripts/"]:::build
        CSV["list.csv"]:::build
        PyScript["secy-csv-to-yaml.py"]:::build
        YAML["secys.yml"]:::build
        Jekyll["Jekyll Engine"]:::build
        Bundler -->|"installs gems"| Jekyll
        Posts --> Jekyll
        Pages --> Jekyll
        Includes --> Jekyll
        Layouts --> Jekyll
        Sass --> Jekyll
        JS --> Jekyll
        Images --> Jekyll
        ScriptsDir --> CSV
        ScriptsDir --> PyScript
        PyScript --> YAML
        YAML --> Jekyll
        Jekyll -->|"serves at localhost:4000"| Serve["Local Server"]:::dev
        Jekyll -.->|"livereload (optional)"| Serve
    end

    %% CI/CD Workflow
    subgraph "CI/CD Workflow"
        GHAction["GitHub Actions"]:::ci
        Config["_config.yml"]:::build
        Index["index.html"]:::build
        Code -->|"push"| GHAction
        GHAction -->|"bundle install & jekyll build"| JekyllCI["Jekyll Engine (CI)"]:::ci
        JekyllCI -->|"output _site/"| Site["_site/"]:::ci
        GHAction --> Config
        GHAction --> Index
    end

    %% Hosting
    subgraph "Hosting"
        PagesHost["GitHub Pages"]:::host
        Site -->|"deploy"| PagesHost
    end

    %% Click Events
    click Posts "https://github.com/pclubiitk/pclub-website/tree/main/_posts/"
    click Pages "https://github.com/pclubiitk/pclub-website/tree/main/_pages/"
    click Includes "https://github.com/pclubiitk/pclub-website/tree/main/_includes/"
    click Layouts "https://github.com/pclubiitk/pclub-website/tree/main/_layouts/"
    click Sass "https://github.com/pclubiitk/pclub-website/tree/main/_sass/"
    click JS "https://github.com/pclubiitk/pclub-website/tree/main/js/"
    click Images "https://github.com/pclubiitk/pclub-website/tree/main/images/"
    click Bundler "https://github.com/pclubiitk/pclub-website/tree/main/Gemfile"
    click Bundler "https://github.com/pclubiitk/pclub-website/blob/main/Gemfile.lock"
    click Bundler "https://github.com/pclubiitk/pclub-website/tree/main/bin/"
    click Config "https://github.com/pclubiitk/pclub-website/blob/main/_config.yml"
    click Index "https://github.com/pclubiitk/pclub-website/blob/main/index.html"
    click ScriptsDir "https://github.com/pclubiitk/pclub-website/tree/main/updating-scripts/"
    click PyScript "https://github.com/pclubiitk/pclub-website/blob/main/updating-scripts/secy-csv-to-yaml/secy-csv-to-yaml.py"
    click CSV "https://github.com/pclubiitk/pclub-website/blob/main/updating-scripts/secy-csv-to-yaml/list.csv"
    click YAML "https://github.com/pclubiitk/pclub-website/blob/main/updating-scripts/secy-csv-to-yaml/secys.yml"
    click GHAction "https://github.com/pclubiitk/pclub-website/blob/main/.github/workflows/jekyll.yml"
    click README "https://github.com/pclubiitk/pclub-website/blob/main/README.md"
    click GitIgnore "https://github.com/pclubiitk/pclub-website/blob/main/.gitignore"

    %% Styles
    classDef dev fill:#D6EAF8,stroke:#3498DB,stroke-width:1px;
    classDef build fill:#D5F5E3,stroke:#27AE60,stroke-width:1px;
    classDef ci fill:#FCF3CF,stroke:#F1C40F,stroke-width:1px;
    classDef host fill:#E8DAEF,stroke:#9B59B6,stroke-width:1px;
```
