# desinomeme24/nexgen-capstone architecture

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

- Interactive diagram: https://gitdiagram.com/desinomeme24/nexgen-capstone
- Repository: https://github.com/desinomeme24/nexgen-capstone

## Overview

NexGen is a PHP/MySQL business-management application. Its main user workflow is to sign in, work within an assigned business or branch, and use operational modules for inventory, sales, receivables, and analytics; administrators manage users and workspace requests. Shared configuration and tenant helpers support these workflows, while the chatbot provides a separate assistant capability. The README documents the product areas, but many handlers and integrations were not sampled, so their internal links are left out rather than inferred.

Main entry points: [`CODE/PHP/inventory_management.php`](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/inventory_management.php) (Inventory management), [`CODE/PHP/accounts_receivable.php`](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/accounts_receivable.php) (Accounts receivable), [`CODE/PHP/config.php`](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/config.php) (Application configuration), [`CODE/PHP/tenant_helper.php`](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/tenant_helper.php) (Workspace context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and workspace"]
  node_landing["Landing and sign-in<br/>[index.php]"]
  node_auth["Authentication handlers<br/>[login_process.php]"]
  node_signup["Registration<br/>[signup_process.php]"]
  node_workspace["Workspace context<br/>[tenant_helper.php]"]
end

subgraph group_operations["Business operations"]
  node_inventory["Inventory management"]
  node_inventory_handlers["Inventory handlers"]
  node_sales["Sales recording"]
  node_sales_handlers["Sale processing<br/>[process_sale.php]"]
  node_receivables["Accounts receivable"]
end

subgraph group_insights["Insights and assistance"]
  node_dashboard["Business dashboard<br/>[dashboard.php]"]
  node_analytics["Sales analytics"]
  node_chat_endpoint["Chatbot endpoint<br/>[chatbot.php]"]
  node_chat_runtime["Chatbot routing and tools"]
end

subgraph group_administration["Administration"]
  node_admin_login["Admin login<br/>[admin_login.php]"]
  node_admin_dashboard["Admin dashboard"]
  node_user_admin["User management<br/>[manage_users.php]"]
  node_request_admin["Workspace requests"]
  node_request_review["Request review"]
end

subgraph group_foundation["Shared foundation"]
  node_receivable_helpers["Receivable helpers<br/>[ar_helper.php]"]
  node_config["Application configuration<br/>[config.php]"]
  node_header["Shared user interface<br/>[header.php]"]
end

node_user(("Business user"))
node_admin(("System administrator"))
node_database[("MySQL database")]

node_user -->|"opens"| node_landing
node_landing -.->|"authenticates"| node_auth
node_user -.->|"registers"| node_signup
node_user -.->|"selects workspace"| node_workspace
node_workspace -->|"provides context"| node_inventory
node_workspace -->|"provides context"| node_receivables
node_user -->|"views"| node_dashboard
node_user -->|"manages stock"| node_inventory
node_inventory -.->|"supports operations"| node_inventory_handlers
node_user -->|"records sales"| node_sales
node_sales -.->|"processes sale"| node_sales_handlers
node_user -->|"tracks balances"| node_receivables
node_receivables -->|"uses helpers"| node_receivable_helpers
node_user -->|"reviews analytics"| node_analytics
node_user -.->|"asks questions"| node_chat_endpoint
node_chat_endpoint -->|"runs agent"| node_chat_runtime
node_admin -.->|"signs in"| node_admin_login
node_admin -->|"administers system"| node_admin_dashboard
node_admin -->|"manages users"| node_user_admin
node_admin -->|"reviews requests"| node_request_admin
node_request_admin -.->|"submits review"| node_request_review
node_landing -->|"loads configuration"| node_config
node_inventory -->|"loads configuration"| node_config
node_receivables -->|"loads configuration"| node_config
node_header -->|"loads configuration"| node_config
node_header -->|"loads workspace helpers"| node_workspace
node_config -->|"connects to"| node_database
node_dashboard -.->|"reads business data"| node_database
node_inventory -.->|"reads and writes"| node_database
node_sales_handlers -.->|"records transactions"| node_database
node_receivables -.->|"reads and writes"| node_database
node_analytics -.->|"reads sales data"| node_database
node_admin_dashboard -.->|"reads admin data"| node_database

click node_landing "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/index.php"
click node_auth "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/login_process.php"
click node_signup "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/signup_process.php"
click node_workspace "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/tenant_helper.php"
click node_dashboard "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/dashboard.php"
click node_inventory "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/inventory_management.php"
click node_inventory_handlers "https://github.com/desinomeme24/nexgen-capstone/tree/main/CODE/PHP"
click node_sales "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/sales_recording.php"
click node_sales_handlers "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/process_sale.php"
click node_receivables "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/accounts_receivable.php"
click node_receivable_helpers "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/ar_helper.php"
click node_analytics "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/sales_analytics.php"
click node_chat_endpoint "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/chatbot.php"
click node_chat_runtime "https://github.com/desinomeme24/nexgen-capstone/tree/main/CODE/PHP/CHATBOT"
click node_admin_login "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/admin_login.php"
click node_admin_dashboard "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/admin_dashboard.php"
click node_user_admin "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/manage_users.php"
click node_request_admin "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/pending_requests.php"
click node_request_review "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/workspace_request_review.php"
click node_config "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/config.php"
click node_header "https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/header.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_landing,node_auth,node_signup,node_workspace,node_user toneBlue
class node_inventory,node_inventory_handlers,node_sales,node_sales_handlers,node_receivables,node_database toneAmber
class node_dashboard,node_analytics,node_chat_endpoint,node_chat_runtime toneMint
class node_admin_login,node_admin_dashboard,node_user_admin,node_request_admin,node_request_review toneRose
class node_receivable_helpers,node_config,node_header,node_admin toneIndigo
```

## Components

### Access and workspace

- [Landing and sign-in](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/index.php): `CODE/PHP/index.php`
- [Authentication handlers](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/login_process.php): `CODE/PHP/login_process.php`
- [Registration](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/signup_process.php): `CODE/PHP/signup_process.php`
- [Workspace context](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/tenant_helper.php): `CODE/PHP/tenant_helper.php`

### Business operations

- [Inventory management](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/inventory_management.php): `CODE/PHP/inventory_management.php`
- [Inventory handlers](https://github.com/desinomeme24/nexgen-capstone/tree/main/CODE/PHP): `CODE/PHP`
- [Sales recording](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/sales_recording.php): `CODE/PHP/sales_recording.php`
- [Sale processing](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/process_sale.php): `CODE/PHP/process_sale.php`
- [Accounts receivable](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/accounts_receivable.php): `CODE/PHP/accounts_receivable.php`

### Insights and assistance

- [Business dashboard](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/dashboard.php): `CODE/PHP/dashboard.php`
- [Sales analytics](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/sales_analytics.php): `CODE/PHP/sales_analytics.php`
- [Chatbot endpoint](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/chatbot.php): `CODE/PHP/chatbot.php`
- [Chatbot routing and tools](https://github.com/desinomeme24/nexgen-capstone/tree/main/CODE/PHP/CHATBOT): `CODE/PHP/CHATBOT`

### Administration

- [Admin login](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/admin_login.php): `CODE/PHP/admin_login.php`
- [Admin dashboard](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/admin_dashboard.php): `CODE/PHP/admin_dashboard.php`
- [User management](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/manage_users.php): `CODE/PHP/manage_users.php`
- [Workspace requests](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/pending_requests.php): `CODE/PHP/pending_requests.php`
- [Request review](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/workspace_request_review.php): `CODE/PHP/workspace_request_review.php`

### Shared foundation

- [Receivable helpers](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/ar_helper.php): `CODE/PHP/ar_helper.php`
- [Application configuration](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/config.php): `CODE/PHP/config.php`
- [Shared user interface](https://github.com/desinomeme24/nexgen-capstone/blob/main/CODE/PHP/header.php): `CODE/PHP/header.php`

### Other components

- **Business user**
- **System administrator**
- **MySQL database**

## Connections

- Business user → Landing and sign-in: opens
- Landing and sign-in → Authentication handlers: authenticates
- Business user → Registration: registers
- Business user → Workspace context: selects workspace
- Workspace context → Inventory management: provides context (evidence: `CODE/PHP/inventory_management.php`)
- Workspace context → Accounts receivable: provides context (evidence: `CODE/PHP/accounts_receivable.php`)
- Business user → Business dashboard: views
- Business user → Inventory management: manages stock
- Inventory management → Inventory handlers: supports operations (evidence: `CODE/PHP/inventory_management.php`)
- Business user → Sales recording: records sales
- Sales recording → Sale processing: processes sale
- Business user → Accounts receivable: tracks balances
- Accounts receivable → Receivable helpers: uses helpers (evidence: `CODE/PHP/accounts_receivable.php`)
- Business user → Sales analytics: reviews analytics
- Business user → Chatbot endpoint: asks questions
- Chatbot endpoint → Chatbot routing and tools: runs agent (evidence: `CODE/PHP/chatbot.php`)
- System administrator → Admin login: signs in
- System administrator → Admin dashboard: administers system
- System administrator → User management: manages users
- System administrator → Workspace requests: reviews requests
- Workspace requests → Request review: submits review
- Landing and sign-in → Application configuration: loads configuration (evidence: `CODE/PHP/index.php`)
- Inventory management → Application configuration: loads configuration (evidence: `CODE/PHP/inventory_management.php`)
- Accounts receivable → Application configuration: loads configuration (evidence: `CODE/PHP/accounts_receivable.php`)
- Shared user interface → Application configuration: loads configuration (evidence: `CODE/PHP/header.php`)
- Shared user interface → Workspace context: loads workspace helpers (evidence: `CODE/PHP/header.php`)
- Application configuration → MySQL database: connects to
- Business dashboard → MySQL database: reads business data
- Inventory management → MySQL database: reads and writes
- Sale processing → MySQL database: records transactions
- Accounts receivable → MySQL database: reads and writes
- Sales analytics → MySQL database: reads sales data
- Admin dashboard → MySQL database: reads admin data
