# jadabkkd/gof-saleforce architecture

> Architecture diagram of the GitHub repository jadabkkd/gof-saleforce, 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/jadabkkd/gof-saleforce
- Repository: https://github.com/jadabkkd/gof-saleforce

## Overview

This is a Next.js business operations application spanning sales, production, inventory, quality, customer operations, and management reporting. A representative workflow is production-request data feeding production-order and lot management, with production status updates reflected in monitoring. The tree shows separate interfaces and server actions/API routes for these domains, while sampled code confirms MongoDB-backed operations. The README is a generic Next.js starter and documents no product capabilities; several UI-to-server connections are therefore left unasserted where source excerpts do not show them.

Main entry points: [`src/libs/mongodb.ts`](https://github.com/jadabkkd/gof-saleforce/blob/main/src/libs/mongodb.ts) (MongoDB), [`src/app/_actions/ProductionRequest/doFiltProcRequest.ts`](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionRequest/doFiltProcRequest.ts) (Request actions), [`src/states/SerialLot/useSearchProdReq.ts`](https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/SerialLot/useSearchProdReq.ts) (Request lot search), [`src/app/_actions/ProductionOrder/doUpdateMonitData.ts`](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionOrder/doUpdateMonitData.ts) (Production orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales workflow"]
  node_sales_ui["Sales workspace<br/>[page.tsx]"]
  node_quotations["Quotations<br/>[page.tsx]"]
  node_production_requests["Production requests<br/>[page.tsx]"]
end

subgraph group_production["Production operations"]
  node_request_state["Request state"]
  node_request_actions["Request actions"]
  node_order_actions["Production orders"]
  node_order_state["Order state"]
  node_lot_management["Serial lots"]
  node_lot_actions["Lot persistence<br/>[doSaveSerialLot.ts]"]
  node_process_ui["Process workspace<br/>[page.tsx]"]
  node_process_api["Process flows<br/>[route.ts]"]
  node_lot_search["Request lot search"]
end

subgraph group_quality["Quality and specifications"]
  node_coa_ui["COA workspace<br/>[page.tsx]"]
  node_coa_api["COA services<br/>[route.ts]"]
  node_specifications["Specifications<br/>[page.tsx]"]
end

subgraph group_inventory["Inventory and monitoring"]
  node_ingredients["Ingredient management<br/>[page.tsx]"]
  node_stock["Stock activity<br/>[page.tsx]"]
  node_monitoring["Production monitoring<br/>[page.tsx]"]
  node_monitor_actions["Monitor updates"]
end

subgraph group_management["Management and support"]
  node_operator_ops["Customer operations<br/>[page.tsx]"]
  node_finance["Financial analysis<br/>[route.ts]"]
  node_voting["Employee voting<br/>[page.tsx]"]
  node_database[("MongoDB<br/>[mongodb.ts]")]
end

node_operator(("Operator user"))

node_operator -.->|"uses"| node_sales_ui
node_operator -.->|"uses"| node_process_ui
node_operator -.->|"uses"| node_coa_ui
node_operator -.->|"uses"| node_specifications
node_operator -.->|"uses"| node_ingredients
node_operator -.->|"uses"| node_stock
node_operator -.->|"uses"| node_monitoring
node_operator -.->|"uses"| node_operator_ops
node_operator -.->|"views"| node_finance
node_operator -.->|"uses"| node_voting
node_request_state -.->|"references"| node_request_actions
node_lot_search -->|"filters requests"| node_request_actions
node_lot_search -->|"fetches request data"| node_order_actions
node_lot_management -->|"saves lot"| node_lot_actions
node_lot_actions -->|"reads and writes"| node_database
node_request_actions -->|"queries"| node_database
node_order_actions -->|"updates"| node_database
node_monitoring -.->|"receives updates"| node_monitor_actions
node_process_api -->|"queries flows"| node_database
node_coa_api -.->|"persists results"| node_database
node_finance -.->|"queries"| node_database

click node_sales_ui "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/page.tsx"
click node_quotations "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/manage-qt/page.tsx"
click node_production_requests "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/production-request/page.tsx"
click node_request_state "https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/procRequest/useProcRequestData.ts"
click node_request_actions "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionRequest/doFiltProcRequest.ts"
click node_order_actions "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionOrder/doUpdateMonitData.ts"
click node_order_state "https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/prodOrder/useProdOrderData.ts"
click node_lot_management "https://github.com/jadabkkd/gof-saleforce/blob/main/src/modules/SerialLot/SerialLotManager.ts"
click node_lot_actions "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/SerialLot/CreateLot/doSaveSerialLot.ts"
click node_process_ui "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(process_part)/process/page.tsx"
click node_process_api "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/process/filt-process/route.ts"
click node_coa_ui "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(process_part)/process/coa/page.tsx"
click node_coa_api "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/coa/save-coa-form/route.ts"
click node_specifications "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(dcc)/specify/page.tsx"
click node_ingredients "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(ingre)/all-ingre/page.tsx"
click node_stock "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(storev2)/stock-activity/page.tsx"
click node_monitoring "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(prod_monitor)/prod-monitor/page.tsx"
click node_monitor_actions "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionOrder/doUpdateMonitData.ts"
click node_operator_ops "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(operator)/operator/page.tsx"
click node_finance "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/president/finance-data/route.ts"
click node_voting "https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(voting)/voting/page.tsx"
click node_database "https://github.com/jadabkkd/gof-saleforce/blob/main/src/libs/mongodb.ts"
click node_lot_search "https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/SerialLot/useSearchProdReq.ts"

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_sales_ui,node_quotations,node_production_requests,node_operator toneBlue
class node_request_state,node_request_actions,node_order_actions,node_order_state,node_lot_management,node_lot_actions,node_process_ui,node_process_api,node_lot_search toneAmber
class node_coa_ui,node_coa_api,node_specifications toneMint
class node_ingredients,node_stock,node_monitoring,node_monitor_actions toneRose
class node_operator_ops,node_finance,node_voting,node_database toneIndigo
```

## Components

### Sales workflow

- [Sales workspace](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/page.tsx): `src/app/(saleforce)/saleforce/page.tsx`
- [Quotations](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/manage-qt/page.tsx): `src/app/(saleforce)/saleforce/manage-qt/page.tsx`
- [Production requests](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(saleforce)/saleforce/production-request/page.tsx): `src/app/(saleforce)/saleforce/production-request/page.tsx`

### Production operations

- [Request state](https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/procRequest/useProcRequestData.ts): `src/states/procRequest/useProcRequestData.ts`
- [Request actions](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionRequest/doFiltProcRequest.ts): `src/app/_actions/ProductionRequest/doFiltProcRequest.ts`
- [Production orders](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionOrder/doUpdateMonitData.ts): `src/app/_actions/ProductionOrder/doUpdateMonitData.ts`
- [Order state](https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/prodOrder/useProdOrderData.ts): `src/states/prodOrder/useProdOrderData.ts`
- [Serial lots](https://github.com/jadabkkd/gof-saleforce/blob/main/src/modules/SerialLot/SerialLotManager.ts): `src/modules/SerialLot/SerialLotManager.ts`
- [Lot persistence](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/SerialLot/CreateLot/doSaveSerialLot.ts): `src/app/_actions/SerialLot/CreateLot/doSaveSerialLot.ts`
- [Process workspace](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(process_part)/process/page.tsx): `src/app/(process_part)/process/page.tsx`
- [Process flows](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/process/filt-process/route.ts): `src/app/api/process/filt-process/route.ts`
- [Request lot search](https://github.com/jadabkkd/gof-saleforce/blob/main/src/states/SerialLot/useSearchProdReq.ts): `src/states/SerialLot/useSearchProdReq.ts`

### Quality and specifications

- [COA workspace](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(process_part)/process/coa/page.tsx): `src/app/(process_part)/process/coa/page.tsx`
- [COA services](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/coa/save-coa-form/route.ts): `src/app/api/coa/save-coa-form/route.ts`
- [Specifications](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(dcc)/specify/page.tsx): `src/app/(dcc)/specify/page.tsx`

### Inventory and monitoring

- [Ingredient management](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(ingre)/all-ingre/page.tsx): `src/app/(ingre)/all-ingre/page.tsx`
- [Stock activity](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(storev2)/stock-activity/page.tsx): `src/app/(storev2)/stock-activity/page.tsx`
- [Production monitoring](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(prod_monitor)/prod-monitor/page.tsx): `src/app/(prod_monitor)/prod-monitor/page.tsx`
- [Monitor updates](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/_actions/ProductionOrder/doUpdateMonitData.ts): `src/app/_actions/ProductionOrder/doUpdateMonitData.ts`

### Management and support

- [Customer operations](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(operator)/operator/page.tsx): `src/app/(operator)/operator/page.tsx`
- [Financial analysis](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/api/president/finance-data/route.ts): `src/app/api/president/finance-data/route.ts`
- [Employee voting](https://github.com/jadabkkd/gof-saleforce/blob/main/src/app/(voting)/voting/page.tsx): `src/app/(voting)/voting/page.tsx`
- [MongoDB](https://github.com/jadabkkd/gof-saleforce/blob/main/src/libs/mongodb.ts): `src/libs/mongodb.ts`

### Other components

- **Operator user**

## Connections

- Operator user → Sales workspace: uses
- Operator user → Process workspace: uses
- Operator user → COA workspace: uses
- Operator user → Specifications: uses
- Operator user → Ingredient management: uses
- Operator user → Stock activity: uses
- Operator user → Production monitoring: uses
- Operator user → Customer operations: uses
- Operator user → Financial analysis: views
- Operator user → Employee voting: uses
- Request state → Request actions: references (evidence: `src/app/_actions/ProductionRequest/doFiltProcRequest.ts`)
- Request lot search → Request actions: filters requests (evidence: `src/states/SerialLot/useSearchProdReq.ts`)
- Request lot search → Production orders: fetches request data (evidence: `src/states/SerialLot/useSearchProdReq.ts`)
- Serial lots → Lot persistence: saves lot (evidence: `src/modules/SerialLot/SerialLotManager.ts`)
- Lot persistence → MongoDB: reads and writes (evidence: `src/app/_actions/SerialLot/CreateLot/doSaveSerialLot.ts`)
- Request actions → MongoDB: queries (evidence: `src/app/_actions/ProductionRequest/doFiltProcRequest.ts`)
- Production orders → MongoDB: updates (evidence: `src/app/_actions/ProductionOrder/doUpdateMonitData.ts`)
- Production monitoring → Monitor updates: receives updates
- Process flows → MongoDB: queries flows (evidence: `src/app/api/process/filt-process/route.ts`)
- COA services → MongoDB: persists results
- Financial analysis → MongoDB: queries
