# andrewyapkj/file-changer architecture

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

- Interactive diagram: https://gitdiagram.com/andrewyapkj/file-changer
- Repository: https://github.com/andrewyapkj/file-changer

## Overview

##### Project Type & Purpose
- This is a monolithic full-stack web application built with Next.js (App Router).
- It’s primarily a server-rendered React front-end served by a custom Node.js server (server.js), with static assets in `public/`.

##### Main Components
a. Client (Browser)
b. Custom Node.js Server (`server.js`)
c. Next.js Framework
- App Router (`src/app/layout.tsx`, `src/app/page.tsx`)
- Global Styles (`src/app/globals.css`)
- Font optimization (via `next/font`)
d. Static Assets (`public/` folder)
e. Configuration & Build
- Next.js config (`next.config.ts`)
- PostCSS (`postcss.config.mjs`), ESLint (`eslint.config.mjs`), TypeScript (`tsconfig.json`)
f. Deployment Platform (e.g., Vercel)

##### Relationships & Data Flow
1. Browser → HTTP request → Node.js Server
2. Server hands off to Next.js runtime
- File-based routing in `src/app` → picks React page/component
- SSR/SSG: renders HTML + injects CSS & JS bundles
3. Next.js serves static files directly from `public/`
4. Response → HTML/CSS/JS → Browser renders UI
5. Build step (`npm run build`) uses configs to produce optimized output, then deploy

##### Architectural Patterns & Principles
- Server-Side Rendering (SSR) with automatic code splitting
- File-based routing (App Router) for pages & layouts
- Separation of concerns:
- React components + CSS (logic vs. style)
- Static assets vs. dynamic routes
- Configuration-driven build (Next.js, PostCSS, ESLint, TS)

##### Detailing Essentials
- Don’t add unrelated microservices: this is a single server monolith.
- Every folder’s role (e.g., `public/` = static, `src/app` = UI/SSR).
- Config files to show how they influence the build/runtime.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Side"
        Browser["Browser (Client)"]
    end

    subgraph "Server & Runtime"
        NodeServer["Custom Node.js Server"]:::runtime
        NextRuntime["Next.js Runtime"]:::runtime
    end

    subgraph "React App (src/app)"
        Layout["App Router Layout"]:::runtime
        Page["App Router Page"]:::runtime
        GlobalsCSS["Global Styles"]:::runtime
    end

    subgraph "Static Assets"
        StaticAssets["public/"]:::storage
    end

    subgraph "Build & Config"
        NextConfig["next.config.ts"]:::config
        PostCSS["postcss.config.mjs"]:::config
        ESLintConfig["eslint.config.mjs"]:::config
        TSConfig["tsconfig.json"]:::config
    end

    subgraph "Deployment"
        Vercel["Vercel (Deployment)"]:::deployment
    end

    Browser -->|"HTTP Request"| NodeServer
    NodeServer -->|"Hands off to Next.js"| NextRuntime
    NextRuntime -->|"File-based Routing"| Layout
    Layout --> Page
    NextRuntime -->|"SSR/SSG"| Page
    NextRuntime --> GlobalsCSS
    Browser -->|"Fetch Static Assets"| StaticAssets
    StaticAssets --> Browser
    BuildConfig(("Build & Config")):::config
    NextConfig --> BuildConfig
    PostCSS --> BuildConfig
    ESLintConfig --> BuildConfig
    TSConfig --> BuildConfig
    BuildConfig -->|"npm run build"| Vercel

    click NodeServer "https://github.com/andrewyapkj/file-changer/blob/main/server.js"
    click Layout "https://github.com/andrewyapkj/file-changer/blob/main/src/app/layout.tsx"
    click Page "https://github.com/andrewyapkj/file-changer/blob/main/src/app/page.tsx"
    click GlobalsCSS "https://github.com/andrewyapkj/file-changer/blob/main/src/app/globals.css"
    click StaticAssets "https://github.com/andrewyapkj/file-changer/tree/main/public/"
    click NextConfig "https://github.com/andrewyapkj/file-changer/blob/main/next.config.ts"
    click PostCSS "https://github.com/andrewyapkj/file-changer/blob/main/postcss.config.mjs"
    click ESLintConfig "https://github.com/andrewyapkj/file-changer/blob/main/eslint.config.mjs"
    click TSConfig "https://github.com/andrewyapkj/file-changer/blob/main/tsconfig.json"

    classDef runtime fill:#add8e6,stroke:#333,stroke-width:1px
    classDef config fill:#90ee90,stroke:#333,stroke-width:1px
    classDef storage fill:#ffa500,stroke:#333,stroke-width:1px
    classDef deployment fill:#f0f8ff,stroke:#333,stroke-width:1px
```
