# wasp-lang/vibe-coding-video architecture

> Architecture diagram of the GitHub repository wasp-lang/vibe-coding-video, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wasp-lang/vibe-coding-video
- Repository: https://github.com/wasp-lang/vibe-coding-video

## Overview

##### Project type and purpose
- This is a full-stack web application (“Vibe Coding Budget App”) built with Wasp (a DSL that wires together React, Node.js, and Prisma/PostgreSQL).
- Purpose: a collaborative, envelope-style budgeting tool with user auth, transactions, and team features.

##### File structure
- Top level:
- main.wasp – the Wasp DSL entrypoint defining pages, routes, operations (queries/actions), auth
- schema.prisma & migrations/… – database schema and migration history (PostgreSQL via Prisma)
- src/ – custom client & server code
- src/features/ – feature-based vertical slices (auth, tasks, users, chats, dashboard, settings)
- src/components/ – shared UI components (Shadcn/ui + custom)
- src/config, src/context, src/hooks – global config (fonts, queries, server), React contexts, utility hooks
- Build and deploy scripts: package.json, vite.config.ts, tailwind.config.cjs, .env, Wasp CLI commands.

##### Extract architectural insights from README
- Wasp orchestrates boilerplate for auth, DB, build, and runtime.
- Workflow follows vertical-slice incremental delivery (PRD → plan → schema → operations → server logic → UI → test → docs).
- UI uses Shadcn-admin components on top of Tailwind/Vite/React.
- Database powered by Prisma, migrations driven by Wasp.

