# golamrabbi696/clipchopper architecture

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

- Interactive diagram: https://gitdiagram.com/golamrabbi696/clipchopper
- Repository: https://github.com/golamrabbi696/clipchopper

## Overview

#### 1. Purpose and Deployment Shape
ClipChopper is a video-editing agency platform: public lead/booking acquisition, client production portal, admin operations, invoicing/payments, and support. It is a decoupled Astro frontend plus Laravel REST API, with generated frontend assets deployed under the backend public root for shared-hosting use.
- `frontend/src/pages/index.astro`
- `backend/routes/api.php`
- `backend/public/install.php`

#### 2. Entry Points and Runtimes
Astro 5 provides static/SPA pages for public, client, invoice, and admin experiences. Laravel 11 is the API and server-side workflow runtime; its HTTP entry is `public/index.php`, CLI entry is Artisan, and scheduled reminders are a console command.
- `frontend/src/pages/dashboard.astro`
- `backend/public/index.php`
- `backend/artisan`
- `backend/app/Console/Commands/SendBookingsReminders.php`

#### 3. API, Authentication, and Access Boundaries
`routes/api.php` is the main contract boundary between frontend and backend. JWT bearer authentication separates public routes from client portal routes; admin and superadmin middleware further restrict operational and platform-administration endpoints. Controllers are grouped by public, client, and admin concerns.
- `backend/routes/api.php`
- `backend/app/Http/Middleware/AdminMiddleware.php`
- `backend/app/Http/Middleware/SuperAdminMiddleware.php`

#### 4. Booking-to-Client Production Flow
Public booking submission validates input, persists bookings, and can create client accounts. Booking status changes, meeting-link assignment, completion, and due reminders publish domain events that drive notifications. Bookings, users, leads, reminders, invoices, and deliverables form the central production record set.
- `backend/app/Http/Controllers/PublicBookingController.php`
- `backend/app/Models/Booking.php`
- `backend/app/Events/BookingSubmitted.php`
- `backend/app/Listeners/SendBookingSubmittedMail.php`

#### 5. Client Portal and Operational Workflows
The client dashboard aggregates sessions, invoices, deliverables, profile data, and ticket conversations. Admin controllers manage the same production lifecycle: client accounts, bookings, deliverable uploads/feedback, invoice creation, and ticket status/replies. This is an API-driven portal rather than server-rendered Laravel UI.
- `backend/app/Http/Controllers/Client/DashboardController.php`
- `backend/app/Http/Controllers/TicketController.php`
- `backend/app/Http/Controllers/Admin/DeliverableController.php`
- `backend/app/Models/ContentDeliverable.php`

#### 6. Payments, Mail, and External Notifications
Stripe Checkout is used for public invoice payment and webhook-driven payment processing. Configurable SMTP and templates support transactional mail; events/listeners encapsulate booking lifecycle delivery. Optional webhook settings and notifier service provide Discord/Telegram-style operational notifications.
- `backend/app/Http/Controllers/StripeController.php`
- `backend/app/Services/DynamicMailerService.php`
- `backend/app/Services/WebhookNotifier.php`
- `backend/app/Models/Invoice.php`

#### 7. Persistence, Storage, and Administration
Eloquent models map a relational MySQL/MariaDB/SQLite schema, including Laravel cache/jobs tables. Public storage serves avatars and uploaded assets; private storage is reserved separately. Superadmin operations include backup/restore, cache/storage management, mail settings, and audit/email logs.
- `backend/database/migrations/0001_01_01_000002_create_jobs_table.php`
- `backend/app/Http/Controllers/Admin/BackupController.php`
- `backend/app/Http/Controllers/Admin/MailSettingController.php`
- `backend/storage/app/private/.gitignore`

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Astro frontend"]
  node_public_ui["Public booking UI<br/>Astro page<br/>[index.astro]"]
  node_portal_ui["Client and admin UI<br/>Astro pages<br/>[dashboard.astro]"]
end

subgraph group_api["Laravel API"]
  node_api_routes["REST API contract<br/>Laravel routes<br/>[api.php]"]
  node_http_runtime{{"Laravel HTTP runtime<br/>PHP entrypoint<br/>[index.php]"}}
  node_access_control["JWT and role access<br/>middleware"]
  node_installation["Shared-hosting installer<br/>PHP installer<br/>[install.php]"]
