# shubham7854/vibe-code-editor architecture

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

- Interactive diagram: https://gitdiagram.com/shubham7854/vibe-code-editor
- Repository: https://github.com/shubham7854/vibe-code-editor

## Overview

##### Project type and purpose
- This is a full-stack web application built with Next.js (app directory, page.jsx files) and Tailwind CSS (tailwind.config.js).
- It uses Prisma (prisma/schema.prisma) as an ORM to interact with a relational database.
- The folder structure under src/app indicates two major route groups: an “admin” area for managing posts and users, and an “auth” area for sign-in/sign-up flows.

##### File structure
- Top-level:
– prisma/schema.prisma → database schema definitions and datasource configuration.
– public/thumbnails → static assets served directly by Next.js.
– tailwind.config.js → styling system configuration.
- src/app: Next.js 13 app Router
– (admin)/posts/page.jsx, (admin)/users/page.jsx → server components rendering admin dashboards.
– (auth)/sign-in/page.jsx, (auth)/sign-up/page.jsx → authentication entry points.
– src/app/actions/getBlogs.js, getSingleUser.js → server-side functions (likely invoked via React Server Components or API routes) that fetch data via Prisma.

##### README for additional insights
- (Empty) — file structure and naming conventions reveal the architecture.

##### Detail
- Which code runs on the server vs. the client.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client/UI Layer
    subgraph "Client/UI Layer"
        BP["Browser (User)"]:::client
        AP["Admin Posts Page"]:::ui
        AU["Admin Users Page"]:::ui
        SI["Auth Sign-In Page"]:::ui
        SU["Auth Sign-Up Page"]:::ui
    end

    %% Server/Backend Layer
    subgraph "Server/Backend Layer"
        NSS["Next.js Server (App Router)"]:::server
        GB["getBlogs Action"]:::server
        GU["getSingleUser Action"]:::server
        TC["Tailwind Config"]:::server
    end

    %% Data Layer
    subgraph "Data Layer"
        PS["schema.prisma"]:::prisma
        PC["Prisma Client"]:::prisma
        DB[(Database)]:::database
    end

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

    %% Connections
    AP -->|"GET /admin/posts"| NSS
    AU -->|"GET /admin/users"| NSS
    SI -->|"GET /auth/sign-in"| NSS
    SU -->|"GET /auth/sign-up"| NSS

    NSS -->|"invoke getBlogs()"| GB
    NSS -->|"invoke getSingleUser()"| GU
    NSS -->|"serve CSS"| TC

    GB -->|"query"| PC
    GU -->|"query"| PC
    PC -->|"SQL query"| DB
    DB -->|"rows"| PC
    PC -->|"results"| GB
    PC -->|"results"| GU
    GB -->|"data"| NSS
    GU -->|"data"| NSS

    NSS -->|"HTML/CSS/JS response"| BP
    BP -->|"GET thumbnails"| FS
    FS -->|"serve assets"| BP

    %% Click Events
    click AP "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/(admin)/posts/page.jsx"
    click AU "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/(admin)/users/page.jsx"
    click SI "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/(auth)/sign-in/page.jsx"
    click SU "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/(auth)/sign-up/page.jsx"
    click GB "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/actions/getBlogs.js"
    click GU "https://github.com/shubham7854/vibe-code-editor/blob/main/src/app/actions/getSingleUser.js"
    click PS "https://github.com/shubham7854/vibe-code-editor/blob/main/prisma/schema.prisma"
    click PC "https://github.com/shubham7854/vibe-code-editor/blob/main/prisma/schema.prisma"
    click FS "https://github.com/shubham7854/vibe-code-editor/tree/main/public/thumbnails"
    click TC "https://github.com/shubham7854/vibe-code-editor/blob/main/tailwind.config.js"
    click NSS "https://github.com/shubham7854/vibe-code-editor/tree/main/src/app"

    %% Styles
    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef client fill:#87CEFA,stroke:#333,stroke-width:1px
    classDef server fill:#90EE90,stroke:#333,stroke-width:1px
    classDef prisma fill:#FFA500,stroke:#333,stroke-width:1px
    classDef database fill:#D3D3D3,stroke:#333,stroke-width:2px
    classDef static fill:#FFD700,stroke:#333,stroke-width:1px
```