##### Main components & their interactions
a. Frontend (React + Vite + TypeScript + Shadcn/UI + Tailwind)
b. Backend (Node.js server generated by Wasp, with custom logic in src/features/*)
c. Wasp DSL engine (main.wasp) – compiles & wires up frontend, backend, Prisma
d. Prisma ORM – maps JS/TS calls to PostgreSQL queries
e. PostgreSQL database (running in Docker or local)
f. Auxiliary dev tools – Wasp CLI (db start, migrate, start), migrations folder
g. External/dev-time AI tools (Cursor, Gemini) – not in runtime but part of the developer workflow

Data‐flow:
- User → React UI pages/components
- UI → calls Wasp‐generated GraphQL/REST operations (defined in main.wasp) over HTTP
- Backend handlers → use Prisma client to read/write Postgres
- Backend → returns results → UI updates
- Wasp CLI/migrations → manage DB schema lifecycle

##### Architectural patterns & design principles
- Vertical-slice feature organization (each feature folder contains UI, data, context)
- Clear separation of concerns: UI components vs. feature pages vs. server logic vs. data models
- Declarative DSL (Wasp) to automate integration: reduces boilerplate and enforces conventions
- Stateless frontend, stateless server functions (operations), stateful Postgres DB
- Context providers (theme, font, search) for cross-cutting concerns

##### Elements
- UI → Server operations → DB → Server → UI
- Wasp CLI → migrations → DB
- Wasp DSL → generates Server & Client code
- Backend in another (e.g., green)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Dev Tools Layer
    subgraph "Dev Tools" 
        direction TB
        WaspCLI["Wasp CLI"]:::devtool
        Migrations["Prisma Migrations"]:::devtool
        Env[".env"]:::devtool
    end

    %% Wasp DSL Orchestration
    WaspDSL["main.wasp DSL"]:::dsl

    WaspCLI -->|"manages migrations"| Migrations
    WaspCLI -->|"uses DSL"| WaspDSL
    Env --> WaspDSL

    %% Frontend Layer
    subgraph "Frontend (Browser)" 
        direction TB
        ReactEntry["React Entry (src/main.tsx)"]:::frontend
        Styles["Global Styles\n(src/index.css,\ntailwind.config.cjs)"]:::frontend
        ViteConfig["Vite Config\n(vite.config.ts)"]:::frontend
        subgraph "UI Shared Components"
            direction TB
            ShadcnUI["Shadcn/UI + Custom\n(src/components/ui/)"]:::frontend
            Layout["Layout & Controls\n(src/components/layout/)"]:::frontend
        end
        subgraph "Global Setup"
            direction TB
            QuerySetup["Query Setup\n(src/config/querySetup.ts)"]:::frontend
            ServerSetup["Server Setup\n(src/config/serverSetup.ts)"]:::frontend
            Fonts["Fonts Config\n(src/config/fonts.ts)"]:::frontend
            ThemeCtx["Theme Context\n(src/context/theme-context.tsx)"]:::frontend
            FontCtx["Font Context\n(src/context/font-context.tsx)"]:::frontend
            SearchCtx["Search Context\n(src/context/search-context.tsx)"]:::frontend
            Hooks["Utility Hooks\n(src/hooks/)"]:::frontend
        end
        subgraph "Features UI"
            direction TB
            AuthUI["Auth UI\n(src/features/auth/)"]:::frontend
            UsersUI["Users UI\n(src/features/users/)"]:::frontend
            TasksUI["Transactions UI\n(src/features/tasks/)"]:::frontend
            ChatsUI["Chats UI\n(src/features/chats/)"]:::frontend
            DashboardUI["Dashboard UI\n(src/features/dashboard/)"]:::frontend
            SettingsUI["Settings UI\n(src/features/settings/)"]:::frontend
            ErrorsUI["Error Pages\n(src/features/errors/)"]:::frontend
        end
        ReactEntry --> Styles
        ReactEntry --> ViteConfig
        ReactEntry --> ShadcnUI
        ReactEntry --> Layout
        ReactEntry --> QuerySetup
        ReactEntry --> ServerSetup
        ReactEntry --> Fonts
        ReactEntry --> ThemeCtx
        ReactEntry --> FontCtx
        ReactEntry --> SearchCtx
        ReactEntry --> Hooks
        ReactEntry --> AuthUI
        ReactEntry --> UsersUI
        ReactEntry --> TasksUI
        ReactEntry --> ChatsUI
        ReactEntry --> DashboardUI
        ReactEntry --> SettingsUI
        ReactEntry --> ErrorsUI
    end

    %% Backend Layer
    subgraph "Backend (Node/Wasp Server)"
        direction TB
        WaspServer["Wasp Server\n(generated Node.js)"]:::backend
        subgraph "Operations & Logic"
            direction TB
            Operations["DSL Operations\n(actions/queries)"]:::backend
            AuthLogic["Auth Logic\n(src/features/auth/)"]:::backend
            UsersLogic["Users Logic\n(src/features/users/)"]:::backend
            TasksLogic["Transactions Logic\n(src/features/tasks/)"]:::backend
            ChatsLogic["Chats Logic\n(src/features/chats/)"]:::backend
            DashboardLogic["Dashboard Logic\n(src/features/dashboard/)"]:::backend
            SettingsLogic["Settings Logic\n(src/features/settings/)"]:::backend
            ErrorsLogic["Error Handlers\n(src/features/errors/)"]:::backend
        end
        PrismaClient["Prisma Client"]:::backend
        WaspDSL -->|“generates”| WaspServer
        WaspServer --> Operations
        Operations --> AuthLogic
        Operations --> UsersLogic
        Operations --> TasksLogic
        Operations --> ChatsLogic
        Operations --> DashboardLogic
        Operations --> SettingsLogic
        Operations --> ErrorsLogic
        AuthLogic --> PrismaClient
        UsersLogic --> PrismaClient
        TasksLogic --> PrismaClient
        ChatsLogic --> PrismaClient
        DashboardLogic --> PrismaClient
        SettingsLogic --> PrismaClient
        ErrorsLogic --> PrismaClient
    end

    %% Database Layer
    subgraph "Database"
        direction TB
        PrismaSchema["schema.prisma"]:::database
        Postgres["PostgreSQL DB"]:::database
    end
    Migrations --> PrismaSchema
    PrismaClient --> PrismaSchema
    PrismaSchema --> Postgres

    %% Data Flow Arrows
    ReactEntry -->|"HTTP calls"| WaspServer
    WaspServer -->|"DB queries"| Postgres
    Postgres -->|"results"| WaspServer
    WaspServer -->|"responses"| ReactEntry

    %% Click Events
    click WaspDSL "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/main.wasp"
    click PrismaSchema "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/schema.prisma"
    click Migrations "https://github.com/wasp-lang/vibe-coding-video/tree/video-starter/migrations/"
    click ReactEntry "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/main.tsx"
    click Styles "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/index.css"
    click Styles "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/tailwind.config.cjs"
    click ViteConfig "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/vite.config.ts"
    click ShadcnUI "https://github.com/wasp-lang/vibe-coding-video/tree/video-starter/src/components/ui/"
    click Layout "https://github.com/wasp-lang/vibe-coding-video/tree/video-starter/src/components/layout/"
    click QuerySetup "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/config/querySetup.ts"
    click ServerSetup "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/config/serverSetup.ts"
    click Fonts "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/config/fonts.ts"
    click ThemeCtx "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/context/theme-context.tsx"
    click FontCtx "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/context/font-context.tsx"
    click SearchCtx "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/context/search-context.tsx"
    click Hooks "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/hooks/use-dialog-state.tsx"
    click Hooks "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/hooks/use-mobile.tsx"
    click Hooks "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/hooks/use-theme.tsx"
    click Hooks "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/hooks/use-toast.ts"
    click AuthUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/auth/login.tsx"
    click AuthUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/auth/signup.tsx"
    click UsersUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/users/index.tsx"
    click UsersUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/users/context/users-context.tsx"
    click UsersUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/users/data/users.ts"
    click TasksUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/tasks/index.tsx"
    click TasksUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/tasks/context/tasks-context.tsx"
    click ChatsUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/chats/index.tsx"
    click DashboardUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/dashboard/index.tsx"
    click SettingsUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/settings/index.tsx"
    click ErrorsUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/errors/forbidden.tsx"
    click ErrorsUI "https://github.com/wasp-lang/vibe-coding-video/blob/video-starter/src/features/errors/not-found-error.tsx"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#007B8A,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#2E7D32,stroke-width:1px
    classDef database fill:#FFF3E0,stroke:#EF6C00,stroke-width:1px,shape:cylinder
    classDef devtool fill:#ECEFF1,stroke:#546E7A,stroke-width:1px
    classDef dsl fill:#F3E5F5,stroke:#6A1B9A,stroke-width:1px
```
