# h8ngrydev4hire/themediamasons architecture

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

- Interactive diagram: https://gitdiagram.com/h8ngrydev4hire/themediamasons
- Repository: https://github.com/h8ngrydev4hire/themediamasons

## Overview

##### Main System Components

a) Frontend Layer
- Next.js Application (Client-side)
- Three.js Components (3D Rendering)
- UI Components
- Routing System

b) Backend Layer
- Next.js API Routes
- Prisma ORM
- Database Connection

##### Component Organization

a) Core Application Structure
- Main app directory structure (/src/app)
- Routing system
- API routes organization

b) Component Architecture
- Feature-based components (_components folder)
- Common/Shared components
- Modal system
- Three.js integration

##### Data Flow and Integration Points

Key interactions:

a) Client-Server Communication
- API routes for contact form (/api/post/contact-info)
- Modal management system (/api/modal)
- Database operations through Prisma

b) State Management
- Custom hooks (useModal, useTransition)
- Data flow between components

##### Specific Implementation Details

Technical elements:

a) Frontend Architecture
- Component hierarchy
- Modular structure of features (About, Contact, Hero, Pricing, etc.)
- Demonstrate the integration of 3D components

b) Backend Services
- Prisma database connection
- API route handlers
- Form validation systems

##### Key Relationships to Highlight

- Component composition (parent-child relationships)
- API route connections
- Database interactions
- Modal system integration
- 3D content integration

- Client Layer       |
- Pages               |
- Components          |
- Three.js Elements   |

- ↕

- API Layer          |
- Next.js API Routes   |
- Form Handling        |
- Validation          |

- ↕

- Data Layer         |
- Prisma ORM          |
- Database            |

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        NextApp["Next.js App Root"]:::frontend
        Layout["Layout System"]:::frontend
        GlobalStyles["Global Styles"]:::frontend
        
        subgraph ThreeJS["Three.js Integration"]
            ThreeComponents["Three.js Components"]:::threejs
            ContentFactory["Content Factory"]:::threejs
            Models["3D Models"]:::threejs
        end
        
        subgraph FeatureComponents["Feature Components"]
            Hero["Hero Section"]:::component
            About["About Section"]:::component
            Pricing["Pricing Section"]:::component
            Services["Services Section"]:::component
            Contact["Contact Section"]:::component
        end
        
        subgraph CommonComponents["Common Components"]
            Nav["Navigation"]:::component
            Background["Background"]:::component
            Footer["Footer"]:::component
            ContentBlock["Content Blocks"]:::component
        end
        
        subgraph StateManagement["State Management"]
            ModalHook["Modal Hook"]:::state
            TransitionHook["Transition Hook"]:::state
        end
        
        subgraph DataSources["Data Sources"]
            ServiceData["Service Data"]:::data
            PricingData["Pricing Data"]:::data
            CTAData["CTA Data"]:::data
        end
    end
    
    subgraph Backend
        subgraph API["API Layer"]
            APIRoutes["API Routes"]:::api
            ContactAPI["Contact Form Handler"]:::api
            ModalAPI["Modal API"]:::api
        end
        
        subgraph Database["Database Layer"]
            Prisma["Prisma ORM"]:::db
            DBConn["Database Connection"]:::db
        end
        
        subgraph ModalSystem["Modal System"]
            ContactModal["Contact Form Modal"]:::modal
            NewsletterModal["Newsletter Modal"]:::modal
        end
    end
    
    %% Relationships
    NextApp --> Layout
    Layout --> GlobalStyles
    Layout --> Nav
    Layout --> Background
    Layout --> Footer
    
    ThreeComponents --> ContentFactory
    ContentFactory --> Models
    
    Hero --> ThreeComponents
    Services --> ServiceData
    Pricing --> PricingData
    Contact --> ContactAPI
    
    ModalHook --> ModalAPI
    ModalAPI --> ContactModal
    ModalAPI --> NewsletterModal
    
    ContactAPI --> Prisma
    Prisma --> DBConn
    
    %% Click Events
    click NextApp "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/page.tsx"
    click Layout "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/layout.tsx"
    click GlobalStyles "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/ui/globals.css"
    click ThreeComponents "https://github.com/h8ngrydev4hire/themediamasons/tree/main/src/components/three/"
    click ContentFactory "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/three/contentFactory/contentFactory.tsx"
    click Models "https://github.com/h8ngrydev4hire/themediamasons/tree/main/public/models/"
    click Hero "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/_components/hero/hero.tsx"
    click About "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/_components/about/about.tsx"
    click Pricing "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/_components/pricing/pricing.tsx"
    click Services "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/_components/services/services.tsx"
    click Contact "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/_components/contact/contact.tsx"
    click Prisma "https://github.com/h8ngrydev4hire/themediamasons/blob/main/prisma/schema.prisma"
    click DBConn "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/lib/db/prisma.ts"
    click APIRoutes "https://github.com/h8ngrydev4hire/themediamasons/tree/main/src/app/api/"
    click ContactAPI "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/api/post/contact-info/route.ts"
    click ModalAPI "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/app/api/modal/route.ts"
    click ContactModal "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/modals/contactFormModal/contactFormModal.tsx"
    click NewsletterModal "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/modals/newsletterModal/newsletterModal.tsx"
    click ModalHook "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/hooks/useModal.ts"
    click TransitionHook "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/hooks/useTransition.ts"
    click Nav "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/common/navigator/navigator.tsx"
    click Background "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/background/background.tsx"
    click Footer "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/footer/footer.tsx"
    click ContentBlock "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/components/common/content-block/content-block.tsx"
    click ServiceData "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/data/json/serviceListData.json"
    click PricingData "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/data/json/pricingTierData.json"
    click CTAData "https://github.com/h8ngrydev4hire/themediamasons/blob/main/src/data/json/ctaData.json"
    
    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef threejs fill:#e67e22,stroke:#d35400,color:white
    classDef component fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#e74c3c,stroke:#c0392b,color:white
    classDef db fill:#9b59b6,stroke:#8e44ad,color:white
    classDef modal fill:#f1c40f,stroke:#f39c12,color:black
    classDef state fill:#1abc9c,stroke:#16a085,color:white
    classDef data fill:#95a5a6,stroke:#7f8c8d,color:white
```
