# vishwanatha01/sam-associates architecture

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

- Interactive diagram: https://gitdiagram.com/vishwanatha01/sam-associates
- Repository: https://github.com/vishwanatha01/sam-associates

## Overview

SAM & Associates is a PHP website for an accounting, tax and compliance firm, with public service information, consultation requests, and client/admin portal areas. The principal workflow is a visitor exploring services, submitting a consultation request, then staff reviewing appointments and enquiries; registered clients can also sign in to manage profile details and view portal information. Shared PHP configuration supplies sessions, database access, CSRF checks, escaping and URL helpers. The excerpts show appointment and dashboard database operations, but do not establish every public-page form behavior or all notification/document lifecycle details.

Main entry points: [`client/dashboard.php`](https://github.com/vishwanatha01/sam-associates/blob/main/client/dashboard.php) (Client Workspace), [`partials_header.php`](https://github.com/vishwanatha01/sam-associates/blob/main/partials_header.php) (Shared Page Shell), [`appointment.php`](https://github.com/vishwanatha01/sam-associates/blob/main/appointment.php) (Consultation Booking), [`auth/login.php`](https://github.com/vishwanatha01/sam-associates/blob/main/auth/login.php) (Sign In)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Website"]
  node_home["Firm Homepage<br/>[index.php]"]
  node_firminfo["Firm Information<br/>[about.php]"]
  node_services["Service Catalogue<br/>[services.php]"]
  node_booking["Consultation Booking<br/>[appointment.php]"]
  node_contact["Contact Page<br/>[contact.php]"]
end

subgraph group_accounts["Accounts and Access"]
  node_register["Client Registration<br/>[register.php]"]
  node_login["Sign In<br/>[login.php]"]
  node_logout["Sign Out<br/>[logout.php]"]
end

subgraph group_portal["Client and Staff Portal"]
  node_client["Client Workspace<br/>[dashboard.php]"]
  node_admin["Admin Console<br/>[dashboard.php]"]
  node_workspace_records["Portal Records<br/>[dashboard.php]"]
end

subgraph group_platform["Shared Platform"]
  node_shared_ui["Shared Page Shell"]
  node_footer["Shared Footer"]
  node_config["PHP Configuration<br/>[config.php]"]
  node_setup["Database Setup<br/>[setup.php]"]
  node_database[("MySQL Data<br/>[database.sql]")]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"explores"| node_services
node_services -->|"links to booking"| node_booking
node_visitor -->|"submits request"| node_booking
node_booking -->|"inserts appointment"| node_database
node_visitor -->|"creates account"| node_register
node_register -->|"inserts user"| node_database
node_visitor -->|"signs in"| node_login
node_login -->|"checks credentials"| node_database
node_login -->|"routes admin"| node_admin
node_login -->|"routes client"| node_client
node_client -->|"reads and updates"| node_database
node_client -->|"shows portal records"| node_workspace_records
node_client -->|"saves support enquiry"| node_database
node_admin -->|"reads and updates"| node_database
node_admin -->|"links to booking"| node_booking
node_admin -->|"links to contact"| node_contact
node_client -->|"links to booking"| node_booking
node_client -->|"links to services"| node_services
node_client -->|"links to sign out"| node_logout
node_admin -->|"links to sign out"| node_logout
node_logout -->|"uses session config"| node_config
node_home -->|"includes shell"| node_shared_ui
node_firminfo -->|"includes shell"| node_shared_ui
node_services -->|"includes shell"| node_shared_ui
node_booking -->|"includes shell"| node_shared_ui
node_login -->|"includes shell"| node_shared_ui
node_register -->|"includes shell"| node_shared_ui
node_admin -->|"includes shell"| node_shared_ui
node_client -->|"includes shell"| node_shared_ui
node_shared_ui -->|"loads helpers"| node_config
node_booking -->|"uses helpers"| node_config
node_login -->|"uses helpers"| node_config
node_register -->|"uses helpers"| node_config
node_client -->|"uses helpers"| node_config
node_admin -->|"uses helpers"| node_config
node_setup -->|"loads helpers"| node_config
node_setup -->|"creates schema"| node_database
node_home -->|"includes footer"| node_footer
node_firminfo -->|"includes footer"| node_footer
node_services -->|"includes footer"| node_footer
node_booking -->|"includes footer"| node_footer
node_login -->|"includes footer"| node_footer
node_register -->|"includes footer"| node_footer
node_client -->|"includes footer"| node_footer

click node_home "https://github.com/vishwanatha01/sam-associates/blob/main/index.php"
click node_firminfo "https://github.com/vishwanatha01/sam-associates/blob/main/about.php"
click node_services "https://github.com/vishwanatha01/sam-associates/blob/main/services.php"
click node_booking "https://github.com/vishwanatha01/sam-associates/blob/main/appointment.php"
click node_contact "https://github.com/vishwanatha01/sam-associates/blob/main/contact.php"
click node_register "https://github.com/vishwanatha01/sam-associates/blob/main/auth/register.php"
click node_login "https://github.com/vishwanatha01/sam-associates/blob/main/auth/login.php"
click node_logout "https://github.com/vishwanatha01/sam-associates/blob/main/auth/logout.php"
click node_client "https://github.com/vishwanatha01/sam-associates/blob/main/client/dashboard.php"
click node_admin "https://github.com/vishwanatha01/sam-associates/blob/main/admin/dashboard.php"
click node_workspace_records "https://github.com/vishwanatha01/sam-associates/blob/main/client/dashboard.php"
click node_shared_ui "https://github.com/vishwanatha01/sam-associates/blob/main/partials_header.php"
click node_footer "https://github.com/vishwanatha01/sam-associates/blob/main/partials_footer.php"
click node_config "https://github.com/vishwanatha01/sam-associates/blob/main/config/config.php"
click node_setup "https://github.com/vishwanatha01/sam-associates/blob/main/setup.php"
click node_database "https://github.com/vishwanatha01/sam-associates/blob/main/database.sql"

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_home,node_firminfo,node_services,node_booking,node_contact toneBlue
class node_register,node_login,node_logout toneAmber
class node_client,node_admin,node_workspace_records toneMint
class node_shared_ui,node_footer,node_config,node_setup,node_database toneRose
class node_visitor toneIndigo
```

## Components

### Public Website

- [Firm Homepage](https://github.com/vishwanatha01/sam-associates/blob/main/index.php): `index.php`
- [Firm Information](https://github.com/vishwanatha01/sam-associates/blob/main/about.php): `about.php`
- [Service Catalogue](https://github.com/vishwanatha01/sam-associates/blob/main/services.php): `services.php`
- [Consultation Booking](https://github.com/vishwanatha01/sam-associates/blob/main/appointment.php): `appointment.php`
- [Contact Page](https://github.com/vishwanatha01/sam-associates/blob/main/contact.php): `contact.php`

### Accounts and Access

- [Client Registration](https://github.com/vishwanatha01/sam-associates/blob/main/auth/register.php): `auth/register.php`
- [Sign In](https://github.com/vishwanatha01/sam-associates/blob/main/auth/login.php): `auth/login.php`
- [Sign Out](https://github.com/vishwanatha01/sam-associates/blob/main/auth/logout.php): `auth/logout.php`

### Client and Staff Portal

- [Client Workspace](https://github.com/vishwanatha01/sam-associates/blob/main/client/dashboard.php): `client/dashboard.php`
- [Admin Console](https://github.com/vishwanatha01/sam-associates/blob/main/admin/dashboard.php): `admin/dashboard.php`
- [Portal Records](https://github.com/vishwanatha01/sam-associates/blob/main/client/dashboard.php): `client/dashboard.php`

### Shared Platform

- [Shared Page Shell](https://github.com/vishwanatha01/sam-associates/blob/main/partials_header.php): `partials_header.php`
- [Shared Footer](https://github.com/vishwanatha01/sam-associates/blob/main/partials_footer.php): `partials_footer.php`
- [PHP Configuration](https://github.com/vishwanatha01/sam-associates/blob/main/config/config.php): `config/config.php`
- [Database Setup](https://github.com/vishwanatha01/sam-associates/blob/main/setup.php): `setup.php`
- [MySQL Data](https://github.com/vishwanatha01/sam-associates/blob/main/database.sql): `database.sql`

### Other components

- **Visitor**

## Connections

- Visitor → Firm Homepage: browses (evidence: `index.php`)
- Visitor → Service Catalogue: explores (evidence: `services.php`)
- Service Catalogue → Consultation Booking: links to booking (evidence: `services.php`)
- Visitor → Consultation Booking: submits request (evidence: `appointment.php`)
- Consultation Booking → MySQL Data: inserts appointment (evidence: `appointment.php`)
- Visitor → Client Registration: creates account (evidence: `auth/register.php`)
- Client Registration → MySQL Data: inserts user (evidence: `auth/register.php`)
- Visitor → Sign In: signs in (evidence: `auth/login.php`)
- Sign In → MySQL Data: checks credentials (evidence: `auth/login.php`)
- Sign In → Admin Console: routes admin (evidence: `auth/login.php`)
- Sign In → Client Workspace: routes client (evidence: `auth/login.php`)
- Client Workspace → MySQL Data: reads and updates (evidence: `client/dashboard.php`)
- Client Workspace → Portal Records: shows portal records (evidence: `client/dashboard.php`)
- Client Workspace → MySQL Data: saves support enquiry (evidence: `client/dashboard.php`)
- Admin Console → MySQL Data: reads and updates (evidence: `admin/dashboard.php`)
- Admin Console → Consultation Booking: links to booking (evidence: `admin/dashboard.php`)
- Admin Console → Contact Page: links to contact (evidence: `admin/dashboard.php`)
- Client Workspace → Consultation Booking: links to booking (evidence: `client/dashboard.php`)
- Client Workspace → Service Catalogue: links to services (evidence: `client/dashboard.php`)
- Client Workspace → Sign Out: links to sign out (evidence: `client/dashboard.php`)
- Admin Console → Sign Out: links to sign out (evidence: `admin/dashboard.php`)
- Sign Out → PHP Configuration: uses session config (evidence: `auth/logout.php`)
- Firm Homepage → Shared Page Shell: includes shell (evidence: `index.php`)
- Firm Information → Shared Page Shell: includes shell (evidence: `about.php`)
- Service Catalogue → Shared Page Shell: includes shell (evidence: `services.php`)
- Consultation Booking → Shared Page Shell: includes shell (evidence: `appointment.php`)
- Sign In → Shared Page Shell: includes shell (evidence: `auth/login.php`)
- Client Registration → Shared Page Shell: includes shell (evidence: `auth/register.php`)
- Admin Console → Shared Page Shell: includes shell (evidence: `admin/dashboard.php`)
- Client Workspace → Shared Page Shell: includes shell (evidence: `client/dashboard.php`)
- Shared Page Shell → PHP Configuration: loads helpers (evidence: `partials_header.php`)
- Consultation Booking → PHP Configuration: uses helpers (evidence: `appointment.php`)
- Sign In → PHP Configuration: uses helpers (evidence: `auth/login.php`)
- Client Registration → PHP Configuration: uses helpers (evidence: `auth/register.php`)
- Client Workspace → PHP Configuration: uses helpers (evidence: `client/dashboard.php`)
- Admin Console → PHP Configuration: uses helpers (evidence: `admin/dashboard.php`)
- Database Setup → PHP Configuration: loads helpers (evidence: `setup.php`)
- Database Setup → MySQL Data: creates schema (evidence: `setup.php`)
- Firm Homepage → Shared Footer: includes footer (evidence: `index.php`)
- Firm Information → Shared Footer: includes footer (evidence: `about.php`)
- Service Catalogue → Shared Footer: includes footer (evidence: `services.php`)
- Consultation Booking → Shared Footer: includes footer (evidence: `appointment.php`)
- Sign In → Shared Footer: includes footer (evidence: `auth/login.php`)
- Client Registration → Shared Footer: includes footer (evidence: `auth/register.php`)
- Client Workspace → Shared Footer: includes footer (evidence: `client/dashboard.php`)
