# hustbit37/photographer architecture

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

- Interactive diagram: https://gitdiagram.com/hustbit37/photographer
- Repository: https://github.com/hustbit37/photographer

## Overview

##### Project Type and Purpose
- This is a static, client-side portfolio website (no backend code in this repo).
- Purpose: deliver a responsive, image-centric SPA that photographers can customize, showcasing galleries, dark/light mode, and smooth scroll animations.

##### File Structure
- Top-level `ui/` folder contains:
- `public/` – static assets (HTML fallback, preview images).
- `src/` – source code:
– `assets/` (CSS, fonts, images).
– `components/` (reusable UI pieces: LoginPopup, layout components).
– `views/` (page-level Vue components).
– `router/` (Vue Router setup).
– `stores/` (Pinia global state, e.g. theme).
– `App.vue` (root component), `main.js` (entry point).
- Config files: `package.json`, `vite.config.js`, `jsconfig.json`.

##### README for Additional Insights
- Features: responsive gallery, dark/light mode, mobile-first, smooth animations.
- Build & deploy: npm scripts `dev`, `build`.

##### Main Components
a. Frontend Layers
- Browser (client)
- Vite Dev Server / Build Pipeline
- Vue App Runtime
– Router Module
– Pinia Store
– Component Tree (layout, views, widgets)
- Static Assets (CSS, images, public folder)
b. External/Third-Party Services
- AOS library
- CDN or hosting provider (optional; Netlify, Vercel, GitHub Pages)
c. Developer Tools
- Node.js / npm
- Vite (hot-reload, bundler)

##### Relationships and Interactions
- Browser requests `index.html` from dev server or static host.
- `main.js` bootstraps Vue App in the browser.
- Vue Router intercepts URL changes → renders appropriate `views/` component.
- Pinia provides reactive state (e.g. theme) to components.
- Components import styles from `assets/` and use Bootstrap/AOS classes.
- Vite serves modules during dev and bundles them into production assets.

##### Architectural Patterns & Design Principles
- SPA – single page loaded once, client-side routing.
- Component-based UI – tree of reusable Vue components.
- Unidirectional data flow via Pinia.
- Separation of concerns: layout vs. page views vs. shared assets.

