# burakcan/just-fucking-use-react architecture

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

- Interactive diagram: https://gitdiagram.com/burakcan/just-fucking-use-react
- Repository: https://github.com/burakcan/just-fucking-use-react

## Overview

##### Project type and purpose
- This is a Next.js (React-based) web application, bootstrapped via create-next-app. It uses the new App Router API (the “app/” directory), React Server and Client Components, a small in-house UI component library under components/ui, and a few demonstration components (StateManagementDemo, ThemeToggle, etc.). It is purely a frontend web application intended for deployment (e.g., on Vercel).

##### File structure
Top-level directories and files:
- app/ – the Next.js application root using the App Router (layout.tsx, page.tsx, globals.css).
- components/ – domain and utility components (StateManagementDemo, ThemeProvider, ThemeToggle) and a subfolder components/ui for generic UI primitives (button, card, chart, etc.).
- lib/ – shared utilities (utils.ts).
- public/ – static assets served by Next.js.
- next.config.ts, postcss.config.mjs, tsconfig.json, package.json – configuration and build scripts.

Key architectural patterns:
- App Router with nested layouts (app/layout.tsx) and pages (app/page.tsx).
- Component-based UI library (components/ui).
- Theme and state management via context providers.
- CSS global styles (globals.css) combined with PostCSS.

##### README for additional insights
- Standard instructions for running Next.js in development.
- Mentions use of next/font for optimizing fonts (Geist).
- No backend/API routes present, so likely all data and state demos are in-browser or fetched from external sources (if any).

##### Elements
- Labels for each component (e.g., Next.js Server, React Server Component, ThemeProvider)

## Diagram (Mermaid)

```mermaid
graph TB
  %% Client Layer
  subgraph "Browser (Client Layer)"
    direction TB
    Browser["Browser"]:::clientComp
    ThemeProvider["ThemeProvider"]:::clientComp
    subgraph "UI Component Library"
      direction TB
      Button["Button"]:::uiComp
      Card["Card"]:::uiComp
      Chart["Chart"]:::uiComp
      Input["Input"]:::uiComp
      Label["Label"]:::uiComp
      Slider["Slider"]:::uiComp
      Switch["Switch"]:::uiComp
      Table["Table"]:::uiComp
    end
    StateLoader["StateManagementDemoLoader"]:::clientComp
    StateDemo["StateManagementDemo"]:::clientComp
    ThemeToggle["ThemeToggle"]:::clientComp
  end

  %% Server Layer
  subgraph "Server Layer (Next.js Server)"
    direction TB
    NextServer["Next.js Server\n(Node.js Runtime)"]:::serverComp
    subgraph "App Router"
      direction TB
      Layout["layout.tsx"]:::serverComp
      Page["page.tsx"]:::serverComp
    end
    Util["utils.ts"]:::utilComp
    subgraph "Configuration"
      nextConfig["next.config.ts"]:::configComp
      postcssConfig["postcss.config.mjs"]:::configComp
      tsconfig["tsconfig.json"]:::configComp
      pkgManifest["package.json"]:::configComp
    end
  end

  %% External Services
  Static["Static Assets (public/)"]:::staticComp
  FontService["Font Service\n(next/font → Geist)"]:::externalComp

  %% Connections
  Browser -->|"HTTP Request"| NextServer
  NextServer -->|"routes via"| Layout
  Layout -->|"renders layout then"| Page
  Page -->|"uses Server Components\nand imports"| Util
  Page -->|"references"| Static
  NextServer -->|"integrates fonts at build/runtime"| FontService

  Browser -->|"hydrates in browser"| ThemeToggle
  Browser -->|"hydrates in browser"| StateDemo
  StateLoader -->|"loads data for"| StateDemo
  StateDemo -->|"reads context from"| ThemeProvider
  StateDemo -->|"consumes UI primitives"| Button
  StateDemo -->|"consumes UI primitives"| Card
  StateDemo -->|"consumes UI primitives"| Chart
  StateDemo -->|"consumes UI primitives"| Input
  StateDemo -->|"consumes UI primitives"| Label
  StateDemo -->|"consumes UI primitives"| Slider
  StateDemo -->|"consumes UI primitives"| Switch
  StateDemo -->|"consumes UI primitives"| Table
  ThemeToggle -->|"consumes UI primitives"| Button
  ThemeToggle -->|"reads context from"| ThemeProvider

  %% Click Events
  click NextServer "https://github.com/burakcan/just-fucking-use-react/tree/main/app/"
  click Layout "https://github.com/burakcan/just-fucking-use-react/blob/main/app/layout.tsx"
  click Page "https://github.com/burakcan/just-fucking-use-react/blob/main/app/page.tsx"
  click Static "https://github.com/burakcan/just-fucking-use-react/tree/main/public/"
  click StateDemo "https://github.com/burakcan/just-fucking-use-react/blob/main/components/StateManagementDemo.tsx"
  click StateLoader "https://github.com/burakcan/just-fucking-use-react/blob/main/components/StateManagementDemoLoader.tsx"
  click ThemeProvider "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ThemeProvider.tsx"
  click ThemeToggle "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ThemeToggle.tsx"
  click Button "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/button.tsx"
  click Card "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/card.tsx"
  click Chart "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/chart.tsx"
  click Input "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/input.tsx"
  click Label "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/label.tsx"
  click Slider "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/slider.tsx"
  click Switch "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/switch.tsx"
  click Table "https://github.com/burakcan/just-fucking-use-react/blob/main/components/ui/table.tsx"
  click Util "https://github.com/burakcan/just-fucking-use-react/blob/main/lib/utils.ts"
  click nextConfig "https://github.com/burakcan/just-fucking-use-react/blob/main/next.config.ts"
  click postcssConfig "https://github.com/burakcan/just-fucking-use-react/blob/main/postcss.config.mjs"
  click tsconfig "https://github.com/burakcan/just-fucking-use-react/blob/main/tsconfig.json"
  click pkgManifest "https://github.com/burakcan/just-fucking-use-react/blob/main/package.json"

  %% Styles
  classDef serverComp fill:#f9f,stroke:#333,stroke-width:1px
  classDef clientComp fill:#bbf,stroke:#333,stroke-width:1px
  classDef uiComp fill:#bfb,stroke:#333,stroke-width:1px
  classDef utilComp fill:#ffeb3b,stroke:#333,stroke-width:1px
  classDef configComp fill:#ddd,stroke:#333,stroke-width:1px
  classDef staticComp fill:#ffc,stroke:#333,stroke-width:1px
  classDef externalComp fill:#eed,stroke:#333,stroke-width:1px
```
