# rohitha97/santharpana-spa-react-app architecture

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

- Interactive diagram: https://gitdiagram.com/rohitha97/santharpana-spa-react-app
- Repository: https://github.com/rohitha97/santharpana-spa-react-app

## Overview

##### Main Architecture Overview

A. Frontend Architecture (Primary Focus)

##### Client Layer (Top)
- To the React Application layer

##### React Application Layer (Core)
Divide this into three main sections:

a. Pages (Route Components)
- Page component (HomePage, AboutPage, ServicesPage, etc.)

b. Shared Components
- Layout components (NavBar, Footer, PageHeader)
- Reusable UI components (ProgressBar, ScrollButton)

c. Feature Components
- By feature area (About, Services, Contact, HomePage)
- Relationship to their respective pages

##### Data Layer
- DataModel interfaces (GalleryModel, HeaderProps, ServicesModel)
- How data flows between components and models

##### External Services
- EmailJS integration for contact form
- Any API endpoints for appointment booking

##### Component Relationships

- Parent-child component relationships
- Data flow between components
- Service interactions

- Blue: Page components
- Green: Shared/Layout components
- Orange: Feature-specific components
- Yellow: Data models
- Purple: External services

##### Specific Implementation Details

Key architectural elements:
**┌─ Client Layer**
- Web Browser

- React Application (SPA)
- Routing Layer
- [List all pages from src/Page]

- Component Layer
- Layouts
- [NavBar, Footer, PageHeader, etc.]

- Feature Components
- About
- Contact
- HomePage
- Services

- Shared Components

- Data Layer
- [GalleryModel, HeaderProps, ServicesModel]

- External Services
- EmailJS

##### Notes for Implementation

Notes regarding:
- React + TypeScript implementation
- Vite as build tool
- Bootstrap for styling
- Responsive design implementation
- Route structure and navigation flow

Remember to indicate that this is a client-side application with external service integration (EmailJS) rather than a full-stack application with a custom backend.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph ReactApp["React Application (SPA)"]
        subgraph Pages["Pages Layer"]
            HomePage["HomePage"]:::page
            AboutPage["AboutPage"]:::page
            ServicesPage["ServicesPage"]:::page
            ContactPage["ContactPage"]:::page
            AppointmentPage["AppointmentPage"]:::page
        end

        subgraph SharedComponents["Shared Components"]
            NavBar["NavBar"]:::layout
            Footer["Footer"]:::layout
            PageHeader["PageHeader"]:::layout
            ProgressBar["ProgressBar"]:::layout
            ScrollButton["ScrollButton"]:::layout
        end

        subgraph FeatureComponents["Feature Components"]
            subgraph AboutFeature["About Feature"]
                AboutDescription["AboutDescription"]:::feature
                Gallery["Gallery"]:::feature
            end

            subgraph ContactFeature["Contact Feature"]
                ContactCards["ContactCards"]:::feature
                ContactForm["ContactForm"]:::feature
            end

            subgraph HomeFeature["Home Feature"]
                Header["Header"]:::feature
                Appointment["Appointment"]:::feature
                Pricing["Pricing"]:::feature
            end

            subgraph ServicesFeature["Services Feature"]
                ServicesComponent["ServicesComponent"]:::feature
                Description["Description"]:::feature
                AppointmentBanner["AppointmentBanner"]:::feature
            end
        end

        subgraph DataLayer["Data Layer"]
            GalleryModel["Gallery Model"]:::data
            HeaderProps["Header Props"]:::data
            ServicesModel["Services Model"]:::data
        end
    end

    subgraph ExternalServices["External Services"]
        EmailJS["EmailJS Service"]:::external
    end

    subgraph StaticAssets["Static Assets"]
        Images["Images"]:::asset
        BgImages["Background Images"]:::asset
        GalleryImages["Gallery Images"]:::asset
        ServiceImages["Service Images"]:::asset
        AboutImages["About Images"]:::asset
    end

    %% Relationships
    Browser --> HomePage
    HomePage --> HomeFeature
    AboutPage --> AboutFeature
    ServicesPage --> ServicesFeature
    ContactPage --> ContactFeature
    AppointmentPage --> AppointmentBanner

    ContactForm --> EmailJS
    Gallery --> GalleryModel
    Header --> HeaderProps
    ServicesComponent --> ServicesModel

    %% Click Events
    click HomePage "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/Page/HomePage.tsx"
    click AboutPage "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/Page/AboutPage.tsx"
    click ServicesPage "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/Page/ServicesPage.tsx"
    click ContactPage "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/Page/ContactPage.tsx"
    click AppointmentPage "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/Page/AppoinmentPage.tsx"
    
    click NavBar "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Layouts/NavBar.tsx"
    click Footer "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Layouts/Footer.tsx"
    click PageHeader "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Layouts/PageHeader.tsx"
    click ProgressBar "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Layouts/ProgressBar.tsx"
    click ScrollButton "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Layouts/ScrollButton.tsx"
    
    click AboutDescription "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/About/AboutDescriptionComponents.tsx"
    click Gallery "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/About/GalleryComponents.tsx"
    click ContactCards "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Contact/ContactCards.tsx"
    click ContactForm "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Contact/ContactForm.tsx"
    click Header "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/HomePage/HeaderComponents.tsx"
    click Appointment "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/HomePage/AppoinmentComponents.tsx"
    click Pricing "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/HomePage/PricingComponents.tsx"
    click ServicesComponent "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Services/ServicesComponents.tsx"
    click Description "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Services/Description.tsx"
    click AppointmentBanner "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/components/Services/GetAppoinmentBanner.tsx"
    
    click GalleryModel "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/DataModel/GalleryModel.ts"
    click HeaderProps "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/DataModel/HeaderProps.ts"
    click ServicesModel "https://github.com/Rohitha97/santharpana-spa-react-app/blob/master/src/DataModel/ServicesModel.ts"
    
    click Images "https://github.com/Rohitha97/santharpana-spa-react-app/tree/master/public/images/"
    click BgImages "https://github.com/Rohitha97/santharpana-spa-react-app/tree/master/public/images/bg/"
    click GalleryImages "https://github.com/Rohitha97/santharpana-spa-react-app/tree/master/public/images/gallery/"
    click ServiceImages "https://github.com/Rohitha97/santharpana-spa-react-app/tree/master/public/images/service/"
    click AboutImages "https://github.com/Rohitha97/santharpana-spa-react-app/tree/master/public/images/about/"

    %% Styles
    classDef page fill:#3498db,stroke:#2980b9,color:white
    classDef layout fill:#2ecc71,stroke:#27ae60,color:white
    classDef feature fill:#e67e22,stroke:#d35400,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef asset fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Page Component"]:::page
        L2["Layout Component"]:::layout
        L3["Feature Component"]:::feature
        L4["Data Model"]:::data
        L5["External Service"]:::external
        L6["Static Asset"]:::asset
    end
```