end

subgraph group_workflows["Production workflows"]
  node_booking_intake["Booking intake<br/>public controller"]
  node_client_portal["Client portal API<br/>dashboard controller"]
  node_admin_operations["Admin production operations<br/>admin controllers"]
  node_booking_events["Booking lifecycle events<br/>events and listeners"]
  node_reminder_schedule{{"Booking reminders<br/>Artisan command"}}
end

subgraph group_integrations["External delivery"]
  node_stripe_payments["Stripe payments<br/>payment controller"]
  node_mail_delivery["Transactional mail<br/>mailer service"]
  node_ops_notifications["Operational notifications<br/>webhook notifier"]
end

subgraph group_data["Data and storage"]
  node_production_records[("Production records<br/>Eloquent models<br/>[Booking.php]")]
  node_relational_db[("Relational database<br/>MySQL/MariaDB/SQLite")]
  node_asset_storage[("Upload storage<br/>public and private storage<br/>[.gitignore]")]
end

node_public_ui -->|"booking requests"| node_api_routes
node_portal_ui -->|"portal API calls"| node_api_routes
node_http_runtime -->|"serves"| node_api_routes
node_api_routes -->|"protects portal routes"| node_access_control
node_api_routes -->|"public booking"| node_booking_intake
node_api_routes -->|"client endpoints"| node_client_portal
node_api_routes -->|"admin endpoints"| node_admin_operations
node_booking_intake -->|"creates booking/client"| node_production_records
node_admin_operations -->|"manages lifecycle"| node_production_records
node_client_portal -->|"reads portal data"| node_production_records
node_production_records -->|"persists"| node_relational_db
node_booking_intake -->|"publishes"| node_booking_events
node_reminder_schedule -->|"triggers reminders"| node_booking_events
node_booking_events -->|"sends lifecycle mail"| node_mail_delivery
node_booking_events -.->|"sends optional alerts"| node_ops_notifications
node_api_routes -->|"checkout and webhooks"| node_stripe_payments
node_stripe_payments -->|"updates invoices"| node_production_records
node_admin_operations -->|"uploads deliverables"| node_asset_storage
node_installation -.->|"installs deployment"| node_http_runtime

