# patrickjnr/vp architecture

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

- Interactive diagram: https://gitdiagram.com/patrickjnr/vp
- Repository: https://github.com/patrickjnr/vp

## Overview

##### Project Type and Purpose
The project is a **static website** serving as a **Virtual Photography Portfolio** for showcasing photos captured from various video games. It is built using **Jekyll**, a static site generator, and is hosted on **GitHub Pages**. Images are externally hosted on **Imgur**, and the project utilizes GitHub Actions for continuous integration and deployment.

##### File Structure Analysis
- **Top-Level Directories:**
- `.github`: Contains GitHub-specific configurations, such as workflows for CI/CD.
- `_data`, `_includes`, `_layouts`, `_posts`: Standard Jekyll directories for data files, reusable components, layout templates, and blog posts respectively.
- `assets`: Contains static assets like CSS, JavaScript, and images.
- `pages`: Contains markdown files for static pages like About, Changelog, and Contact.
- `js`: Houses JavaScript files used in the website.
- `node_modules`, `package-lock.json`: Indicates the use of npm for managing JavaScript dependencies.

- **Configuration and Deployment:**
- `Gemfile`: Manages Ruby dependencies, specific to Jekyll.
- `package-lock.json`: Ensures consistent installation of JavaScript packages.
- `.github/workflows/jekyll.yml`: Defines the GitHub Actions workflow for building and deploying the site.

- **Build and Deployment Files:**
- `_config.yml`: Jekyll configuration file.
- `Gemfile`, `package-lock.json`: Dependency management for Ruby and JavaScript respectively.

##### README Insights
The README provides a comprehensive overview:
- **Technologies Used:**
- **Jekyll** for static site generation.
- **GitHub Pages** for hosting.
- **Imgur** for image hosting.

- **Project Features:**
- Collection of virtual photography from various games.
- Continuous updates tracked via a changelog.

- **Licensing Information:**
- MIT License for code.
- Creative Commons for images.

- **Continuous Integration:**
- GitHub Actions workflows indicate automated builds and deployments.

##### a. Main Components
- **Frontend:**
- **Jekyll Site**: Handles the generation of static HTML, CSS, and JavaScript.
- **Assets**: Includes CSS stylesheets, JavaScript files, and images hosted externally on Imgur.

- **Backend/Infrastructure:**
- **GitHub Repository**: Hosts the source code.
- **GitHub Actions**: Automates the build and deployment processes.
- **GitHub Pages**: Serves the generated static site.

- **External Services:**
- **Imgur**: Hosts and serves images used in the portfolio.

##### b. Relationships and Interactions
- **Developer Workflow:**
1. **Code Commit**: Developer pushes changes to the GitHub repository.
2. **GitHub Actions**: Automatically triggers the workflow defined in `.github/workflows/jekyll.yml` to build the site using Jekyll.
3. **Deployment**: Upon successful build, GitHub Actions deploys the site to GitHub Pages.

- **Content Management:**
- **Jekyll** reads data from `_data`, `_posts`, and other directories to generate the site.
- **Images** are referenced from Imgur, reducing the load on the GitHub Pages hosting.

##### c. Architectural Patterns and Design Principles
- **Static Site Architecture**: Emphasizes speed, security, and simplicity by serving pre-built HTML files.
- **Separation of Concerns**: Distinguishes between content (`_posts`, `_data`), presentation (`_layouts`, `_includes`), and assets (`assets`).
- **Automated CI/CD**: Utilizes GitHub Actions to streamline development and deployment.

##### d. Relevant Technologies, Frameworks, and Libraries
- **Jekyll**: Static site generator.
- **GitHub Pages**: Hosting service.
- **GitHub Actions**: CI/CD automation.
- **Imgur API**: For image hosting and management.
- **Sass (SCSS)**: For styling (`assets/css/*.scss`).
- **JavaScript Libraries**: Such as jQuery and custom scripts (`js/jquery.swipebox.js`, `js/pig.js`).

