# robabyteninja/construction-landingpage architecture

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

- Interactive diagram: https://gitdiagram.com/robabyteninja/construction-landingpage
- Repository: https://github.com/robabyteninja/construction-landingpage

## Overview

##### Project type and purpose
- This is a full-stack website (“BuildMaster Construction Company Website”) with:
- A React.js single-page frontend for company showcase, responsive UI, and contact form
- A Node.js/Express.js backend API to receive form submissions and send emails via Gmail
- Purpose: Display company info (services, projects, testimonials), integrate Google Maps, and handle contact inquiries.

##### File structure
- Top level
- client/ — React frontend
- server/ — Node/Express backend
- client/
- public/ — static assets (HTML shell, images, manifest)
- src/ — React components (Header, Hero, About, Services, Projects, ProjectModal, Testimonials, Contact, Footer), root App.js, data.js
- server/
- controllers/ — contactController.js (handles POST logic)
- routes/ — contactRoutes.js (defines /api/contact)
- middleware/ — validation.js (Express Validator rules)
- server.js — entry point (app setup, route mounting)
- .env — environment variables for port, email credentials, client URL
- Config/build files: package.json at root/client/server, npm scripts (e.g., “dev” to run client+server concurrently)

##### README for additional insights
- Tech stack clearly split between frontend (React, Bootstrap) and backend (Express, Nodemailer, Express Validator)
- Single API endpoint: POST /api/contact
- Deployment notes: Frontend on Netlify/Vercel, backend on Heroku/Railway
- No database—email notifications are the only “stateful” operation.

##### Elements
- Blue rectangles for UI components
- Green rectangles for server modules
- Yellow ovals/clouds for external services

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Device
    User["User's Browser / Mobile Device"]:::external

    %% Frontend Layer
    subgraph "Frontend (React SPA)"
        direction TB
        IDX["Index.js"]:::frontend
        APP["App.js"]:::frontend
        DATA["data.js"]:::frontend
        CMPS["UI Components"]:::frontend
        subgraph "Components Directory"
            direction TB
            HDR["Header.js"]:::frontend
            HERO["Hero.js"]:::frontend
            ABOUT["About.js"]:::frontend
            SRV["Services.js"]:::frontend
            PRJ["Projects.js"]:::frontend
            PMOD["ProjectModal.js"]:::frontend
            TESTI["Testimonials.js"]:::frontend
            CONTACT["Contact.js"]:::frontend
            FTR["Footer.js"]:::frontend
        end
        STYLES["index.css"]:::frontend
        PUBLIC["public/ (Static Assets)"]:::frontend
    end

    %% External Frontend Dependencies
    GMAPS["Google Maps API"]:::external

    %% Backend Layer
    subgraph "Backend (Express API)"
        direction TB
        ENV[".env"]:::backend
        SRVRS["server.js"]:::backend
        ROUTES["contactRoutes.js"]:::backend
        MIDDLE["validation.js"]:::backend
        CTRL["contactController.js"]:::backend
    end

    %% External Backend Dependencies
    SMTP["Gmail SMTP (via Nodemailer)"]:::external

    %% Hosting / Deployment
    subgraph "Hosting"
        direction TB
        FEHOST["Netlify / Vercel"]:::external
        BEHOST["Heroku / Railway"]:::external
    end

    %% Connections
    User -->|"loads index.html & bundles"| PUBLIC
    PUBLIC --> IDX
    IDX --> APP
    APP --> DATA
    APP --> CMPS
    CMPS --> HDR
    CMPS --> HERO
    CMPS --> ABOUT
    CMPS --> SRV
    CMPS --> PRJ
    CMPS --> PMOD
    CMPS --> TESTI
    CMPS --> CONTACT
    CMPS --> FTR
    IDX --> STYLES
    APP -->|"embeds tiles & data"| GMAPS

    CONTACT -->|"onSubmit POST /api/contact"| SRVRS
    SRVRS --> ROUTES
    ROUTES --> MIDDLE
    MIDDLE --> CTRL
    CTRL -->|"send email via SMTP"| SMTP
    CTRL --> SRVRS

    %% Hosting Connections
    PUBLIC -.-> FEHOST
    SRVRS -.-> BEHOST

    %% Click Events
    click IDX "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/index.js"
    click APP "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/App.js"
    click DATA "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/data.js"
    click CMPS "https://github.com/robabyteninja/construction-landingpage/tree/master/client/src/components/"
    click HDR "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Header.js"
    click HERO "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Hero.js"
    click ABOUT "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/About.js"
    click SRV "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Services.js"
    click PRJ "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Projects.js"
    click PMOD "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/ProjectModal.js"
    click TESTI "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Testimonials.js"
    click CONTACT "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Contact.js"
    click FTR "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/components/Footer.js"
    click STYLES "https://github.com/robabyteninja/construction-landingpage/blob/master/client/src/index.css"
    click PUBLIC "https://github.com/robabyteninja/construction-landingpage/tree/master/client/public/"
    click SRVRS "https://github.com/robabyteninja/construction-landingpage/blob/master/server/server.js"
    click ROUTES "https://github.com/robabyteninja/construction-landingpage/blob/master/server/routes/contactRoutes.js"
    click MIDDLE "https://github.com/robabyteninja/construction-landingpage/blob/master/server/middleware/validation.js"
    click CTRL "https://github.com/robabyteninja/construction-landingpage/blob/master/server/controllers/contactController.js"
    click ENV "https://github.com/robabyteninja/construction-landingpage/blob/master/server/.env"
    click FEHOST "https://github.com/robabyteninja/construction-landingpage/blob/master/client/package.json"
    click BEHOST "https://github.com/robabyteninja/construction-landingpage/blob/master/server/package.json"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#0366d6,stroke-width:1px;
    classDef backend fill:#DFF2BF,stroke:#4F8A10,stroke-width:1px;
    classDef external fill:#FFF2CC,stroke:#BF8F00,stroke-width:1px;
```
