# manojkumarhr2002/3d-platform architecture

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

- Interactive diagram: https://gitdiagram.com/manojkumarhr2002/3d-platform
- Repository: https://github.com/manojkumarhr2002/3d-platform

## Overview

##### Project Type and Purpose
- This is a client-side web application focused on interactive 3D experiences. It leverages React Fiber (a React renderer for Three.js) and Three.js for rendering 3D scenes.
- The main purpose is to provide a rich user interface that includes real-time camera controls, interactive object manipulation, and dynamic animations to deliver immersive 3D web experiences.
- The project is modular, with different pages for authentication, dashboard management, canvas-based 3D interactions, and a landing page providing marketing information.

##### File Structure
- The top-level structure includes configuration and build files (e.g., package.json, vite.config.js, postcss.config.js) along with the index.html that acts as the entry point.
- The src directory is comprehensive, separating concerns through:
- App.jsx and main.jsx: bootstrapping and overarching layout.
- Components: Organized into folders such as AuthenticationPage, Canvas, Dashboard, and LandingPage. This segregation indicates a clear separation of UI domains/components.
- Pages: Contains route-level wrappers (e.g., CanvasPage, DashboardPage, etc.) which group various components together forming the application pages.
- Services: Contains business logic files that likely manage data or communications between different parts of the UI (e.g., AssetCategories.js, MyProjects.js).
- The folder naming and structure reflect an MVC-like or component-driven architecture typical in React applications, with a particularly modular design for scalability.

##### Key Components
- Frontend/UI Layer:
- Landing Page: Includes navigation, hero section, and features overview.
- Authentication: Login and sign-up forms (including FormInput components).
- Dashboard: Comprises multiple subcomponents like Home, Sidebar, Asset Store, Bin, Help and Feedback, etc.
- 3D Canvas Interface: Contains:
○ CanvasArea – the primary 3D scene area with components like Scene.jsx and SplitPane.jsx.
○ Project Hierarchy Panel – manages assets (AssetsCard, ObjectsCard).
○ Properties Panel – displays and updates details / properties of selected objects.
○ TopBar – likely hosting controls, menus, and status info.
- 3D Rendering & Interaction Layer:
- The Canvas 3D area is powered by React Fiber and Three.js. This layer is responsible for real-time camera controls, object interaction handling, and dynamic animations.
- Services/Business Logic:
- Services modules for asset categories, user projects, and shared projects that underpin the dashboard functionalities and data fetching.
- Routing and Page Management:
- Pages that group respective components for Authentication, Dashboard, Canvas, and Landing, ensuring proper routing/mounting.
- External Libraries/Frameworks:

##### Relationships and Interactions
- How the Navigation components on the Landing and Dashboard pages route users to Authentication, Canvas, or Dashboard pages.
- UI interactions sending events (like mouse clicks, drag events) from the CanvasArea to the underlying 3D engine (React Fiber with Three.js) for rendering updates.
- Communication between the Services layer and components (e.g., Dashboard components fetching data from AssetCategories, MyProjects, and SharedProjects services).
- The overall bundle flow from the main entry point (index.html → main.jsx → App.jsx) branching to different pages/components.

##### Final Detailed Steps for the Engineer
- Within the Frontend UI layer, split into Landing Page, Authentication, Dashboard, and Canvas-based interaction pages.
- Annotations describing the role of external libraries (React Fiber & Three.js) in powering the interactivity and animations.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Entry Point
    subgraph "Entry Point"
        A1["index.html"]:::entry
        A2["main.jsx"]:::entry
        A3["App.jsx"]:::entry
    end
    A1 --> A2
    A2 --> A3

    %% Page Entry Points
    subgraph "Pages"
        P1["LandingPage Page"]:::page
        P2["AuthenticationPage Page"]:::page
        P3["DashboardPage Page"]:::page
        P4["CanvasPage Page"]:::page
    end
    A3 --> P1
    A3 --> P2
    A3 --> P3
    A3 --> P4

    %% Frontend UI Layer
    subgraph "Frontend UI Layer"
        B1["Landing Page - Navigation & Hero"]:::ui
        B2["Authentication - Login/SignUp Forms"]:::ui
        B3["Dashboard - Sidebar, Asset Store, etc."]:::ui
        B4["Canvas 3D Interface - Composite UI"]:::ui
    end
    P1 --> B1
    P2 --> B2
    P3 --> B3
    P4 --> B4

    %% 3D Canvas Internal Components
    subgraph "3D Canvas Components"
        C1["CanvasArea"]:::canvas
        C2["Project Hierarchy Panel"]:::canvas
        C3["Properties Panel"]:::canvas
        C4["TopBar"]:::canvas
    end
    B4 --> C1
    B4 --> C2
    B4 --> C3
    B4 --> C4

    %% External 3D Rendering Engine
    subgraph "3D Rendering Engine"
        E1["React Fiber"]:::external
        E2["Three.js"]:::external
        F1["@react-three/drei"]:::external
    end
    C1 -->|"renders in"| E1
    E1 -->|"poweredBy"| E2
    E1 -->|"helperFor"| F1

    %% Services / Business Logic
    subgraph "Services/Business Logic"
        S1["AssetCategories.js"]:::service
        S2["MyProjects.js"]:::service
        S3["SharedWithMeProjects.js"]:::service
    end
    %% Dashboard fetching services
    B3 -->|"fetchesDataFrom"| S1
    B3 -->|"fetchesDataFrom"| S2
    B3 -->|"fetchesDataFrom"| S3

    %% Navigation Connections from Landing Page
    B1 -->|"navigatesTo"| B2
    B1 -->|"navigatesTo"| B3
    B1 -->|"navigatesTo"| B4

    %% UI to 3D Rendering Interaction
    B4 -->|"userInput"| C1

    %% Click Events for Component Mapping
    click B1 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/LandingPage/"
    click P1 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/pages/LandingPage/LandingPage.jsx"

    click B2 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/AuthenticationPage/"
    click P2 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/pages/AuthenticationPage/AuthenticationPage.jsx"

    click B3 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/Dashboard/"
    click P3 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/pages/DashboardPage/DashboardPage.jsx"

    click C1 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/Canvas/CanvasArea/"
    click C2 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/Canvas/ProjectHierarchyPanel/"
    click C3 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/Canvas/PropertiesPanel/"
    click C4 "https://github.com/manojkumarhr2002/3d-platform/tree/main/src/components/Canvas/TopBar/"
    click P4 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/pages/CanvasPage/CanvasPage.jsx"

    click S1 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/services/AssetCategories.js"
    click S2 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/services/MyProjects.js"
    click S3 "https://github.com/manojkumarhr2002/3d-platform/blob/main/src/services/SharedWithMeProjects.js"

    %% Styling
    classDef entry fill:#f9d6a5,stroke:#333,stroke-width:2px;
    classDef page fill:#aed581,stroke:#333,stroke-width:2px;
    classDef ui fill:#c5e1a5,stroke:#333,stroke-width:2px;
    classDef canvas fill:#81d4fa,stroke:#333,stroke-width:2px;
    classDef service fill:#ffcc80,stroke:#333,stroke-width:2px;
    classDef external fill:#e1bee7,stroke:#333,stroke-width:2px;
```