##### Detailed Architectural Elements

- **All Key Directories and Their Roles**:
- How `_layouts`, `_includes`, and `_data` contribute to the site generation.
- **Automation Workflow Steps**:
- Detailed stages within GitHub Actions (e.g., install dependencies, build with Jekyll, deploy).
- **External Integrations**:
- How Imgur integrates with the site for image hosting.
- **Content Flow**:
- From markdown files in `_posts` and `pages` to the generated HTML served on GitHub Pages.

##### Final Recommendations
- **Be Comprehensive**: Include as many components and their interactions as possible to ensure all architectural aspects are covered.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global entities
    GitHubRepo["GitHub Repository"]:::github
    GitHubActions["GitHub Actions"]:::github
    GitHubPages["GitHub Pages"]:::github
    JekyllSite["Jekyll Site"]:::frontend
    Imgur["Imgur"]:::external

    %% Subgraphs for content structure
    subgraph "Content Management"
        Data["Content Data Management"]:::frontend
        Posts["Blog Posts"]:::frontend
        Pages["Static Pages"]:::frontend
    end

    subgraph "Site Components"
        Layouts["Layout Templates"]:::frontend
        Includes["Reusable Components (Includes)"]:::frontend
        Assets["Static Assets (CSS and Images)"]:::frontend
        JS["JavaScript Files"]:::frontend
    end

    %% Build and Deployment
    subgraph "Build & Deployment"
        Workflow["GitHub Actions Workflow"]:::build
        Config["Jekyll Configuration"]:::build
        RubyDeps["Ruby Dependencies"]:::build
        JSDeps["JavaScript Dependencies"]:::build
    end

    %% Connections
    GitHubRepo -->|"Push Commit"| GitHubActions
    GitHubActions -->|"Trigger Workflow"| Workflow
    Workflow -->|"Use Config"| Config
    Workflow -->|"Install Ruby Dependencies"| RubyDeps
    Workflow -->|"Install JS Dependencies"| JSDeps
    Workflow -->|"Build with Jekyll"| JekyllSite
    JekyllSite -->|"Deploy to"| GitHubPages
    JekyllSite -->|"Fetch Images"| Imgur
    JekyllSite --> Data
    JekyllSite --> Posts
    JekyllSite --> Pages
    JekyllSite --> Layouts
    JekyllSite --> Includes
    JekyllSite --> Assets
    JekyllSite --> JS

    %% Click Events
    click Workflow "https://github.com/patrickjnr/vp/blob/main/.github/workflows/jekyll.yml"
    click Config "https://github.com/patrickjnr/vp/blob/main/_config.yml"
    click RubyDeps "https://github.com/patrickjnr/vp/tree/main/Gemfile"
    click JSDeps "https://github.com/patrickjnr/vp/blob/main/package-lock.json"
    click Data "https://github.com/patrickjnr/vp/tree/main/_data/virtual-photography/"
    click Layouts "https://github.com/patrickjnr/vp/tree/main/_layouts/"
    click Includes "https://github.com/patrickjnr/vp/tree/main/_includes/"
    click Assets "https://github.com/patrickjnr/vp/tree/main/assets/"
    click JS "https://github.com/patrickjnr/vp/tree/main/js/"
    click Pages "https://github.com/patrickjnr/vp/tree/main/pages/"
    click Posts "https://github.com/patrickjnr/vp/tree/main/_posts/"

    %% Styles
    classDef github fill:#1E90FF,stroke:#000,stroke-width:1px
    classDef build fill:#FFA500,stroke:#000,stroke-width:1px
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef external fill:#90EE90,stroke:#000,stroke-width:1px

    class GitHubRepo,GitHubActions,GitHubPages github
    class Workflow,Config,RubyDeps,JSDeps build
    class JekyllSite,Data,Posts,Pages,Layouts,Includes,Assets,JS frontend
    class Imgur external
```
