# gainsborouo/mch_dev-interview-project architecture

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

- Interactive diagram: https://gitdiagram.com/gainsborouo/mch_dev-interview-project
- Repository: https://github.com/gainsborouo/mch_dev-interview-project

## Overview

##### Project type and purpose
- This is a single-page application (SPA) built with Vue.js and Vite.
- Purpose: render a personal introduction section and a “Historical Hackathon Websites” page by fetching data from a remote backend API.
- It’s delivered as a static site via GitHub Pages with a CI/CD pipeline in GitHub Actions.

##### File structure
- Top-level:
- .github/workflows/deploy.yml → CI/CD pipeline to build & deploy to GitHub Pages
- README.md, LICENSE, .gitignore → docs and project metadata
- frontend/:
- package.json, package-lock.json → dependencies (Vue, Vite, Axios)
- vite.config.js → build config for Vite
- public/ → static assets (images, manifest)
- src/ → application code
– main.js → app bootstrap with Vue and Vue Router
– router/index.js → client-side routes (Introduction, HistoricalWebsites)
– App.vue → root component containing navbar & footer
– components/ → reusable UI parts (Navbar.vue, Footer.vue)
– views/ → page-level components (Introduction.vue, HistoricalWebsites.vue)
– assets/styles.css → global CSS including RWD grid styles

##### README for additional insights
- Two tasks: style the intro header and implement a responsive grid for websites.
- Data comes from a documented external API (websites array).
- Deployment steps involve forking, dev server (npm run dev), and enabling GitHub Pages.

a. Main components
- Developer workstation (VS Code, Git, npm)
- GitHub repository (main branch, gh-pages branch)
- GitHub Actions CI/CD workflow
- Static site host (GitHub Pages)
- Browser/client (executes SPA)
- External backend API (provides websites data)

b. Relationships & interactions
1. Developer pushes code → triggers GitHub Actions
2. Action runs “npm install” & “npm run build” via Vite
3. Build output (dist/) is published to gh-pages branch → GitHub Pages serves assets
4. User’s browser fetches index.html & JS/CSS assets from GitHub Pages
5. SPA loads, Vue Router controls navigation
6. HistoricalWebsites.vue uses Axios to GET /websites from External API
7. API responds with JSON → SPA renders grid

c. Architectural patterns & design principles
- SPA pattern with client-side routing (Vue Router)
- Component-based UI (Vue components in src/components & src/views)
- Responsive design using CSS grid in assets/styles.css
- CI/CD for “build → deploy to static host” via GitHub Actions
- Separation of concerns: presentation (Vue), styling (CSS), data layer (Axios)

d. Key technologies/frameworks
- Framework: Vue.js 3
- Build tool: Vite
- Routing: Vue Router
- HTTP client: Axios
- CI/CD: GitHub Actions
- Hosting: GitHub Pages

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Repository
    Dev["Developer Workstation\n(VS Code, Git, npm)"]:::code
    Repo[(GitHub Repository)]:::code
    Dev -->|git push| Repo

    %% CI/CD Pipeline
    CI["CI/CD Pipeline\n(GitHub Actions)"]:::ci
    Repo -->|triggers on push to main| CI
    CI -->|"npm install & npm run build"| Pages

    %% Static Hosting
    Pages[(GitHub Pages)]:::code
    CI -->|deploy dist/ to gh-pages| Pages

    %% User Browser and SPA Load
    Browser["User Browser"]:::user
    Pages -->|GET index.html, JS/CSS| Browser
    Browser -->|load SPA| SPA

    %% External API
    API["External Backend API\n(GET /websites)"]:::external
    SPA -->|GET /websites| API
    API -->|JSON response| SPA

    %% Frontend Application Structure
    subgraph "Frontend Application (SPA)" 
        SPA["SPA Root"]:::code
        SPA --> Main
        SPA --> App
        SPA --> Router

        Main["main.js"]:::code
        App["App.vue"]:::code
        Router["router/index.js"]:::code

        subgraph Views
            Intro["Introduction.vue"]:::code
            Hist["HistoricalWebsites.vue"]:::code
        end
        Router --> Intro
        Router --> Hist
        Hist -->|"renders grid (styles.css)"| Styles

        subgraph Components
            Nav["Navbar.vue"]:::code
            Footer["Footer.vue"]:::code
        end
        App --> Nav
        App --> Footer

        Styles["styles.css"]:::code
    end

    %% Click Events
    click CI "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/.github/workflows/deploy.yml"
    click SPA "https://github.com/gainsborouo/mch_dev-interview-project/tree/main/frontend/"
    click Main "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/main.js"
    click App "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/App.vue"
    click Router "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/router/index.js"
    click Intro "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/views/Introduction.vue"
    click Hist "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/views/HistoricalWebsites.vue"
    click Nav "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/components/Navbar.vue"
    click Footer "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/components/Footer.vue"
    click Styles "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/src/assets/styles.css"
    click Pipeline "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/package.json" "frontend/package-lock.json"
    click Vite "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/vite.config.js"
    click Public "https://github.com/gainsborouo/mch_dev-interview-project/tree/main/frontend/public/"
    click FReadme "https://github.com/gainsborouo/mch_dev-interview-project/blob/main/frontend/README.md"

    %% Styles
    classDef code fill:#e0e0e0,stroke:#888,stroke-width:1px
    classDef ci fill:#ddffdd,stroke:#090,stroke-width:1px
    classDef user fill:#ddeeff,stroke:#006,stroke-width:1px
    classDef external fill:#ffe0b2,stroke:#c60,stroke-width:1px
```
