# zeeshan933/agentic-ai-workspace-gateway architecture

> Architecture diagram of the GitHub repository zeeshan933/agentic-ai-workspace-gateway, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zeeshan933/agentic-ai-workspace-gateway
- Repository: https://github.com/zeeshan933/agentic-ai-workspace-gateway

## Overview

AI Workspace SSO Gateway: users enter through Nginx, which routes protected workspace traffic through Flask session validation before granting access. Flask also provides the dashboard, account administration, and OTP-based password recovery, backed by PostgreSQL and SMTP. The README documents routing for Flowise, n8n, and Ollama, plus Cloudflare Tunnel exposure. Source excerpts are partial, so details beyond the documented architecture and shown Flask calls are not inferred.

Main entry points: [`app.py`](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py) (Flask Gateway), [`proxy/nginx.conf`](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/nginx.conf) (Nginx Proxy), [`proxy/docker-compose.yaml`](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/docker-compose.yaml) (Service Configuration), [`templates`](https://github.com/zeeshan933/agentic-ai-workspace-gateway/tree/main/templates) (Web Templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_edge["Gateway and Routing"]
  node_nginx["Nginx Proxy<br/>[nginx.conf]"]
  node_compose["Service Configuration"]
  node_cloudflare["Cloudflare Tunnel"]
end

subgraph group_identity["Identity and Accounts"]
  node_flask["Flask Gateway<br/>[app.py]"]
  node_sso["SSO Validation<br/>[app.py]"]
  node_dashboard["Workspace Dashboard<br/>[app.py]"]
  node_templates["Web Templates"]
  node_login["Login and Sessions<br/>[app.py]"]
  node_admin["User Administration<br/>[app.py]"]
  node_bulk["Bulk User Import<br/>[app.py]"]
  node_recovery["Password Recovery<br/>[app.py]"]
end

subgraph group_workspace["AI Workspace"]
  node_flowise["Flowise"]
  node_n8n["n8n"]
  node_ollama["Ollama"]
end

subgraph group_operations["State and Messaging"]
  node_otp["OTP Email<br/>[app.py]"]
  node_postgres[("PostgreSQL")]
  node_smtp["SMTP Server"]
end

node_user(("Workspace User"))

node_user -->|"sends requests"| node_nginx
node_nginx -->|"routes traffic"| node_flask
node_nginx -->|"checks sessions"| node_sso
node_sso -->|"validates via endpoint"| node_flask
node_flask -->|"serves authentication"| node_login
node_flask -->|"serves dashboard"| node_dashboard
node_flask -->|"serves admin controls"| node_admin
node_admin -->|"accepts uploads"| node_bulk
node_flask -->|"handles reset flow"| node_recovery
node_recovery -->|"sends verification code"| node_otp
node_otp -->|"sends email"| node_smtp
node_flask -->|"renders pages"| node_templates
node_flask -->|"persists account data"| node_postgres
node_nginx -->|"routes protected traffic"| node_flowise
node_nginx -->|"routes protected traffic"| node_n8n
node_nginx -->|"routes protected traffic"| node_ollama
node_flask -->|"checks availability"| node_ollama
node_compose -.->|"configures service"| node_nginx
node_compose -.->|"configures tunnel"| node_cloudflare

click node_nginx "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/nginx.conf"
click node_flask "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_sso "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_dashboard "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_templates "https://github.com/zeeshan933/agentic-ai-workspace-gateway/tree/main/templates"
click node_login "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_admin "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_bulk "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_recovery "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_otp "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py"
click node_compose "https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/docker-compose.yaml"

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_nginx,node_compose,node_cloudflare,node_user toneBlue
class node_flask,node_sso,node_dashboard,node_templates,node_login,node_admin,node_bulk,node_recovery toneAmber
class node_flowise,node_n8n,node_ollama toneMint
class node_otp,node_postgres,node_smtp toneRose
```

## Components

### Gateway and Routing

- [Nginx Proxy](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/nginx.conf): `proxy/nginx.conf`
- [Service Configuration](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/proxy/docker-compose.yaml): `proxy/docker-compose.yaml`
- **Cloudflare Tunnel**

### Identity and Accounts

- [Flask Gateway](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [SSO Validation](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [Workspace Dashboard](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [Web Templates](https://github.com/zeeshan933/agentic-ai-workspace-gateway/tree/main/templates): `templates`
- [Login and Sessions](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [User Administration](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [Bulk User Import](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- [Password Recovery](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`

### AI Workspace

- **Flowise**
- **n8n**
- **Ollama**

### State and Messaging

- [OTP Email](https://github.com/zeeshan933/agentic-ai-workspace-gateway/blob/main/app.py): `app.py`
- **PostgreSQL**
- **SMTP Server**

### Other components

- **Workspace User**

## Connections

- Workspace User → Nginx Proxy: sends requests (evidence: `readme.md`)
- Nginx Proxy → Flask Gateway: routes traffic (evidence: `readme.md`)
- Nginx Proxy → SSO Validation: checks sessions (evidence: `readme.md`)
- SSO Validation → Flask Gateway: validates via endpoint (evidence: `readme.md`)
- Flask Gateway → Login and Sessions: serves authentication (evidence: `app.py`)
- Flask Gateway → Workspace Dashboard: serves dashboard (evidence: `app.py`)
- Flask Gateway → User Administration: serves admin controls (evidence: `readme.md`)
- User Administration → Bulk User Import: accepts uploads (evidence: `readme.md`)
- Flask Gateway → Password Recovery: handles reset flow (evidence: `app.py`)
- Password Recovery → OTP Email: sends verification code (evidence: `app.py`)
- OTP Email → SMTP Server: sends email (evidence: `app.py`)
- Flask Gateway → Web Templates: renders pages (evidence: `app.py`)
- Flask Gateway → PostgreSQL: persists account data (evidence: `readme.md`)
- Nginx Proxy → Flowise: routes protected traffic (evidence: `readme.md`)
- Nginx Proxy → n8n: routes protected traffic (evidence: `readme.md`)
- Nginx Proxy → Ollama: routes protected traffic (evidence: `readme.md`)
- Flask Gateway → Ollama: checks availability (evidence: `app.py`)
- Service Configuration → Nginx Proxy: configures service
- Service Configuration → Cloudflare Tunnel: configures tunnel (evidence: `readme.md`)
