# realhamedahmadi/dentist architecture

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

- Interactive diagram: https://gitdiagram.com/realhamedahmadi/dentist
- Repository: https://github.com/realhamedahmadi/dentist

## Overview

This is a Laravel modular multi-tenant application with a React/TypeScript frontend platform. The backend’s principal identity workflow discovers login options for an identifier, optionally requests a verification code, then authenticates or registers a user and issues a token. Separate modules provide user/admin management, verification, service/order domain models, and settings; the frontend core contains plugin, routing, messaging, and interaction infrastructure. Evidence is limited to the supplied source excerpts and index: several routes and subsystem implementations were not sampled, so their connections are omitted or marked unverified.

Main entry points: [`Modules/Verification/app/Services/VerificationService.php`](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Services/VerificationService.php) (Verification Service), [`Modules/User/app/Models/User.php`](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/User/app/Models/User.php) (User Accounts), [`Modules/Auth/app/Services/AuthDiscoveryService.php`](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Services/AuthDiscoveryService.php) (Auth Discovery), [`Modules/Auth/app/Traits/AuthServiceTrait.php`](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Traits/AuthServiceTrait.php) (Login and Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Access"]
  node_auth_routes["Auth API Routes<br/>[api.php]"]
  node_auth_controller["Auth Controller<br/>[AuthController.php]"]
  node_discovery["Auth Discovery"]
  node_login_flow["Login and Registration"]
  node_verification_api["OTP API<br/>[OtpController.php]"]
  node_verification["Verification Service"]
  node_verification_codes[("Verification Codes")]
  node_tokens["Token Providers"]
end

subgraph group_accounts["Users and Administration"]
  node_users[("User Accounts<br/>[User.php]")]
  node_user_services["Account Management"]
  node_admin_api["Admin APIs"]
end

subgraph group_platform["Core Platform Services"]
  node_find_user["Identifier Lookup"]
  node_identifier["Identifier Utilities<br/>[Identifier.php]"]
  node_tenant_context["Tenant Resolution"]
end

subgraph group_business["Business Modules"]
  node_service_domain[("Services and Orders")]
  node_settings[("Application Settings")]
end

subgraph group_frontend["Frontend Runtime"]
  node_frontend_apps["Admin and Client Apps<br/>[App.tsx]"]
  node_plugin_runtime["Plugin Runtime<br/>[PluginRuntime.ts]"]
  node_frontend_routing["Frontend Routing<br/>[Router.ts]"]
  node_messaging["Message and Event Buses<br/>[MessageBus.ts]"]
  node_hotkeys["Hotkey Sequence Engine"]
  node_hotkey_registry["Hotkey Registry<br/>[HotkeyRegistry.ts]"]
end

node_client(("API Client"))

node_client -.->|"calls API"| node_auth_routes
node_auth_routes -.->|"routes requests"| node_auth_controller
node_auth_controller -.->|"runs discovery"| node_discovery
node_auth_controller -.->|"runs login"| node_login_flow
node_discovery -->|"looks up identifier"| node_find_user
node_discovery -->|"requests code"| node_verification
node_discovery -->|"checks account"| node_users
node_login_flow -->|"verifies code"| node_verification
node_login_flow -->|"registers user"| node_users
node_login_flow -->|"issues token"| node_tokens
node_client -.->|"submits OTP"| node_verification_api
node_verification_api -->|"delegates verification"| node_verification
node_verification -->|"resolves account"| node_find_user
node_verification -->|"reads and issues codes"| node_verification_codes
node_find_user -->|"detects identifier"| node_identifier
node_find_user -->|"returns matched user"| node_users
node_admin_api -->|"delegates admin work"| node_user_services
node_admin_api -->|"uses account model"| node_users
node_hotkeys -->|"matches sequence"| node_hotkey_registry
node_hotkeys -->|"emits hotkey events"| node_messaging
node_frontend_apps -.->|"loads plugins"| node_plugin_runtime
node_frontend_apps -.->|"uses routing"| node_frontend_routing
node_tenant_context -.->|"scopes tenant data"| node_users

click node_auth_routes "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/routes/api.php"
click node_auth_controller "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Http/Controllers/Api/V1/AuthController.php"
click node_discovery "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Services/AuthDiscoveryService.php"
click node_login_flow "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Traits/AuthServiceTrait.php"
click node_verification_api "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Http/Controllers/Api/V1/OtpController.php"
click node_verification "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Services/VerificationService.php"
click node_verification_codes "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Models/VerificationCode.php"
click node_tokens "https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Auth/app/Services/Providers"
click node_users "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/User/app/Models/User.php"
click node_find_user "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Core/app/Services/User/FindUserService.php"
click node_identifier "https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Core/app/Helpers/Identifier.php"
click node_user_services "https://github.com/realhamedahmadi/dentist/tree/AI/Modules/User/app/Services"
click node_admin_api "https://github.com/realhamedahmadi/dentist/tree/AI/Modules/User/app/Http/Controllers/Api/V1/Admin"
click node_tenant_context "https://github.com/realhamedahmadi/dentist/tree/AI/app/Multitenancy/Finders"
click node_service_domain "https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Service/app/Models"
click node_settings "https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Setting/app/Models"
click node_frontend_apps "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/admin/App.tsx"
click node_plugin_runtime "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/plugin/PluginRuntime.ts"
click node_frontend_routing "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/router/Router.ts"
click node_messaging "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/messaging/MessageBus.ts"
click node_hotkeys "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/hotkey/HotkeySequenceEngine.ts"
click node_hotkey_registry "https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/hotkey/HotkeyRegistry.ts"

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_routes,node_auth_controller,node_discovery,node_login_flow,node_verification_api,node_verification,node_verification_codes,node_tokens,node_client toneBlue
class node_users,node_user_services,node_admin_api toneAmber
class node_find_user,node_identifier,node_tenant_context toneMint
class node_service_domain,node_settings toneRose
class node_frontend_apps,node_plugin_runtime,node_frontend_routing,node_messaging,node_hotkeys,node_hotkey_registry toneIndigo
```

## Components

### Identity and Access

- [Auth API Routes](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/routes/api.php): `Modules/Auth/routes/api.php`
- [Auth Controller](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Http/Controllers/Api/V1/AuthController.php): `Modules/Auth/app/Http/Controllers/Api/V1/AuthController.php`
- [Auth Discovery](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Services/AuthDiscoveryService.php): `Modules/Auth/app/Services/AuthDiscoveryService.php`
- [Login and Registration](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Auth/app/Traits/AuthServiceTrait.php): `Modules/Auth/app/Traits/AuthServiceTrait.php`
- [OTP API](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Http/Controllers/Api/V1/OtpController.php): `Modules/Verification/app/Http/Controllers/Api/V1/OtpController.php`
- [Verification Service](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Services/VerificationService.php): `Modules/Verification/app/Services/VerificationService.php`
- [Verification Codes](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Verification/app/Models/VerificationCode.php): `Modules/Verification/app/Models/VerificationCode.php`
- [Token Providers](https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Auth/app/Services/Providers): `Modules/Auth/app/Services/Providers`

### Users and Administration

- [User Accounts](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/User/app/Models/User.php): `Modules/User/app/Models/User.php`
- [Account Management](https://github.com/realhamedahmadi/dentist/tree/AI/Modules/User/app/Services): `Modules/User/app/Services`
- [Admin APIs](https://github.com/realhamedahmadi/dentist/tree/AI/Modules/User/app/Http/Controllers/Api/V1/Admin): `Modules/User/app/Http/Controllers/Api/V1/Admin`

### Core Platform Services

- [Identifier Lookup](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Core/app/Services/User/FindUserService.php): `Modules/Core/app/Services/User/FindUserService.php`
- [Identifier Utilities](https://github.com/realhamedahmadi/dentist/blob/AI/Modules/Core/app/Helpers/Identifier.php): `Modules/Core/app/Helpers/Identifier.php`
- [Tenant Resolution](https://github.com/realhamedahmadi/dentist/tree/AI/app/Multitenancy/Finders): `app/Multitenancy/Finders`

### Business Modules

- [Services and Orders](https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Service/app/Models): `Modules/Service/app/Models`
- [Application Settings](https://github.com/realhamedahmadi/dentist/tree/AI/Modules/Setting/app/Models): `Modules/Setting/app/Models`

### Frontend Runtime

- [Admin and Client Apps](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/admin/App.tsx): `resources/js/admin/App.tsx`
- [Plugin Runtime](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/plugin/PluginRuntime.ts): `resources/js/core/platform/plugin/PluginRuntime.ts`
- [Frontend Routing](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/router/Router.ts): `resources/js/core/platform/router/Router.ts`
- [Message and Event Buses](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/messaging/MessageBus.ts): `resources/js/core/platform/messaging/MessageBus.ts`
- [Hotkey Sequence Engine](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/hotkey/HotkeySequenceEngine.ts): `resources/js/core/platform/hotkey/HotkeySequenceEngine.ts`
- [Hotkey Registry](https://github.com/realhamedahmadi/dentist/blob/AI/resources/js/core/platform/hotkey/HotkeyRegistry.ts): `resources/js/core/platform/hotkey/HotkeyRegistry.ts`

### Other components

- **API Client**

## Connections

- API Client → Auth API Routes: calls API
- Auth API Routes → Auth Controller: routes requests
- Auth Controller → Auth Discovery: runs discovery
- Auth Controller → Login and Registration: runs login
- Auth Discovery → Identifier Lookup: looks up identifier (evidence: `Modules/Auth/app/Services/AuthDiscoveryService.php`)
- Auth Discovery → Verification Service: requests code (evidence: `Modules/Auth/app/Services/AuthDiscoveryService.php`)
- Auth Discovery → User Accounts: checks account (evidence: `Modules/Auth/app/Services/AuthDiscoveryService.php`)
- Login and Registration → Verification Service: verifies code (evidence: `Modules/Auth/app/Traits/AuthServiceTrait.php`)
- Login and Registration → User Accounts: registers user (evidence: `Modules/Auth/app/Traits/AuthServiceTrait.php`)
- Login and Registration → Token Providers: issues token (evidence: `Modules/Auth/app/Traits/AuthServiceTrait.php`)
- API Client → OTP API: submits OTP
- OTP API → Verification Service: delegates verification (evidence: `Modules/Verification/app/Http/Controllers/Api/V1/OtpController.php`)
- Verification Service → Identifier Lookup: resolves account (evidence: `Modules/Verification/app/Services/VerificationService.php`)
- Verification Service → Verification Codes: reads and issues codes (evidence: `Modules/Verification/app/Services/VerificationService.php`)
- Identifier Lookup → Identifier Utilities: detects identifier (evidence: `Modules/Core/app/Services/User/FindUserService.php`)
- Identifier Lookup → User Accounts: returns matched user (evidence: `Modules/Core/app/Services/User/FindUserService.php`)
- Admin APIs → Account Management: delegates admin work (evidence: `Modules/User/app/Http/Controllers/Api/V1/Admin/AdminController.php`)
- Admin APIs → User Accounts: uses account model (evidence: `Modules/User/app/Http/Controllers/Api/V1/Admin/AdminController.php`)
- Hotkey Sequence Engine → Hotkey Registry: matches sequence (evidence: `resources/js/core/platform/hotkey/HotkeySequenceEngine.ts`)
- Hotkey Sequence Engine → Message and Event Buses: emits hotkey events (evidence: `resources/js/core/platform/hotkey/HotkeySequenceEngine.ts`)
- Admin and Client Apps → Plugin Runtime: loads plugins
- Admin and Client Apps → Frontend Routing: uses routing
- Tenant Resolution → User Accounts: scopes tenant data
