# gohighlevel/ghl-sdk-examples architecture

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

- Interactive diagram: https://gitdiagram.com/gohighlevel/ghl-sdk-examples
- Repository: https://github.com/gohighlevel/ghl-sdk-examples

## Overview

This repository is a collection of HighLevel SDK sample applications in Node.js, PHP, and Python, rather than one shared application. The examples demonstrate OAuth installation and callbacks, session-backed contact retrieval, token refresh, and webhook handling, with MongoDB, SQL, and Redis storage variants. The clearest end-to-end evidence is in the Node Redis, Python SQL/Mongo, PHP SQL, and Python webhook excerpts; several other sample entry points are indexed but not excerpted, so their internal flows are not expanded here.

Main entry points: [`python/sample-app-mongo/app.py`](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-mongo/app.py) (Mongo sample app), [`node/sample-app-redis/index.js`](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/index.js) (Redis sample app), [`node/sample-app-redis/storage/redis-storage.js`](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/storage/redis-storage.js) (Redis sessions), [`python/sample-app-sql/app.py`](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-sql/app.py) (SQL sample app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_node["Node.js samples"]
  node_node_redis["Redis sample app<br/>[index.js]"]
  node_node_mongo["Mongo sample app<br/>[index.js]"]
  node_node_oauth["OAuth sample app<br/>[index.js]"]
  node_node_pit["PIT sample app<br/>[index.js]"]
  node_node_webhook["Webhook sample app<br/>[index.js]"]
end

subgraph group_php["PHP samples"]
  node_php_mongo["Mongo sample app<br/>[index.php]"]
  node_php_oauth["OAuth sample app<br/>[index.php]"]
  node_php_sql["SQL sample app<br/>[index.php]"]
  node_php_webhook["Webhook sample app<br/>[index.php]"]
end

subgraph group_python["Python samples"]
  node_py_mongo["Mongo sample app<br/>[app.py]"]
  node_py_oauth["OAuth sample app<br/>[app.py]"]
  node_py_pit["PIT sample app<br/>[app.py]"]
  node_py_sql["SQL sample app<br/>[app.py]"]
  node_py_webhook_server["Webhook server<br/>[app.py]"]
  node_py_webhook_asgi["ASGI entry<br/>[asgi.py]"]
  node_py_webhook_routes["Webhook routes<br/>[urls.py]"]
  node_py_webhook_views["Webhook handlers<br/>[views.py]"]
end

subgraph group_storage["Session storage"]
  node_redis_storage["Redis sessions<br/>[redis-storage.js]"]
  node_php_sql_storage["SQL sessions<br/>[SqlStorage.php]"]
  node_py_sql_storage["SQL sessions<br/>[sql_storage.py]"]
end

node_user(("Browser user"))
node_redis_db[("Redis")]

node_user -->|"requests routes"| node_node_redis
node_node_redis -->|"configures storage"| node_redis_storage
node_redis_storage -->|"reads and writes"| node_redis_db
node_node_redis -->|"stores tokens"| node_redis_storage
node_node_redis -->|"checks sessions"| node_redis_storage
node_user -->|"requests routes"| node_py_mongo
node_py_mongo -->|"starts OAuth"| node_py_mongo
node_py_mongo -->|"fetches contacts"| node_py_mongo
node_py_mongo -->|"refreshes tokens"| node_py_mongo
node_user -->|"requests routes"| node_py_sql
node_py_sql -->|"stores sessions"| node_py_sql_storage
node_py_sql -->|"checks sessions"| node_py_sql_storage
node_user -->|"requests routes"| node_php_sql
node_php_sql -->|"configures storage"| node_php_sql_storage
node_user -->|"starts server"| node_py_webhook_server
node_py_webhook_server -->|"runs application"| node_py_webhook_asgi
node_py_webhook_routes -->|"routes requests"| node_py_webhook_views

click node_node_redis "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/index.js"
click node_redis_storage "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/storage/redis-storage.js"
click node_node_mongo "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-mongo/index.js"
click node_node_oauth "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-oauth/index.js"
click node_node_pit "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-pit/index.js"
click node_node_webhook "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-webhook/index.js"
click node_php_mongo "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-mongo/public/index.php"
click node_php_oauth "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-oauth/public/index.php"
click node_php_sql "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-sql/public/index.php"
click node_php_sql_storage "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-sql/storage/SqlStorage.php"
click node_php_webhook "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-webhook/public/index.php"
click node_py_mongo "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-mongo/app.py"
click node_py_oauth "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-oauth/app.py"
click node_py_pit "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-pit/app.py"
click node_py_sql "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-sql/app.py"
click node_py_sql_storage "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-sql/storage/sql_storage.py"
click node_py_webhook_server "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/app.py"
click node_py_webhook_asgi "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/asgi.py"
click node_py_webhook_routes "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/urls.py"
click node_py_webhook_views "https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/views.py"

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_node_redis,node_node_mongo,node_node_oauth,node_node_pit,node_node_webhook,node_user toneBlue
class node_php_mongo,node_php_oauth,node_php_sql,node_php_webhook,node_redis_db toneAmber
class node_py_mongo,node_py_oauth,node_py_pit,node_py_sql,node_py_webhook_server,node_py_webhook_asgi,node_py_webhook_routes,node_py_webhook_views toneMint
class node_redis_storage,node_php_sql_storage,node_py_sql_storage toneRose
```

## Components

### Node.js samples

- [Redis sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/index.js): `node/sample-app-redis/index.js`
- [Mongo sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-mongo/index.js): `node/sample-app-mongo/index.js`
- [OAuth sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-oauth/index.js): `node/sample-app-oauth/index.js`
- [PIT sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-pit/index.js): `node/sample-app-pit/index.js`
- [Webhook sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-webhook/index.js): `node/sample-app-webhook/index.js`

### PHP samples

- [Mongo sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-mongo/public/index.php): `php/sample-app-mongo/public/index.php`
- [OAuth sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-oauth/public/index.php): `php/sample-app-oauth/public/index.php`
- [SQL sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-sql/public/index.php): `php/sample-app-sql/public/index.php`
- [Webhook sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-webhook/public/index.php): `php/sample-app-webhook/public/index.php`

### Python samples

- [Mongo sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-mongo/app.py): `python/sample-app-mongo/app.py`
- [OAuth sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-oauth/app.py): `python/sample-app-oauth/app.py`
- [PIT sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-pit/app.py): `python/sample-app-pit/app.py`
- [SQL sample app](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-sql/app.py): `python/sample-app-sql/app.py`
- [Webhook server](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/app.py): `python/sample-app-webhook/app.py`
- [ASGI entry](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/asgi.py): `python/sample-app-webhook/config/asgi.py`
- [Webhook routes](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/urls.py): `python/sample-app-webhook/config/urls.py`
- [Webhook handlers](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-webhook/config/views.py): `python/sample-app-webhook/config/views.py`

### Session storage

- [Redis sessions](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/node/sample-app-redis/storage/redis-storage.js): `node/sample-app-redis/storage/redis-storage.js`
- [SQL sessions](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/php/sample-app-sql/storage/SqlStorage.php): `php/sample-app-sql/storage/SqlStorage.php`
- [SQL sessions](https://github.com/gohighlevel/ghl-sdk-examples/blob/main/python/sample-app-sql/storage/sql_storage.py): `python/sample-app-sql/storage/sql_storage.py`

### Other components

- **Browser user**
- **Redis**

## Connections

- Browser user → Redis sample app: requests routes (evidence: `node/sample-app-redis/index.js`)
- Redis sample app → Redis sessions: configures storage (evidence: `node/sample-app-redis/index.js`)
- Redis sessions → Redis: reads and writes (evidence: `node/sample-app-redis/storage/redis-storage.js`)
- Redis sample app → Redis sessions: stores tokens (evidence: `node/sample-app-redis/index.js`)
- Redis sample app → Redis sessions: checks sessions (evidence: `node/sample-app-redis/index.js`)
- Browser user → Mongo sample app: requests routes (evidence: `python/sample-app-mongo/app.py`)
- Mongo sample app → Mongo sample app: starts OAuth (evidence: `python/sample-app-mongo/app.py`)
- Mongo sample app → Mongo sample app: fetches contacts (evidence: `python/sample-app-mongo/app.py`)
- Mongo sample app → Mongo sample app: refreshes tokens (evidence: `python/sample-app-mongo/app.py`)
- Browser user → SQL sample app: requests routes (evidence: `python/sample-app-sql/app.py`)
- SQL sample app → SQL sessions: stores sessions (evidence: `python/sample-app-sql/app.py`)
- SQL sample app → SQL sessions: checks sessions (evidence: `python/sample-app-sql/app.py`)
- Browser user → SQL sample app: requests routes (evidence: `php/sample-app-sql/public/index.php`)
- SQL sample app → SQL sessions: configures storage (evidence: `php/sample-app-sql/public/index.php`)
- Browser user → Webhook server: starts server (evidence: `python/sample-app-webhook/app.py`)
- Webhook server → ASGI entry: runs application (evidence: `python/sample-app-webhook/app.py`)
- Webhook routes → Webhook handlers: routes requests (evidence: `python/sample-app-webhook/config/urls.py`)
