# konzopro7/konzo_one architecture

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

- Interactive diagram: https://gitdiagram.com/konzopro7/konzo_one
- Repository: https://github.com/konzopro7/konzo_one

## Overview

Konzotech One is an agency-management SaaS spanning sales, client documents, subscription billing, finance operations, and messaging. A typical workflow starts with staff managing prospects and clients, then producing quotes and invoices; clients can accept quotes, download documents, and pay invoices through a public portal. Staff also manage purchasing, expenses, inventory, and ledger views. The React app calls an Express API backed by PostgreSQL, with role-aware access. README capabilities identify several integrations and feature areas not represented in sampled implementation excerpts, so their internal wiring is not inferred.

Main entry points: [`server/src/server.js`](https://github.com/konzopro7/konzo_one/blob/main/server/src/server.js) (Express API), [`client/src/lib/api.js`](https://github.com/konzopro7/konzo_one/blob/main/client/src/lib/api.js) (API client), [`server/src/routes/payments.js`](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/payments.js) (Payments API), [`client/src/main.jsx`](https://github.com/konzopro7/konzo_one/blob/main/client/src/main.jsx) (React app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales and documents"]
  node_pipeline_ui["Sales pipeline<br/>[PipelinePage.jsx]"]
  node_clients_ui["Client CRM<br/>[ClientsPage.jsx]"]
  node_portal_ui["Client portal"]
  node_pipeline_api["Pipeline API<br/>[pipeline.js]"]
  node_clients_api["Clients API<br/>[clients.js]"]
  node_quotes_api["Quotes API<br/>[quotes.js]"]
  node_invoices_api["Invoices API<br/>[invoices.js]"]
  node_portal_api["Portal API<br/>[portal.js]"]
end

subgraph group_finance["Finance and operations"]
  node_payments_api["Payments API<br/>[payments.js]"]
  node_billing_api["Subscription billing<br/>[billing.js]"]
  node_erp_api["ERP finance<br/>[ledger.js]"]
  node_purchases_api["Purchases and suppliers<br/>[purchases.js]"]
  node_expenses_api["Expenses<br/>[expenses.js]"]
  node_inventory_api["Inventory<br/>[inventory.js]"]
end

subgraph group_workspace["Agency workspace"]
  node_react["React app<br/>[main.jsx]"]
  node_routes["App routes<br/>[App.jsx]"]
  node_auth["Session and roles<br/>[useAuth.jsx]"]
  node_api["API client<br/>[api.js]"]
end

subgraph group_platform["Platform services"]
  node_server["Express API<br/>[server.js]"]
  node_reminders["Reminder engine<br/>[reminders.js]"]
  node_messaging["WhatsApp inbox<br/>[chatbot.js]"]
  node_database[("PostgreSQL<br/>[db.js]")]
end

node_staff(("Agency staff"))
node_clients(("Public clients"))
node_stripe["Stripe"]

node_staff -->|"uses"| node_react
node_clients -->|"opens portal"| node_react
node_react -->|"renders"| node_routes
node_routes -->|"protects workspace"| node_auth
node_pipeline_ui -->|"requests data"| node_api
node_clients_ui -->|"requests data"| node_api
node_portal_ui -->|"requests documents"| node_api
node_api -->|"sends requests"| node_server
node_server -->|"dispatches"| node_pipeline_api
node_server -->|"dispatches"| node_clients_api
node_server -->|"dispatches"| node_quotes_api
node_server -->|"dispatches"| node_invoices_api
node_server -->|"dispatches"| node_portal_api
node_server -->|"dispatches"| node_payments_api
node_server -->|"dispatches"| node_billing_api
node_server -->|"dispatches"| node_erp_api
node_server -->|"dispatches"| node_purchases_api
node_server -->|"dispatches"| node_expenses_api
node_server -->|"dispatches"| node_inventory_api
node_server -->|"dispatches"| node_messaging
node_pipeline_api -->|"queries"| node_database
node_clients_api -->|"queries"| node_database
node_portal_ui -->|"starts checkout"| node_payments_api
node_payments_api -.->|"payment integration"| node_stripe
node_server -->|"starts scheduler"| node_reminders

click node_react "https://github.com/konzopro7/konzo_one/blob/main/client/src/main.jsx"
click node_routes "https://github.com/konzopro7/konzo_one/blob/main/client/src/App.jsx"
click node_auth "https://github.com/konzopro7/konzo_one/blob/main/client/src/hooks/useAuth.jsx"
click node_api "https://github.com/konzopro7/konzo_one/blob/main/client/src/lib/api.js"
click node_pipeline_ui "https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/PipelinePage.jsx"
click node_clients_ui "https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/ClientsPage.jsx"
click node_portal_ui "https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/ClientPortalPage.jsx"
click node_server "https://github.com/konzopro7/konzo_one/blob/main/server/src/server.js"
click node_pipeline_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/pipeline.js"
click node_clients_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/clients.js"
click node_quotes_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/quotes.js"
click node_invoices_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/invoices.js"
click node_portal_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/portal.js"
click node_payments_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/payments.js"
click node_billing_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/billing.js"
click node_erp_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/ledger.js"
click node_purchases_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/purchases.js"
click node_expenses_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/expenses.js"
click node_inventory_api "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/inventory.js"
click node_reminders "https://github.com/konzopro7/konzo_one/blob/main/server/src/services/reminders.js"
click node_messaging "https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/chatbot.js"
click node_database "https://github.com/konzopro7/konzo_one/blob/main/server/src/db.js"

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_pipeline_ui,node_clients_ui,node_portal_ui,node_pipeline_api,node_clients_api,node_quotes_api,node_invoices_api,node_portal_api,node_clients toneBlue
class node_payments_api,node_billing_api,node_erp_api,node_purchases_api,node_expenses_api,node_inventory_api toneAmber
class node_react,node_routes,node_auth,node_api toneMint
class node_server,node_reminders,node_messaging,node_database toneRose
class node_staff,node_stripe toneIndigo
```

## Components

### Sales and documents

- [Sales pipeline](https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/PipelinePage.jsx): `client/src/pages/PipelinePage.jsx`
- [Client CRM](https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/ClientsPage.jsx): `client/src/pages/ClientsPage.jsx`
- [Client portal](https://github.com/konzopro7/konzo_one/blob/main/client/src/pages/ClientPortalPage.jsx): `client/src/pages/ClientPortalPage.jsx`
- [Pipeline API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/pipeline.js): `server/src/routes/pipeline.js`
- [Clients API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/clients.js): `server/src/routes/clients.js`
- [Quotes API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/quotes.js): `server/src/routes/quotes.js`
- [Invoices API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/invoices.js): `server/src/routes/invoices.js`
- [Portal API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/portal.js): `server/src/routes/portal.js`

### Finance and operations

- [Payments API](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/payments.js): `server/src/routes/payments.js`
- [Subscription billing](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/billing.js): `server/src/routes/billing.js`
- [ERP finance](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/ledger.js): `server/src/routes/ledger.js`
- [Purchases and suppliers](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/purchases.js): `server/src/routes/purchases.js`
- [Expenses](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/expenses.js): `server/src/routes/expenses.js`
- [Inventory](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/inventory.js): `server/src/routes/inventory.js`

### Agency workspace

- [React app](https://github.com/konzopro7/konzo_one/blob/main/client/src/main.jsx): `client/src/main.jsx`
- [App routes](https://github.com/konzopro7/konzo_one/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session and roles](https://github.com/konzopro7/konzo_one/blob/main/client/src/hooks/useAuth.jsx): `client/src/hooks/useAuth.jsx`
- [API client](https://github.com/konzopro7/konzo_one/blob/main/client/src/lib/api.js): `client/src/lib/api.js`

### Platform services

- [Express API](https://github.com/konzopro7/konzo_one/blob/main/server/src/server.js): `server/src/server.js`
- [Reminder engine](https://github.com/konzopro7/konzo_one/blob/main/server/src/services/reminders.js): `server/src/services/reminders.js`
- [WhatsApp inbox](https://github.com/konzopro7/konzo_one/blob/main/server/src/routes/chatbot.js): `server/src/routes/chatbot.js`
- [PostgreSQL](https://github.com/konzopro7/konzo_one/blob/main/server/src/db.js): `server/src/db.js`

### Other components

- **Agency staff**
- **Public clients**
- **Stripe**

## Connections

- Agency staff → React app: uses
- Public clients → React app: opens portal
- React app → App routes: renders
- App routes → Session and roles: protects workspace
- Sales pipeline → API client: requests data
- Client CRM → API client: requests data
- Client portal → API client: requests documents
- API client → Express API: sends requests
- Express API → Pipeline API: dispatches
- Express API → Clients API: dispatches
- Express API → Quotes API: dispatches
- Express API → Invoices API: dispatches
- Express API → Portal API: dispatches
- Express API → Payments API: dispatches
- Express API → Subscription billing: dispatches
- Express API → ERP finance: dispatches
- Express API → Purchases and suppliers: dispatches
- Express API → Expenses: dispatches
- Express API → Inventory: dispatches
- Express API → WhatsApp inbox: dispatches
- Pipeline API → PostgreSQL: queries
- Clients API → PostgreSQL: queries
- Client portal → Payments API: starts checkout
- Payments API → Stripe: payment integration
- Express API → Reminder engine: starts scheduler
