# jaibun01/data_wow_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/jaibun01/data_wow_frontend
- Repository: https://github.com/jaibun01/data_wow_frontend

## Overview

##### Main Components to Identify and Represent
- Next.js App Layer: Represent the “app” directory as the core of your system. Within it, you have different page groups such as the main page, blog, our‑blog, and signin. Show how Next.js handles routing and server‑side rendering.
- Feature Modules: Outline the “features” directory, which includes blog detail, form comment, form signin, home, and our‑blog. These represent domain-specific business logic and combine hooks, views, interfaces, and services. Emphasize that these modules encapsulate the core functionality like creating and managing blog entries, user sign‑in, and commenting.
- Services & API Communication: Highlight the “utils/axios” and helper modules as abstractions for API calls. Note that environment variables like NEXT_PUBLIC_API_ENDPOINT indicate integration points with external services.
- State Management: Include the “stores” directory (e.g., useProfileStore) to capture the client‑side state management aspect.
- Configuration & Constants: Represent the configs, constants, and build settings (such as tailwind.config.ts, tsconfig.json, next.config.ts) to show how the application is set up and optimized.
- External Libraries & Frameworks: Indicate Tailwind CSS and Material UI as key UI libraries, and note the integration of next/font for optimizing fonts.

##### Relationships and Interactions between Components
- Layout Wrapping: Show that global and feature‑specific layouts (header, footer, and left‑side‑bar) wrap the page components, ensuring consistent UI and navigation.
- State Management Flow: Describe how components (or feature hooks) interact with global state (stores) to track user profile or other stateful data.

