# hasolutions401/ra-brothers-roofing-2 architecture

> Architecture diagram of the GitHub repository hasolutions401/ra-brothers-roofing-2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hasolutions401/ra-brothers-roofing-2
- Repository: https://github.com/hasolutions401/ra-brothers-roofing-2

## Overview

RA Brothers Roofing is a public roofing-services website with estimate-request forms and a staff leads dashboard. Visitors explore service and town information, submit a quick or detailed estimate request, and can receive confirmation after the API stores it; staff sign in to review, update, and export leads. The graph includes documented but unsampled capabilities such as photo uploads and dashboard filtering. Source excerpts establish several internal calls; README statements support the broader site/API connections, while unsampled implementation details are not inferred.

Main entry points: [`src/app/(site)/page.tsx`](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/app/(site)/page.tsx) (Public Pages), [`backend/routes/api.php`](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/routes/api.php) (API Routes), [`backend/app/Http/Controllers/SubmissionController.php`](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/SubmissionController.php) (Submission Intake), [`backend/app/Models/Submission.php`](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Models/Submission.php) (Submission Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Website"]
  node_public_pages["Public Pages<br/>[page.tsx]"]
  node_estimate_page["Estimate Page<br/>[page.tsx]"]
end

subgraph group_content["Site Content"]
  node_service_catalog["Service Catalog<br/>[services.ts]"]
  node_town_content["Town Content<br/>[areas.ts]"]
  node_site_content["Business Content<br/>[site.ts]"]
  node_seo["SEO Metadata<br/>[seo.ts]"]
end

subgraph group_leads["Lead Intake"]
  node_estimate_form["Estimate Form<br/>[estimate-form.tsx]"]
  node_quick_form["Quick Form<br/>[quick-form.tsx]"]
  node_api_client["Submission Client<br/>[api.ts]"]
end

subgraph group_admin["Admin Dashboard"]
  node_admin_ui["Admin Dashboard<br/>[dashboard.tsx]"]
  node_admin_auth["Admin Sign-in<br/>[admin-auth.tsx]"]
  node_admin_client["Admin API Client<br/>[admin-api.ts]"]
end

subgraph group_backend["Laravel API"]
  node_api_routes["API Routes<br/>[api.php]"]
  node_submission_api["Submission Intake"]
  node_admin_submissions["Lead Management"]
  node_stats_api["Lead Statistics"]
  node_submission_model["Submission Model<br/>[Submission.php]"]
  node_photo_store["Photo Storage<br/>[PhotoStore.php]"]
  node_notifications["Email Notifications<br/>[NewSubmission.php]"]
  node_submission_db[("Lead Database<br/>[Submission.php]")]
end

node_visitor(("Visitor"))
node_staff(("Staff"))
node_mail_service["Mail Service"]
node_photo_files[("Photo Files")]

node_visitor -->|"browses"| node_public_pages
node_public_pages -->|"uses service data"| node_service_catalog
node_public_pages -->|"uses town data"| node_town_content
node_public_pages -->|"uses business details"| node_site_content
node_estimate_page -.->|"renders"| node_estimate_form
node_public_pages -->|"renders"| node_quick_form
node_estimate_form -.->|"submits request"| node_api_client
node_quick_form -.->|"submits request"| node_api_client
node_api_client -->|"sends forms"| node_api_routes
node_staff -->|"signs in"| node_admin_auth
node_staff -->|"manages leads"| node_admin_ui
node_admin_ui -.->|"requests lead data"| node_admin_client
node_admin_auth -->|"uses client"| node_admin_client
node_admin_client -.->|"calls admin API"| node_api_routes
node_api_routes -->|"routes intake"| node_submission_api
node_api_routes -->|"routes lead actions"| node_admin_submissions
node_api_routes -->|"routes statistics"| node_stats_api
node_submission_api -->|"creates submission"| node_submission_model
node_submission_api -->|"stores photos"| node_photo_store
node_submission_api -->|"dispatches email"| node_notifications
node_admin_submissions -->|"queries and updates"| node_submission_model
node_stats_api -->|"counts leads"| node_submission_model
node_submission_model -.->|"persists lead"| node_submission_db
node_photo_store -.->|"writes files"| node_photo_files
node_notifications -.->|"sends mail"| node_mail_service

click node_public_pages "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/app/(site)/page.tsx"
click node_service_catalog "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/services.ts"
click node_town_content "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/areas.ts"
click node_site_content "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/site.ts"
click node_seo "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/seo.ts"
click node_estimate_page "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/app/(site)/free-estimate/page.tsx"
click node_estimate_form "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/estimate-form.tsx"
click node_quick_form "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/quick-form.tsx"
click node_api_client "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/api.ts"
click node_admin_ui "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/admin/dashboard.tsx"
click node_admin_auth "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/admin/admin-auth.tsx"
click node_admin_client "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/admin-api.ts"
click node_api_routes "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/routes/api.php"
click node_submission_api "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/SubmissionController.php"
click node_admin_submissions "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/Admin/SubmissionController.php"
click node_stats_api "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/Admin/StatsController.php"
click node_submission_model "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Models/Submission.php"
click node_photo_store "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Support/PhotoStore.php"
click node_notifications "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Notifications/NewSubmission.php"
click node_submission_db "https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Models/Submission.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_pages,node_estimate_page toneBlue
class node_service_catalog,node_town_content,node_site_content,node_seo,node_photo_files toneAmber
class node_estimate_form,node_quick_form,node_api_client toneMint
class node_admin_ui,node_admin_auth,node_admin_client toneRose
class node_api_routes,node_submission_api,node_admin_submissions,node_stats_api,node_submission_model,node_photo_store,node_notifications,node_submission_db,node_visitor,node_staff,node_mail_service toneIndigo
```

## Components

### Public Website

- [Public Pages](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/app/(site)/page.tsx): `src/app/(site)/page.tsx`
- [Estimate Page](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/app/(site)/free-estimate/page.tsx): `src/app/(site)/free-estimate/page.tsx`

### Site Content

- [Service Catalog](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/services.ts): `src/lib/services.ts`
- [Town Content](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/areas.ts): `src/lib/areas.ts`
- [Business Content](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/site.ts): `src/lib/site.ts`
- [SEO Metadata](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/seo.ts): `src/lib/seo.ts`

### Lead Intake

- [Estimate Form](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/estimate-form.tsx): `src/components/estimate-form.tsx`
- [Quick Form](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/quick-form.tsx): `src/components/quick-form.tsx`
- [Submission Client](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/api.ts): `src/lib/api.ts`

### Admin Dashboard

- [Admin Dashboard](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/admin/dashboard.tsx): `src/components/admin/dashboard.tsx`
- [Admin Sign-in](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/components/admin/admin-auth.tsx): `src/components/admin/admin-auth.tsx`
- [Admin API Client](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/src/lib/admin-api.ts): `src/lib/admin-api.ts`

### Laravel API

- [API Routes](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Submission Intake](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/SubmissionController.php): `backend/app/Http/Controllers/SubmissionController.php`
- [Lead Management](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/Admin/SubmissionController.php): `backend/app/Http/Controllers/Admin/SubmissionController.php`
- [Lead Statistics](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Http/Controllers/Admin/StatsController.php): `backend/app/Http/Controllers/Admin/StatsController.php`
- [Submission Model](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Models/Submission.php): `backend/app/Models/Submission.php`
- [Photo Storage](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Support/PhotoStore.php): `backend/app/Support/PhotoStore.php`
- [Email Notifications](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Notifications/NewSubmission.php): `backend/app/Notifications/NewSubmission.php`
- [Lead Database](https://github.com/hasolutions401/ra-brothers-roofing-2/blob/main/backend/app/Models/Submission.php): `backend/app/Models/Submission.php`

### Other components

- **Visitor**
- **Staff**
- **Mail Service**
- **Photo Files**

## Connections

- Visitor → Public Pages: browses (evidence: `README.md`)
- Public Pages → Service Catalog: uses service data (evidence: `src/app/(site)/page.tsx`)
- Public Pages → Town Content: uses town data (evidence: `src/app/(site)/page.tsx`)
- Public Pages → Business Content: uses business details (evidence: `src/app/(site)/page.tsx`)
- Estimate Page → Estimate Form: renders
- Public Pages → Quick Form: renders (evidence: `src/app/(site)/page.tsx`)
- Estimate Form → Submission Client: submits request
- Quick Form → Submission Client: submits request
- Submission Client → API Routes: sends forms (evidence: `README.md`)
- Staff → Admin Sign-in: signs in (evidence: `README.md`)
- Staff → Admin Dashboard: manages leads (evidence: `README.md`)
- Admin Dashboard → Admin API Client: requests lead data
- Admin Sign-in → Admin API Client: uses client (evidence: `src/components/admin/admin-auth.tsx`)
- Admin API Client → API Routes: calls admin API
- API Routes → Submission Intake: routes intake (evidence: `backend/routes/api.php`)
- API Routes → Lead Management: routes lead actions (evidence: `backend/routes/api.php`)
- API Routes → Lead Statistics: routes statistics (evidence: `backend/routes/api.php`)
- Submission Intake → Submission Model: creates submission (evidence: `backend/app/Http/Controllers/SubmissionController.php`)
- Submission Intake → Photo Storage: stores photos (evidence: `backend/app/Http/Controllers/SubmissionController.php`)
- Submission Intake → Email Notifications: dispatches email (evidence: `backend/app/Http/Controllers/SubmissionController.php`)
- Lead Management → Submission Model: queries and updates (evidence: `backend/app/Http/Controllers/Admin/SubmissionController.php`)
- Lead Statistics → Submission Model: counts leads (evidence: `backend/app/Http/Controllers/Admin/StatsController.php`)
- Submission Model → Lead Database: persists lead (evidence: `backend/app/Models/Submission.php`)
- Photo Storage → Photo Files: writes files
- Email Notifications → Mail Service: sends mail
