How stagsz/scrubberproject-v2 works
Scrubberproject is a salesperson’s tool for producing wet-scrubber budget quotes from customer flue-gas data. Its central workflow is to enter design inputs, derive a typed tower model, and present that model as engineering views and an offer; the README says these outputs share one derivation. The app also supports saved projects, immutable revisions, share links, and shared cost history. The model flow is documented, while several app-to-core and view-to-view connections are inferred only at the capability level; unsampled wiring is omitted.
Main entry points: derive.ts Tower derivation · db.ts Project data store · route.ts Revision and share API · DesignBoard.tsx Design workspace
Components 24
Engineering model
- Sheet inputs
core/src/model/inputs.ts - Design envelope
core/src/model/design.ts - Tower derivation
core/src/model/derive.ts - Tower sections
core/src/model/sections.ts - Process sizing
core/src/process - Duty evaluation
core/src/duty - Layout geometry
core/src/layout
Design views
- Elevation drawing
core/src/drawing - Datasheet output
core/src/datasheet - Design workspace
app/components/DesignBoard.tsx
Project lifecycle
- Project API
app/app/api/projects - Revision and share API
app/app/api/projects/[id]/revisions/route.ts - Public share API
app/app/api/share/[token]/route.ts - Project data store
app/lib/db.ts
Accounts and history
- Authentication API
app/app/api/auth - Authentication services
app/lib/auth.ts - Account and session store
app/lib/db.ts
Cost and offer
- Offer document view
app/components/OfferDocument.tsx - Cost estimate
core/src/cost - Offer document
core/src/offer - Cost history API
app/app/api/history - History and FX logic
app/lib/history.ts
Other components
- Salesperson
- Customer
Connections 27
- Salesperson → Design workspace: enters inputs
- Design workspace → Sheet inputs: provides design data
- Sheet inputs → Tower derivation: validates inputs
- Tower derivation → Tower sections: derives tower
- Tower derivation → Process sizing: sizes process
- Tower derivation → Duty evaluation: evaluates duty
- Tower derivation → Layout geometry: derives layout
- Tower derivation → Elevation drawing: feeds drawing
- Tower derivation → Datasheet output: feeds rows
- Tower derivation → Cost estimate: feeds takeoff
- Tower derivation → Offer document: feeds offer
- Design workspace → Project API: saves design
- Project API → Design envelope: normalizes design
- Project API → Project data store: reads and writes
- Revision and share API → Project data store: freezes revisions
- Revision and share API → Design envelope: normalizes snapshots
- Revision and share API → Public share API: creates share links
- Public share API → Project data store: reads frozen revision
- Customer → Public share API: opens share link
- Offer document → Offer document view: renders document
- Salesperson → Offer document view: reviews offer
- Cost history API → History and FX logic: dispatches history actions
- History and FX logic → Project data store: stores jobs and FX
- Salesperson → Cost history API: manages cost history
- Salesperson → Authentication API: registers or signs in
- Authentication API → Authentication services: authenticates account
- Authentication services → Account and session store: stores credentials and sessions