##### Final Advice
- Do not over-compartmentalize trivial details; focus on the runtime flow and build artifacts.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Development Layer
    subgraph "Development Layer"
        direction TB
        NPM[/"Node.js & npm"/]:::dev
        VITE{Vite Dev Server / Build Pipeline}:::dev
        NPM --> VITE
    end

    %% Source Code Layer
    subgraph "Source Code"
        direction TB
        SRC["src/"]:::build
        PUBLIC["public/"]:::build
        SRC --> ASSETS["assets/"]:::build
        SRC --> COMPONENTS["components/"]:::build
        SRC --> VIEWS["views/"]:::build
        SRC --> ROUTER["router/"]:::build
        SRC --> STORES["stores/"]:::build
        SRC --> MAIN_JS["main.js"]:::build
        SRC --> APP_VUE["App.vue"]:::build
    end

    %% Build/Deployment Layer
    subgraph "Build & Deployment"
        direction TB
        VITE --> DIST["dist (production bundle)"]:::build
        DIST --> HOST["CDN / Hosting Provider"]:::external
    end

    %% Runtime Layer
    subgraph "Runtime"
        direction TB
        BROWSER["Browser / Client"]:::runtime
        BROWSER -->|"loads index.html"| VITE
        HOST -->|"serves built assets"| BROWSER
        BROWSER -->|"bootstraps"| VUE_APP["Vue App Runtime"]:::runtime
        VUE_APP --> ROUTER_MOD["Router Module"]:::runtime
        VUE_APP --> PINIA["Pinia Store"]:::runtime
        VUE_APP --> COMP_TREE["Component Tree"]:::runtime
        COMP_TREE --> LAYOUT["Layout Components"]:::runtime
        COMP_TREE --> WIDGETS["Reusable Widgets"]:::runtime
        VUE_APP --> ASSETS_STATIC["Static Assets"]:::runtime
    end

    %% Component Tree Details
    subgraph "Layout Components"
        direction TB
        HEADER["AppHeader.vue"]:::runtime
        FOOTER["AppFooter.vue"]:::runtime
        MAIN_CONTENT["MainContent.vue"]:::runtime
    end

    subgraph "Reusable Widgets"
        direction TB
        LOGIN["LoginPopup.vue"]:::runtime
    end

    subgraph "Page-Level Views"
        direction TB
        HOME["HomeView.vue"]:::runtime
        ABOUT["AboutView.vue"]:::runtime
        SERVICES["ServicesView.vue"]:::runtime
        GALLERY["GalleryView.vue"]:::runtime
        GALLERY_SINGLE["GallerySingleView.vue"]:::runtime
        CONTACT["ContactView.vue"]:::runtime
        NOTFOUND["NotFoundView.vue"]:::runtime
    end

    %% External Libraries
    subgraph "External Libraries"
        direction TB
        BOOTSTRAP["Bootstrap & Icons"]:::external
        AOS["AOS (Animate On Scroll)"]:::external
        VUE_LIB["Vue.js, Vue Router"]:::external
        PINIA_LIB["Pinia"]:::external
    end

    %% Connections
    ROUTER_MOD -->|"renders"| VIEWS
    PINIA -->|"provides state"| COMP_TREE
    COMP_TREE -->|"imports styles/images"| ASSETS_STATIC
    VUE_APP --> BOOTSTRAP
    VUE_APP --> AOS
    VUE_APP --> VUE_LIB
    VUE_APP --> PINIA_LIB

    %% Click Events
    click VITE "https://github.com/hustbit37/photographer/blob/main/ui/vite.config.js"
    click NPM "https://github.com/hustbit37/photographer/blob/main/ui/package.json"
    click MAIN_JS "https://github.com/hustbit37/photographer/blob/main/ui/src/main.js"
    click APP_VUE "https://github.com/hustbit37/photographer/blob/main/ui/src/App.vue"
    click ROUTER_MOD "https://github.com/hustbit37/photographer/blob/main/ui/src/router/index.js"
    click PINIA "https://github.com/hustbit37/photographer/blob/main/ui/src/stores/theme.js"
    click HEADER "https://github.com/hustbit37/photographer/blob/main/ui/src/components/layout/AppHeader.vue"
    click FOOTER "https://github.com/hustbit37/photographer/blob/main/ui/src/components/layout/AppFooter.vue"
    click MAIN_CONTENT "https://github.com/hustbit37/photographer/blob/main/ui/src/components/layout/MainContent.vue"
    click LOGIN "https://github.com/hustbit37/photographer/blob/main/ui/src/components/LoginPopup.vue"
    click HOME "https://github.com/hustbit37/photographer/blob/main/ui/src/views/HomeView.vue"
    click ABOUT "https://github.com/hustbit37/photographer/blob/main/ui/src/views/AboutView.vue"
    click SERVICES "https://github.com/hustbit37/photographer/blob/main/ui/src/views/ServicesView.vue"
    click GALLERY "https://github.com/hustbit37/photographer/blob/main/ui/src/views/GalleryView.vue"
    click GALLERY_SINGLE "https://github.com/hustbit37/photographer/blob/main/ui/src/views/GallerySingleView.vue"
    click CONTACT "https://github.com/hustbit37/photographer/blob/main/ui/src/views/ContactView.vue"
    click NOTFOUND "https://github.com/hustbit37/photographer/blob/main/ui/src/views/NotFoundView.vue"
    click ASSETS_STATIC "https://github.com/hustbit37/photographer/blob/main/ui/src/assets/base.css"
    click PUBLIC "https://github.com/hustbit37/photographer/tree/main/ui/public/"
    click jsconfig "https://github.com/hustbit37/photographer/blob/main/ui/jsconfig.json"
    click pkglock "https://github.com/hustbit37/photographer/blob/main/ui/package-lock.json"
    click gitignore "https://github.com/hustbit37/photographer/blob/main/ui/.gitignore"
    click vscode "https://github.com/hustbit37/photographer/tree/main/ui/.vscode/"
    click readme "https://github.com/hustbit37/photographer/blob/main/ui/README.md"

    %% Styles
    classDef dev fill:#f0f8ff,stroke:#333,stroke-width:1px
    classDef build fill:#faebd7,stroke:#333,stroke-width:1px
    classDef runtime fill:#e0ffe0,stroke:#333,stroke-width:1px
    classDef external fill:#ffe4e1,stroke:#333,stroke-width:1px
```
