# abdulsalamamtech/laravelapp architecture

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

- Interactive diagram: https://gitdiagram.com/abdulsalamamtech/laravelapp
- Repository: https://github.com/abdulsalamamtech/laravelapp

## Overview

This is a Laravel starter application for API development, with authentication and account-security flows alongside a Filament administration panel and supporting features such as waitlists, chat messages, contacts, and billing integrations. The clearest runtime path shown is API authentication: registration and login operate on users, issue or verify OTPs, and return standardized API responses. Email changes form a separate service-led workflow that updates pending changes, verifies codes, and sends mail. The graph also preserves major tree-visible subsystems; links to unsampled routes and integrations are omitted rather than inferred.

Main entry points: [`app/Services/EmailChangeService.php`](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/EmailChangeService.php) (Email change service), [`app/Http/Controllers/V1/AuthController.php`](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/AuthController.php) (Authentication), [`app/Services/OtpTokenService.php`](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/OtpTokenService.php) (OTP service), [`app/Models/User.php`](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/User.php) (User accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and access"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_responses["API responses<br/>[ApiResponse.php]"]
  node_users[("User accounts<br/>[User.php]")]
end

subgraph group_security["Account security"]
  node_otpservice["OTP service"]
  node_otptokens[("OTP records<br/>[OtpToken.php]")]
  node_otpemail["OTP email"]
  node_emailcontroller["Email change API"]
  node_emailservice["Email change service"]
  node_pendingchanges[("Pending changes")]
  node_changemail["Change notifications"]
end

subgraph group_admin["Administration"]
  node_filament["Filament admin"]
  node_adminusers["User management<br/>[UserResource.php]"]
  node_adminroles["Role management<br/>[RoleResource.php]"]
  node_adminreports["Admin reporting<br/>[Reports.php]"]
end

subgraph group_features["Product features"]
  node_waitlists["Waitlists"]
  node_chat["Chat messages"]
  node_chatrecords[("Chat records<br/>[ChatMessage.php]")]
  node_contacts["Contact management"]
  node_contactrecords[("Contact records<br/>[Contact.php]")]
  node_billing["Billing providers"]
  node_media["Media management<br/>[MediaResource.php]"]
  node_origins["Allowed origins"]
end

node_client(("API client"))

node_client -.->|"sends requests"| node_auth
node_auth -->|"creates accounts"| node_users
node_auth -->|"issues and verifies"| node_otpservice
node_auth -->|"returns JSON"| node_responses
node_otpservice -->|"stores and verifies"| node_otptokens
node_otpservice -->|"queues 2FA mail"| node_otpemail
node_emailcontroller -->|"delegates changes"| node_emailservice
node_emailservice -->|"updates records"| node_pendingchanges
node_emailservice -->|"requests OTPs"| node_otpservice
node_emailservice -->|"queues notifications"| node_changemail
node_emailservice -->|"updates account"| node_users
node_chat -->|"creates records"| node_chatrecords
node_contacts -->|"reads and writes"| node_contactrecords

click node_auth "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/AuthController.php"
click node_responses "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Helpers/ApiResponse.php"
click node_users "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/User.php"
click node_otpservice "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/OtpTokenService.php"
click node_otptokens "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/OtpToken.php"
click node_otpemail "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Mail/TwoFactorAuthMail.php"
click node_emailcontroller "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/EmailChangeController.php"
click node_emailservice "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/EmailChangeService.php"
click node_pendingchanges "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/PendingEmailChange.php"
click node_changemail "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Mail/EmailChangeRequestMail.php"
click node_filament "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Providers/Filament/AdministratorPanelProvider.php"
click node_adminusers "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Users/UserResource.php"
click node_adminroles "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Roles/RoleResource.php"
click node_adminreports "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Pages/Reports.php"
click node_waitlists "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Quest/WaitlistController.php"
click node_chat "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Quest/ChatMessageController.php"
click node_chatrecords "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/ChatMessage.php"
click node_contacts "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Admin/AdminContactController.php"
click node_contactrecords "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/Contact.php"
click node_billing "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/Custom/FlutterwaveBillingService.php"
click node_media "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Media/MediaResource.php"
click node_origins "https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/AllowedOrigins/AllowedOriginResource.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_auth,node_responses,node_users,node_client toneBlue
class node_otpservice,node_otptokens,node_otpemail,node_emailcontroller,node_emailservice,node_pendingchanges,node_changemail toneAmber
class node_filament,node_adminusers,node_adminroles,node_adminreports toneMint
class node_waitlists,node_chat,node_chatrecords,node_contacts,node_contactrecords,node_billing,node_media,node_origins toneRose
```

## Components

### API and access

- [Authentication](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/AuthController.php): `app/Http/Controllers/V1/AuthController.php`
- [API responses](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Helpers/ApiResponse.php): `app/Helpers/ApiResponse.php`
- [User accounts](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/User.php): `app/Models/User.php`

### Account security

- [OTP service](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/OtpTokenService.php): `app/Services/OtpTokenService.php`
- [OTP records](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/OtpToken.php): `app/Models/OtpToken.php`
- [OTP email](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Mail/TwoFactorAuthMail.php): `app/Mail/TwoFactorAuthMail.php`
- [Email change API](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/EmailChangeController.php): `app/Http/Controllers/V1/EmailChangeController.php`
- [Email change service](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/EmailChangeService.php): `app/Services/EmailChangeService.php`
- [Pending changes](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/PendingEmailChange.php): `app/Models/PendingEmailChange.php`
- [Change notifications](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Mail/EmailChangeRequestMail.php): `app/Mail/EmailChangeRequestMail.php`

### Administration

- [Filament admin](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Providers/Filament/AdministratorPanelProvider.php): `app/Providers/Filament/AdministratorPanelProvider.php`
- [User management](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Users/UserResource.php): `app/Filament/Resources/Users/UserResource.php`
- [Role management](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Roles/RoleResource.php): `app/Filament/Resources/Roles/RoleResource.php`
- [Admin reporting](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Pages/Reports.php): `app/Filament/Pages/Reports.php`

### Product features

- [Waitlists](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Quest/WaitlistController.php): `app/Http/Controllers/V1/Quest/WaitlistController.php`
- [Chat messages](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Quest/ChatMessageController.php): `app/Http/Controllers/V1/Quest/ChatMessageController.php`
- [Chat records](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/ChatMessage.php): `app/Models/ChatMessage.php`
- [Contact management](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Http/Controllers/V1/Admin/AdminContactController.php): `app/Http/Controllers/V1/Admin/AdminContactController.php`
- [Contact records](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Models/Contact.php): `app/Models/Contact.php`
- [Billing providers](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Services/Custom/FlutterwaveBillingService.php): `app/Services/Custom/FlutterwaveBillingService.php`
- [Media management](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/Media/MediaResource.php): `app/Filament/Resources/Media/MediaResource.php`
- [Allowed origins](https://github.com/abdulsalamamtech/laravelapp/blob/main/app/Filament/Resources/AllowedOrigins/AllowedOriginResource.php): `app/Filament/Resources/AllowedOrigins/AllowedOriginResource.php`

### Other components

- **API client**

## Connections

- API client → Authentication: sends requests
- Authentication → User accounts: creates accounts (evidence: `app/Http/Controllers/V1/AuthController.php`)
- Authentication → OTP service: issues and verifies (evidence: `app/Http/Controllers/V1/AuthController.php`)
- Authentication → API responses: returns JSON (evidence: `app/Http/Controllers/V1/AuthController.php`)
- OTP service → OTP records: stores and verifies (evidence: `app/Services/OtpTokenService.php`)
- OTP service → OTP email: queues 2FA mail (evidence: `app/Services/OtpTokenService.php`)
- Email change API → Email change service: delegates changes (evidence: `app/Http/Controllers/V1/EmailChangeController.php`)
- Email change service → Pending changes: updates records (evidence: `app/Services/EmailChangeService.php`)
- Email change service → OTP service: requests OTPs (evidence: `app/Services/EmailChangeService.php`)
- Email change service → Change notifications: queues notifications (evidence: `app/Services/EmailChangeService.php`)
- Email change service → User accounts: updates account (evidence: `app/Services/EmailChangeService.php`)
- Chat messages → Chat records: creates records (evidence: `app/Http/Controllers/V1/Quest/ChatMessageController.php`)
- Contact management → Contact records: reads and writes (evidence: `app/Http/Controllers/V1/Admin/AdminContactController.php`)