##### Architectural Patterns / Design Principles
- Layered Architecture: Highlight the separation into presentation (app pages and components), business logic (feature hooks and services), and data/access layers (axios and helpers).
- Routing and Dynamic Pages: Note the use of dynamic routing (e.g., src/app/blog/[id]/page.tsx) to serve dynamic blog content.
- Separation of Concerns: Each directory (layouts, components, features, stores) is responsible for a separate concern, making the overall architecture clean and maintainable.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Global Entities
    User["User"]:::frontend
    NextJsRouter["Next.js Router"]:::frontend

    %% Presentation Layer
    subgraph "Presentation Layer"
        NextApp["Next.js App Layer"]:::frontend
        GlobalLayout["Global Layout"]:::frontend
        BlogLayout["Blog Layout"]:::frontend
        OurBlogLayout["Our‑Blog Layout"]:::frontend
        SigninLayout["Signin Layout"]:::frontend
        Header["Header (with DrawerLeft & ProfileBadge)"]:::frontend
        Footer["Footer"]:::frontend
        LeftSidebar["Left‑Side‑Bar"]:::frontend
        HomePage["Home Page"]:::frontend
        BlogPage["Blog Page"]:::frontend
        OurBlogPage["Our‑Blog Page"]:::frontend
        SigninPage["Signin Page"]:::frontend
        MaterialUI["Material UI"]:::frontend
        TailwindCSS["Tailwind CSS"]:::frontend
        Fonts["Fonts Optimizer (next/font)"]:::frontend
    end

    %% Feature Modules
    subgraph "Feature Modules"
        BlogFeature["Blog Feature Module"]:::business
        BlogDetailFeature["Blog Detail Feature Module"]:::business
        FormCommentFeature["Form Comment Feature Module"]:::business
        FormSigninFeature["Form Signin Feature Module"]:::business
        HomeFeature["Home Feature Module"]:::business
        OurBlogFeature["Our‑Blog Feature Module"]:::business
    end

    %% Infrastructure & Utilities
    subgraph "Infrastructure & Utilities"
        Axios["API Service (Axios)"]:::infra
        Helpers["Helpers"]:::infra
        ProfileStore["Global Store (useProfileStore)"]:::infra
        Configs["Configurations"]:::infra
        Constants["Global Constants"]:::infra
        BuildConfigs["Build & Styling Configs"]:::infra
        ExternalAPI["External API Endpoint (NEXT_PUBLIC_API_ENDPOINT)"]:::infra
    end

    %% Connections: Navigation Flow
    User -->|"navigates"| NextJsRouter
    NextJsRouter -->|"routes-to"| NextApp

    %% Connections within Presentation Layer
    NextApp -->|"renders"| HomePage
    NextApp -->|"renders"| BlogPage
    NextApp -->|"renders"| OurBlogPage
    NextApp -->|"renders"| SigninPage

    HomePage -->|"wrapped-by"| GlobalLayout
    BlogPage -->|"wrapped-by"| BlogLayout
    OurBlogPage -->|"wrapped-by"| OurBlogLayout
    SigninPage -->|"wrapped-by"| SigninLayout

    GlobalLayout -->|"includes"| Header
    GlobalLayout -->|"includes"| Footer
    GlobalLayout -->|"includes"| LeftSidebar

    NextApp -.->|"styles-via"| TailwindCSS
    NextApp -.->|"styles-via"| MaterialUI
    NextApp -.->|"fonts-via"| Fonts

    %% Connections from Page Components to Feature Modules
    BlogPage -->|"invokes"| BlogFeature
    BlogPage -->|"invokes"| BlogDetailFeature
    BlogPage -->|"invokes"| FormCommentFeature
    SigninPage -->|"invokes"| FormSigninFeature
    HomePage -->|"invokes"| HomeFeature
    OurBlogPage -->|"invokes"| OurBlogFeature

    %% Feature Modules to Infrastructure (API calls & State Management)
    BlogFeature -->|"calls"| Axios
    BlogFeature -->|"utilizes"| Helpers
    BlogDetailFeature -->|"calls"| Axios
    FormCommentFeature -->|"calls"| Axios
    FormSigninFeature -->|"calls"| Axios
    HomeFeature -->|"calls"| Axios
    OurBlogFeature -->|"calls"| Axios

    BlogFeature -->|"updates"| ProfileStore
    FormSigninFeature -->|"updates"| ProfileStore

    %% Infrastructure Connections
    Axios -->|"communicates"| ExternalAPI
    Axios -->|"configured-by"| Configs
    Axios -->|"uses"| Constants
    Axios -->|"build-configs"| BuildConfigs

    Helpers -->|"assists"| Axios

    %% Click Events
    click NextApp "https://github.com/jaibun01/data_wow_frontend/tree/main/src/app"
    click GlobalLayout "https://github.com/jaibun01/data_wow_frontend/blob/main/src/app/(page)/layout.tsx"
    click BlogLayout "https://github.com/jaibun01/data_wow_frontend/blob/main/src/app/blog/layout.tsx"
    click OurBlogLayout "https://github.com/jaibun01/data_wow_frontend/blob/main/src/app/our-blog/layout.tsx"
    click SigninLayout "https://github.com/jaibun01/data_wow_frontend/blob/main/src/app/signin/layout.tsx"
    click Header "https://github.com/jaibun01/data_wow_frontend/tree/main/src/layout/header"
    click Footer "https://github.com/jaibun01/data_wow_frontend/tree/main/src/layout/footer"
    click LeftSidebar "https://github.com/jaibun01/data_wow_frontend/tree/main/src/layout/left-side-bar"
    click BlogFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/blog"
    click BlogDetailFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/blog-detail"
    click FormCommentFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/form-comment"
    click FormSigninFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/form-signin"
    click HomeFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/home"
    click OurBlogFeature "https://github.com/jaibun01/data_wow_frontend/tree/main/src/features/our-blog"
    click Axios "https://github.com/jaibun01/data_wow_frontend/tree/main/src/utils/axios"
    click Helpers "https://github.com/jaibun01/data_wow_frontend/tree/main/src/utils/helpers"
    click ProfileStore "https://github.com/jaibun01/data_wow_frontend/blob/main/src/stores/useProfileStore.ts"
    click Configs "https://github.com/jaibun01/data_wow_frontend/tree/main/src/configs"
    click Constants "https://github.com/jaibun01/data_wow_frontend/tree/main/src/constants"
    click BuildConfigs "https://github.com/jaibun01/data_wow_frontend/blob/main/next.config.ts"
    click Tsconfig "https://github.com/jaibun01/data_wow_frontend/blob/main/tsconfig.json"
    click PostCSS "https://github.com/jaibun01/data_wow_frontend/blob/main/postcss.config.mjs"
    click TailwindCSS "https://github.com/jaibun01/data_wow_frontend/blob/main/tailwind.config.ts"
    click Fonts "https://github.com/jaibun01/data_wow_frontend/tree/main/src/app/fonts"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px;
    classDef business fill:#90EE90,stroke:#000,stroke-width:1px;
    classDef infra fill:#FFD700,stroke:#000,stroke-width:1px;
```
