# colelundstrom/printshopcrm architecture

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

- Interactive diagram: https://gitdiagram.com/colelundstrom/printshopcrm
- Repository: https://github.com/colelundstrom/printshopcrm

## Overview

PrintShopCRM is a self-hosted shop-management CRM for print decorators. The main workflow runs from customer and estimate management through production, art approval, invoicing, and job profitability; the README explicitly documents estimate-to-job conversion and approval-gated scheduling. The graph also preserves sales pipeline, pricing matrices, purchasing, capacity, shipping, and payment capabilities. Several backend modules are listed but not excerpted, so their internal call relationships are omitted rather than inferred.

Main entry points: [`public/js/views/estimates.js`](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/estimates.js) (Estimates), [`public/js/views/board.js`](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/board.js) (Production board), [`public/js/app.js`](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/app.js) (Shop application), [`public/js/views/invoices.js`](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/invoices.js) (Invoices & payments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Sales &amp; CRM"]
  node_contacts["Customers &amp; CRM<br/>[contacts.js]"]
  node_estimates["Estimates<br/>[estimates.js]"]
  node_pipeline["Sales pipeline<br/>[pipeline.mjs]"]
  node_search["Command search<br/>[search.js]"]
end

subgraph group_pricing["Pricing &amp; Finance"]
  node_quote_calc["Quote calculator<br/>[quote.js]"]
  node_price_matrices["Price matrices<br/>[matrices.js]"]
  node_pricing_logic["Shared pricing logic<br/>[pricing.js]"]
  node_invoices["Invoices &amp; payments<br/>[invoices.js]"]
  node_costing["Job costing<br/>[costing.mjs]"]
end

subgraph group_production["Production &amp; Fulfillment"]
  node_production_board["Production board<br/>[board.js]"]
  node_art_proofs["Art &amp; prepress<br/>[art-production.js]"]
  node_capacity["Capacity planning<br/>[capacity.js]"]
  node_production_calendar["Production calendar"]
  node_shipping["Shipping &amp; tracking<br/>[shipping.mjs]"]
  node_purchasing["Supplier purchasing<br/>[suppliers.mjs]"]
end

subgraph group_platform["Application Platform"]
  node_web_app["Shop application<br/>[app.js]"]
  node_browser_core["Browser core<br/>[core.js]"]
  node_sqlite[("Shop database<br/>[db.mjs]")]
end

subgraph group_integrations["External Services"]
  node_stripe["Stripe checkout<br/>[stripe.mjs]"]
  node_authorize_net["Authorize.net checkout<br/>[authorizenet.mjs]"]
end

node_shop_staff(("Shop staff"))

node_shop_staff -->|"manages shop"| node_web_app
node_web_app -->|"routes views"| node_browser_core
node_web_app -->|"opens CRM"| node_contacts
node_web_app -->|"opens estimates"| node_estimates
node_web_app -->|"opens pipeline"| node_pipeline
node_estimates -->|"prices quotes"| node_quote_calc
node_estimates -->|"selects matrix"| node_price_matrices
node_estimates -->|"calculates totals"| node_pricing_logic
node_estimates -->|"converts to job"| node_production_board
node_estimates -->|"syncs opportunity"| node_pipeline
node_production_board -->|"manages proofs"| node_art_proofs
node_art_proofs -->|"reschedules approval"| node_production_calendar
node_production_board -->|"checks schedule"| node_capacity
node_production_board -->|"tracks parcels"| node_shipping
node_production_board -->|"checks purchase orders"| node_purchasing
node_production_board -.->|"supports job billing"| node_invoices
node_invoices -.->|"offers hosted checkout"| node_stripe
node_invoices -.->|"offers hosted checkout"| node_authorize_net
node_production_board -->|"feeds job profitability"| node_costing
node_contacts -.->|"stores shop records"| node_sqlite
node_estimates -.->|"stores estimates"| node_sqlite
node_costing -->|"reads job data"| node_sqlite
node_search -->|"navigates commands"| node_web_app

click node_web_app "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/app.js"
click node_browser_core "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/core.js"
click node_sqlite "https://github.com/colelundstrom/printshopcrm/blob/main/lib/db.mjs"
click node_contacts "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/contacts.js"
click node_estimates "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/estimates.js"
click node_pipeline "https://github.com/colelundstrom/printshopcrm/blob/main/lib/pipeline.mjs"
click node_search "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/search.js"
click node_quote_calc "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/quote.js"
click node_price_matrices "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/matrices.js"
click node_pricing_logic "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/shared/pricing.js"
click node_invoices "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/invoices.js"
click node_costing "https://github.com/colelundstrom/printshopcrm/blob/main/lib/costing.mjs"
click node_production_board "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/board.js"
click node_art_proofs "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/art-production.js"
click node_capacity "https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/capacity.js"
click node_production_calendar "https://github.com/colelundstrom/printshopcrm/blob/main/lib/production-calendar.mjs"
click node_shipping "https://github.com/colelundstrom/printshopcrm/blob/main/lib/shipping.mjs"
click node_purchasing "https://github.com/colelundstrom/printshopcrm/blob/main/lib/suppliers.mjs"
click node_stripe "https://github.com/colelundstrom/printshopcrm/blob/main/lib/stripe.mjs"
click node_authorize_net "https://github.com/colelundstrom/printshopcrm/blob/main/lib/authorizenet.mjs"

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_contacts,node_estimates,node_pipeline,node_search toneBlue
class node_quote_calc,node_price_matrices,node_pricing_logic,node_invoices,node_costing toneAmber
class node_production_board,node_art_proofs,node_capacity,node_production_calendar,node_shipping,node_purchasing toneMint
class node_web_app,node_browser_core,node_sqlite toneRose
class node_stripe,node_authorize_net,node_shop_staff toneIndigo
```

## Components

### Sales & CRM

- [Customers & CRM](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/contacts.js): `public/js/views/contacts.js`
- [Estimates](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/estimates.js): `public/js/views/estimates.js`
- [Sales pipeline](https://github.com/colelundstrom/printshopcrm/blob/main/lib/pipeline.mjs): `lib/pipeline.mjs`
- [Command search](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/search.js): `public/js/views/search.js`

### Pricing & Finance

- [Quote calculator](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/quote.js): `public/js/views/quote.js`
- [Price matrices](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/matrices.js): `public/js/views/matrices.js`
- [Shared pricing logic](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/shared/pricing.js): `public/js/shared/pricing.js`
- [Invoices & payments](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/invoices.js): `public/js/views/invoices.js`
- [Job costing](https://github.com/colelundstrom/printshopcrm/blob/main/lib/costing.mjs): `lib/costing.mjs`

### Production & Fulfillment

- [Production board](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/board.js): `public/js/views/board.js`
- [Art & prepress](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/art-production.js): `public/js/art-production.js`
- [Capacity planning](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/views/capacity.js): `public/js/views/capacity.js`
- [Production calendar](https://github.com/colelundstrom/printshopcrm/blob/main/lib/production-calendar.mjs): `lib/production-calendar.mjs`
- [Shipping & tracking](https://github.com/colelundstrom/printshopcrm/blob/main/lib/shipping.mjs): `lib/shipping.mjs`
- [Supplier purchasing](https://github.com/colelundstrom/printshopcrm/blob/main/lib/suppliers.mjs): `lib/suppliers.mjs`

### Application Platform

- [Shop application](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/app.js): `public/js/app.js`
- [Browser core](https://github.com/colelundstrom/printshopcrm/blob/main/public/js/core.js): `public/js/core.js`
- [Shop database](https://github.com/colelundstrom/printshopcrm/blob/main/lib/db.mjs): `lib/db.mjs`

### External Services

- [Stripe checkout](https://github.com/colelundstrom/printshopcrm/blob/main/lib/stripe.mjs): `lib/stripe.mjs`
- [Authorize.net checkout](https://github.com/colelundstrom/printshopcrm/blob/main/lib/authorizenet.mjs): `lib/authorizenet.mjs`

### Other components

- **Shop staff**

## Connections

- Shop staff → Shop application: manages shop (evidence: `README.md`)
- Shop application → Browser core: routes views (evidence: `public/js/app.js`)
- Shop application → Customers & CRM: opens CRM (evidence: `public/js/app.js`)
- Shop application → Estimates: opens estimates (evidence: `public/js/app.js`)
- Shop application → Sales pipeline: opens pipeline (evidence: `README.md`)
- Estimates → Quote calculator: prices quotes (evidence: `public/js/views/estimates.js`)
- Estimates → Price matrices: selects matrix (evidence: `public/js/views/estimates.js`)
- Estimates → Shared pricing logic: calculates totals (evidence: `public/js/views/estimates.js`)
- Estimates → Production board: converts to job (evidence: `README.md`)
- Estimates → Sales pipeline: syncs opportunity (evidence: `lib/pipeline.mjs`)
- Production board → Art & prepress: manages proofs (evidence: `public/js/views/board.js`)
- Art & prepress → Production calendar: reschedules approval (evidence: `README.md`)
- Production board → Capacity planning: checks schedule (evidence: `README.md`)
- Production board → Shipping & tracking: tracks parcels (evidence: `README.md`)
- Production board → Supplier purchasing: checks purchase orders
- Production board → Invoices & payments: supports job billing
- Invoices & payments → Stripe checkout: offers hosted checkout (evidence: `README.md`)
- Invoices & payments → Authorize.net checkout: offers hosted checkout (evidence: `README.md`)
- Production board → Job costing: feeds job profitability (evidence: `README.md`)
- Customers & CRM → Shop database: stores shop records
- Estimates → Shop database: stores estimates
- Job costing → Shop database: reads job data (evidence: `lib/costing.mjs`)
- Command search → Shop application: navigates commands (evidence: `public/js/views/search.js`)
