# muke-coder/online-code-compiler architecture

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

- Interactive diagram: https://gitdiagram.com/muke-coder/online-code-compiler
- Repository: https://github.com/muke-coder/online-code-compiler

## Overview

##### Project type and purpose
- This is a Next.js 13 full-stack web application using the app/ directory and React components.
- It delivers a client-side UI (via React) plus server-side logic (via Next.js Server Actions in actions/compile.ts).
- It appears to be an interactive code editor or language tool (EditorComponent, SelectLanguages, compile action).

##### File structure
- Top level:
– app/ : Next.js 13 routed React pages and layouts
– components/ : reusable UI pieces (editors, buttons, theme provider)
– actions/ : server-side functions (compile.ts)
– lib/ : utility functions
– config/ : app configuration (e.g., supported languages)
– public/ : static assets
– config files: tsconfig.json, next.config.mjs, ESLint, Tailwind, PostCSS
- app/layout.tsx defines your root layout and wraps pages in theme-provider.
- app/page.tsx is the entry page that likely uses EditorComponent and SelectLanguages.
- components/ui contains low-level UI primitives (button, dropdown, toast, etc.) used by higher-level components.
- actions/compile.ts is invoked from the client via Next.js server actions to perform compilation.

##### README for additional insights
- Standard Next.js boilerplate with font optimization and Vercel deployment.

##### Detail-level reminders
- Distinct folder/module as its own component if it has a unique responsibility.
- How pages/layout wrap UI components and call down into services.
- Do not over-aggregate: better to show config, utilities, UI, server actions as separate nodes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Browser["Browser"]:::external

    subgraph "Client Layer"
        direction TB
        Layout["Root Layout"]:::client
        Page["Entry Page"]:::client
        Editor["EditorComponent"]:::client
        SelectLang["SelectLanguages"]:::client
        ThemeProv["Theme Provider"]:::client
        ModeToggle["Mode Toggle Button"]:::client
    end

    subgraph "UI Primitives"
        direction TB
        Button["Button"]:::client
        Dropdown["Dropdown Menu"]:::client
        Resizable["Resizable Container"]:::client
        Toast["Toast & Toaster & use-toast"]:::client
    end

    subgraph "Server Layer"
        direction TB
        Compile["Server Action: compile.ts"]:::server
    end

    subgraph "Shared Modules"
        direction TB
        Utils["Shared Utilities"]:::shared
        Config["Application Configuration"]:::shared
    end

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

    Browser --> Layout
    Layout --> Page
    Page --> Editor
    Page --> SelectLang
    Layout --> ThemeProv
    ThemeProv --> ModeToggle
    Editor --> Button
    SelectLang --> Dropdown
    Page --> Resizable
    Page --> Toast

    Page -->|"invoke compile"| Compile
    Compile --> Utils
    Compile --> Config
    Compile -->|"return result"| Page

    Browser --> Static

    Tailwind["Tailwind CSS"]:::external
    NextFont["next/font"]:::external
    Vercel["Vercel Hosting"]:::external

    Static --> Tailwind
    Static --> NextFont
    Compile --> Vercel

    click Layout "https://github.com/muke-coder/online-code-compiler/blob/main/app/layout.tsx"
    click Page "https://github.com/muke-coder/online-code-compiler/blob/main/app/page.tsx"
    click Editor "https://github.com/muke-coder/online-code-compiler/blob/main/components/EditorComponent.tsx"
    click SelectLang "https://github.com/muke-coder/online-code-compiler/blob/main/components/SelectLanguages.tsx"
    click ThemeProv "https://github.com/muke-coder/online-code-compiler/blob/main/components/theme-provider.tsx"
    click ModeToggle "https://github.com/muke-coder/online-code-compiler/blob/main/components/mode-toggle-btn.tsx"
    click Button "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/button.tsx"
    click Dropdown "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/dropdown-menu.tsx"
    click Resizable "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/resizable.tsx"
    click Toast "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/toast.tsx"
    click Toast "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/toaster.tsx"
    click Toast "https://github.com/muke-coder/online-code-compiler/blob/main/components/ui/use-toast.ts"
    click Compile "https://github.com/muke-coder/online-code-compiler/blob/main/actions/compile.ts"
    click Utils "https://github.com/muke-coder/online-code-compiler/blob/main/lib/utils.ts"
    click Config "https://github.com/muke-coder/online-code-compiler/blob/main/config/config.ts"
    click Static "https://github.com/muke-coder/online-code-compiler/tree/main/public/"
    click Tailwind "https://github.com/muke-coder/online-code-compiler/blob/main/tailwind.config.ts"
    click NextFont "https://github.com/muke-coder/online-code-compiler/blob/main/postcss.config.mjs"
    click NextFont "https://github.com/muke-coder/online-code-compiler/blob/main/next.config.mjs"
    click NextFont "https://github.com/muke-coder/online-code-compiler/blob/main/tsconfig.json"
    click NextFont "https://github.com/muke-coder/online-code-compiler/blob/main/.eslintrc.json"

    classDef client fill:#cfefff,stroke:#0366d6
    classDef server fill:#d4f4dd,stroke:#28a745
    classDef shared fill:#fff4e6,stroke:#ff8c00
    classDef static fill:#e2e2e2,stroke:#666
    classDef external fill:#f0f0f0,stroke:#999,stroke-dasharray: 5 5
```