click node_public_ui "https://github.com/golamrabbi696/clipchopper/blob/main/frontend/src/pages/index.astro"
click node_portal_ui "https://github.com/golamrabbi696/clipchopper/blob/main/frontend/src/pages/dashboard.astro"
click node_api_routes "https://github.com/golamrabbi696/clipchopper/blob/main/backend/routes/api.php"
click node_http_runtime "https://github.com/golamrabbi696/clipchopper/blob/main/backend/public/index.php"
click node_access_control "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Middleware/AdminMiddleware.php"
click node_booking_intake "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/PublicBookingController.php"
click node_client_portal "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/Client/DashboardController.php"
click node_admin_operations "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/Admin/DeliverableController.php"
click node_booking_events "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Events/BookingSubmitted.php"
click node_reminder_schedule "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Console/Commands/SendBookingsReminders.php"
click node_stripe_payments "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/StripeController.php"
click node_mail_delivery "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Services/DynamicMailerService.php"
click node_ops_notifications "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Services/WebhookNotifier.php"
click node_production_records "https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Models/Booking.php"
click node_relational_db "https://github.com/golamrabbi696/clipchopper/blob/main/backend/database/migrations/0001_01_01_000002_create_jobs_table.php"
click node_asset_storage "https://github.com/golamrabbi696/clipchopper/blob/main/backend/storage/app/private/.gitignore"
click node_installation "https://github.com/golamrabbi696/clipchopper/blob/main/backend/public/install.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_ui,node_portal_ui toneBlue
class node_api_routes,node_http_runtime,node_access_control,node_installation toneAmber
class node_booking_intake,node_client_portal,node_admin_operations,node_booking_events,node_reminder_schedule toneMint
class node_stripe_payments,node_mail_delivery,node_ops_notifications toneRose
class node_production_records,node_relational_db,node_asset_storage toneIndigo
```

## Components

### Astro frontend

- [Public booking UI](https://github.com/golamrabbi696/clipchopper/blob/main/frontend/src/pages/index.astro): Astro page · `frontend/src/pages/index.astro`
- [Client and admin UI](https://github.com/golamrabbi696/clipchopper/blob/main/frontend/src/pages/dashboard.astro): Astro pages · Static/SPA portal experiences. · `frontend/src/pages/dashboard.astro`

### Laravel API

- [REST API contract](https://github.com/golamrabbi696/clipchopper/blob/main/backend/routes/api.php): Laravel routes · Public, client, admin, and superadmin endpoints. · `backend/routes/api.php`
- [Laravel HTTP runtime](https://github.com/golamrabbi696/clipchopper/blob/main/backend/public/index.php): PHP entrypoint · `backend/public/index.php`
- [JWT and role access](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Middleware/AdminMiddleware.php): middleware · Bearer auth plus admin and superadmin boundaries. · `backend/app/Http/Middleware/AdminMiddleware.php`
- [Shared-hosting installer](https://github.com/golamrabbi696/clipchopper/blob/main/backend/public/install.php): PHP installer · Frontend assets are deployed under the backend public root. · `backend/public/install.php`

### Production workflows

- [Booking intake](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/PublicBookingController.php): public controller · Validates submissions and may create client accounts. · `backend/app/Http/Controllers/PublicBookingController.php`
- [Client portal API](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/Client/DashboardController.php): dashboard controller · Aggregates sessions, invoices, deliverables, profile, and tickets. · `backend/app/Http/Controllers/Client/DashboardController.php`
- [Admin production operations](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/Admin/DeliverableController.php): admin controllers · Manages clients, bookings, deliverables, invoices, and support. · `backend/app/Http/Controllers/Admin/DeliverableController.php`
- [Booking lifecycle events](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Events/BookingSubmitted.php): events and listeners · Status, meeting, completion, and reminder notifications. · `backend/app/Events/BookingSubmitted.php`
- [Booking reminders](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Console/Commands/SendBookingsReminders.php): Artisan command · Scheduled due-reminder workflow. · `backend/app/Console/Commands/SendBookingsReminders.php`

### External delivery

- [Stripe payments](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Http/Controllers/StripeController.php): payment controller · Checkout and webhook-driven invoice payment processing. · `backend/app/Http/Controllers/StripeController.php`
- [Transactional mail](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Services/DynamicMailerService.php): mailer service · Configurable SMTP and mail templates. · `backend/app/Services/DynamicMailerService.php`
- [Operational notifications](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Services/WebhookNotifier.php): webhook notifier · Optional Discord/Telegram-style delivery. · `backend/app/Services/WebhookNotifier.php`

### Data and storage

- [Production records](https://github.com/golamrabbi696/clipchopper/blob/main/backend/app/Models/Booking.php): Eloquent models · Bookings, users, leads, reminders, invoices, and deliverables. · `backend/app/Models/Booking.php`
- [Relational database](https://github.com/golamrabbi696/clipchopper/blob/main/backend/database/migrations/0001_01_01_000002_create_jobs_table.php): MySQL/MariaDB/SQLite · Also holds Laravel cache and jobs tables. · `backend/database/migrations/0001_01_01_000002_create_jobs_table.php`
- [Upload storage](https://github.com/golamrabbi696/clipchopper/blob/main/backend/storage/app/private/.gitignore): public and private storage · Public assets and separately reserved private files. · `backend/storage/app/private/.gitignore`

## Connections

- Public booking UI → REST API contract: booking requests
- Client and admin UI → REST API contract: portal API calls
- Laravel HTTP runtime → REST API contract: serves
- REST API contract → JWT and role access: protects portal routes
- REST API contract → Booking intake: public booking
- REST API contract → Client portal API: client endpoints
- REST API contract → Admin production operations: admin endpoints
- Booking intake → Production records: creates booking/client
- Admin production operations → Production records: manages lifecycle
- Client portal API → Production records: reads portal data
- Production records → Relational database: persists
- Booking intake → Booking lifecycle events: publishes
- Booking reminders → Booking lifecycle events: triggers reminders
- Booking lifecycle events → Transactional mail: sends lifecycle mail
- Booking lifecycle events → Operational notifications: sends optional alerts
- REST API contract → Stripe payments: checkout and webhooks
- Stripe payments → Production records: updates invoices
- Admin production operations → Upload storage: uploads deliverables
- Shared-hosting installer → Laravel HTTP runtime: installs deployment
