# zanderp25/www architecture

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

- Interactive diagram: https://gitdiagram.com/zanderp25/www
- Repository: https://github.com/zanderp25/www

## Overview

##### Project type and purpose
- This is a personal website built with Next.js (a React-based full-stack framework).
- In addition, the repo contains two side-services:
- A static “link” site served via Apache (.htaccess) for URL redirection or link management.
- A Python-based “media” microservice (with `main.py`, HTML UIs for upload, roster conversion, etc.).

##### File structure
- Top-level directories:
- components/ – reusable React UI components
- pages/ – Next.js page routes (including `pages/api` for serverless functions)
- public/ – static assets (images, fonts, robots.txt, etc.)
- styles/ – global CSS and CSS modules for each component/page
- link/ – standalone static site served separately (Apache)
- media/ – separate Python service for media handling
- Config & scripts:
- ecosystem.config.js (root & media/) – PM2 configs for Node (Next.js) and Python service?
- next.config.js, tsconfig.json, package.json – Next.js and TypeScript setup

##### README
- Simply states this is the current version of “zanderp25.com.”
- No high-level architecture doc provided.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Next.js Frontend
    subgraph "Next.js Frontend"
        ReactComponents["components/ (UI Components)"]:::frontend
        ReactPages["pages/ (UI Pages)"]:::frontend
        ReactStyles["styles/ (CSS Modules)"]:::frontend
    end

    %% Next.js Backend (Serverless APIs)
    subgraph "Next.js Backend (Serverless APIs)"
        APIPull["pages/api/pull.tsx"]:::api
        APIColor["pages/api/color/[[...color]].tsx"]:::api
        APIGenshin["pages/api/genshin/index.tsx"]:::api
    end

    %% Static Assets
    StaticAssets["public/ (Static Assets)"]:::static

    %% Link Service
    LinkService["link/ (Static Link Service)"]:::service

    %% Media Microservice
    MediaService["media/ (Python Media Service)"]:::service

    %% Configuration
    subgraph "Configuration Files"
        NextConfig["next.config.js"]:::config
        TSConfig["tsconfig.json & next-env.d.ts"]:::config
        PackageJSON["package.json"]:::config
        PM2Root["ecosystem.config.js"]:::config
        PM2Media["media/ecosystem.config.js"]:::config
    end

    %% External Services
    ExternalGenshin["Genshin API"]:::external

    %% Data Flows
    Browser["Browser / Client"]:::external
    Browser -->|Requests Pages| ReactPages
    Browser -->|Fetches Assets| StaticAssets
    Browser -->|Navigates to Link URLs| LinkService
    Browser -->|Uploads/Downloads| MediaService

    ReactPages -->|Uses Components| ReactComponents
    ReactPages -->|Applies Styles| ReactStyles
    ReactPages -->|Calls API| APIPull
    ReactPages -->|Calls API| APIColor
    ReactPages -->|Calls API| APIGenshin

    APIPull -->|Fetch Data| ExternalGenshin
    APIColor -->|Compute/Return Colors| Browser
    APIGenshin -->|Fetch Genshin Data| ExternalGenshin

    %% Configuration usage
    ReactPages --> NextConfig
    APIPull --> PM2Root
    MediaService --> PM2Media
    ReactComponents --> TSConfig
    ReactStyles --> TSConfig
    ReactPages --> PackageJSON

    %% Click Events
    click ReactComponents "https://github.com/zanderp25/www/tree/master/components/"
    click ReactPages "https://github.com/zanderp25/www/tree/master/pages/"
    click ReactStyles "https://github.com/zanderp25/www/tree/master/styles/"
    click APIPull "https://github.com/zanderp25/www/blob/master/pages/api/pull.tsx"
    click APIColor "https://github.com/zanderp25/www/blob/master/pages/api/color/[[...color]].tsx"
    click APIGenshin "https://github.com/zanderp25/www/blob/master/pages/api/genshin/index.tsx"
    click StaticAssets "https://github.com/zanderp25/www/tree/master/public/"
    click LinkService "https://github.com/zanderp25/www/tree/master/link/"
    click MediaService "https://github.com/zanderp25/www/tree/master/media/"
    click NextConfig "https://github.com/zanderp25/www/blob/master/next.config.js"
    click TSConfig "https://github.com/zanderp25/www/blob/master/tsconfig.json"
    click PackageJSON "https://github.com/zanderp25/www/blob/master/package.json"
    click PM2Root "https://github.com/zanderp25/www/blob/master/ecosystem.config.js"
    click PM2Media "https://github.com/zanderp25/www/blob/master/media/ecosystem.config.js"

    %% Styles
    classDef frontend fill:#D1E8FF,stroke:#0366d6,color:#0366d6,fill-opacity:0.3
    classDef api fill:#DFFFE0,stroke:#28a745,color:#28a745,fill-opacity:0.3
    classDef static fill:#EEEEEE,stroke:#666,color:#666,fill-opacity:0.3
    classDef service fill:#F3E5F5,stroke:#6f42c1,color:#6f42c1,fill-opacity:0.3
    classDef config fill:#FFF4D6,stroke:#d69f1f,color:#d69f1f,fill-opacity:0.3
    classDef external stroke-dasharray:5 5,stroke:#FF8C00,color:#FF8C00
```
