Portfit: one piping model, seen as P&ID, iso and 3D, and calculated

A browser piping CAD for skids: a parts and materials library the customer extends without code, calculations attached to parts, lines and the whole skid, several users with versions and revisions, and an MCP server. Release A (assemblies, library, part calculations, revisions) after about 40–46 weeks; release B (schematic, lines, iso, PCF, skid calculations) after 69–77.

Status 24 Nov 2026: M0 built (layout, CI, model schema, validator, derive, pipeparts pinned; database, backups and restore drill ready to switch on) and the spike done: the model holds (three views of one line, routes in derive, patches and merge in two browsers; see docs/SPIKE.md), the rest proposed; revised after a review (what it found). Repository jeanole/portfit: docs/PLAN.md and the system design, docs/DESIGN.md. Sketches are wireframes; values in them are examples.

Weeks for one developer working with Claude, midpoints of the ranges; judgements, not measurements. Magenta lines: the two releases. The totals include the work the review found unscheduled.

One stored model; every view writes only its own part

What is stored is what the user decided: groups, components and their anchors, the port-to-port joints, the lines with what sits on them, the legs of each route with any corner choices, materials, calculations and their entered inputs, and the P&ID's positions. Everything that follows is derived by one function and never stored: generated pipes and fittings, every position, cut lengths, welds, BOM, sheets, PCF.

The P&ID gives the 3D its parts and their order, never their layout. The iso gives the 3D everything. A 3D edit changes sizes, gaps and leg lengths, never a P&ID symbol's position.

Principles

  1. One model, many views; stored is what was decided.
  2. Parts and materials are data, in pipeparts; Portfit edits and places them.
  3. A calculation proposes; it never changes the model by itself.
  4. Nothing is overwritten, and a rebuild drops no override: what loses its part is kept as an orphan.
  5. Dragging snaps in the browser; B-rep, sheets and calculations run in a worker.
  6. No AGPL/GPL code, no customer's content, every norm value with its source.
  7. Lengths in mm in the model; SI inside pipeparts.
  8. Every UI action is an MCP tool too, shipped with its milestone.
  9. One way in: UI and MCP commit patches through one validator.
Sheet 1 · The model
The model (stored)groupsskid, sub-skids, design datacomponentsplaced parts, anchors, materialjointsport ↔ port, gap, clocklinesnumber, DN, class, nodes in orderrouteslegs, and where the nodes sitcalcsmodule, where attached, inputspidsymbol positions onlyderived by derive(), never stored: pipes,fittings, every position, welds, cut list,BOM, sheets, PCF. Calculation resultsare kept beside the model, not in it.Diagram, flat (P&ID)topology: what connects to whatsizes, tags, line numbersits own 2D layoutDiagram, isometric (iso)the same line, now with its runlegs typed or drawncorners from the pipe class3Dplaced parts, snapped by portswelds proposedsheet · STEP · BOM · PCFcomponents, linesshownroutesshowngeneratedplace, params,gap, leg lengthEach view writes only its own part of the model; the 3D is always generated from it.
One model, three views. P&ID and iso write components, lines and routes; the 3D is generated and writes back only parameters, gaps and leg lengths.

One diagram in two layouts, and the 3D, share one tree and one undo

The P&ID and the iso are the same diagram, shown flat or isometric with a switch. The work goes flat first: draw what is connected, then switch to isometric, where an unrouted line opens as one straight run with its parts in order, and decide the legs and bends. Each layout keeps its own positions; the parts and their order are shared.

The tabs of a project: Diagram, 3D, Sheet, BOM, Calculations, History, Library. The top bar always names the revision being worked on. The tree is always on the left and shows generated parts in grey, because they follow the route rather than being placed; properties are always on the right. The sketches still show the earlier pane layout in places.

Sheet 2 · App layout (3D)
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedTreePropertiesSkid 7Line 50-P-101 · DN 50 · CS150-ENF-1 Flange WN DN50 PN16G-1 Gasket IBCpipe 1 376 mmE-1 Elbow 90° 3Dpipe 109 mmHV-101 Ball valve, weld endspipe 109 mmE-2 Elbow 90° 3Dpipe 776 mmF-2 Flange WN DN50 PN16Line 25-P-102 · DN 25not placed: FT-101generated parts in grey: they follow the routeHV-101 selectedopen portviewdrag a part from the library onto a port: it snaps and takes the size stated thereLibrarysearch: flange dn50▸ PipesEN 10220 · ASME B36.10▸ FlangesEN 1092-1 · ASME B16.5▸ FittingsEN 10253-2 · ASME B16.9▸ Gaskets & bolting▸ Valves · our catalogue3 families, imported STEP▸ Our table parts2 families▸ Instruments+ New table part+ Import STEPSpec CS150-EN · mm · 10 parts · 8 welds proposed · 1 open port · version 14
The 3D pane is the existing editor: tree and properties left, library right, parts snap port to port and take the size the target states.
Sheet 3 · P&ID
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedSymbolsVesselsPumpsValvesControl valvesInstrumentsFittingsOrificesOff-pageOur catalogue (3)T-101P-101HV-101FE-101FT101FV-101to E-20150-P-101-CS15025-P-102drag symbols in, draw lines between their nozzles; the line takes DN and spec onceFlat (P&ID)IsometricLine 50-P-101Number50-P-101DN / PN50 / 16Pipe classCS150-ENMediumwaterDesign16 bar(g) · 120 °CFromP-101 dischargeTooff-page E-201In the modelcomponents 3 on the lineroute 3 legs, closes (Iso)3D 3 of 3 placedLay out isometricShow in 3D
The flat layout drives topology. A line carries number, DN, pipe class, medium and design data once; its panel says how far it is routed (iso) and placed (3D).
Sheet 13 · From flat to isometric
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedP-101 dischargeplacedto E-201placedHV-101not positionedFE-101not positionedFV-101not positionedUEWDclick the run to bend it here:pick the direction of the next legNFlat (P&ID)Isometricnot routed: drawn as one run, not to scale› N 1500 ▍type the first leg, or click the run to bend it · parts keep their orderLine 50-P-101not routeddrawn flat on 24 NovOn the line, in orderP-101 dischargestart · placedHV-101 Ball valvenot positionedFE-101 Orifice platenot positionedFV-101 Control valvenot positionedE-201 nozzleend · placedFrom start to end1 500 north · 900 east · 600 upfrom where the two nozzles are placed: any legsthat add up to this close the route (examplevalues)Then1 give the run its legs and bends2 slide each part onto a leg3 corners, pipes and welds follow from the pipe class; the 3D is generatedBack to flat (P&ID)
The line of sheet 3, switched to isometric before it is routed. One straight run, not to scale, with its parts in order. Clicking the run bends it; the panel says how far apart the two ends are, which is what the legs must add up to.
Sheet 4 · Iso
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedN 1 500U 600E 90012345678HV-101NFlat (P&ID)Isometric› N 1500 U 600 E 900 ▍Enter ends the leg · Tab: branch · 45° with ShiftRoute of 50-P-101LegDirLengthEnds with1N1 500elbow 90° 3D2U600elbow 90° 3D3E900flange WNCut listP11 500 − 48 − 761 376 mmP2a300 − 76 − 115109 mmP2b300 − 115 − 76109 mmP3900 − 76 − 48776 mmtake-offs from the pipe class: elbow 3D DN 5076 mm, flange WN 48 mm; HV-101 230 mm faceto face (example values, weld gaps left out)Welds 8 proposed · all shopIso sheet (PDF)PCF
The isometric layout drives the route. The same line as on sheet 3, now with its bends. Legs are typed (N 1500 U 600 E 900) or drawn; corners, take-offs and the cut list come from the pipe class; every joint gets a weld balloon.
Sheet 5 · How the 3D follows
1 · RouteN 1 500U 600 (valve at 300)E 900ends: P-101 · E-2012 · Pipe classCS150-EN, DN 50:pipe 60,3 × 2,9corner → elbow 90° 3Dend → flange WN 11take-offs 76 / 48 / 1153 · Solvercorner: insert the fittingleg: pipe = leg − take-offsinline: split the pipejoint every pair of ports4 · 3D (derived)F-1 · P1 1 376 · E-1 · P2a 109HV-101 · P2b 109 · E-2P3 776 · F-2placed port to port (mate)legspartsportsThen, also derivedwelds W1 … W8cut list · BOMiso sheet · PCF · STEPStoredlegs, corner overrides (bend R = 3D instead of an elbow), inline components and wherethey sit, the line's spec and DN.Never storedthe generated pipes, fittings and their positions: a change of a leg or of the class rebuilds them.
Route plus pipe class gives parts; ports place them. A changed leg or class rebuilds the generated parts, so they are never stored.

The library is the product's promise: parts without code

Table parts

A family is a table with any key (DN/PN, NPS/Class, a size code) and a template whose measurements are bound to its columns. Features: revolve, hole pattern, sweep (elbows), branch (tees), extrude. Every row is built and checked on save. Cells are text with their source; CSV in and out; every save a version.

Imported parts

A manufacturer's STEP per size. The worker reads its openings: bores, and flange faces with their bolt circle, which give DN/PN back. The user confirms or changes each one in a port editor. Arbitrary STEPs are never deformed to make other sizes: one file per row.

Sheet 6 · Table part editor
PortfitLibrary · Weld-neck flange (our standard)Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedFamily Weld-neck flange, our standardkey DN, PN · 42 rows · features: revolve + hole pattern · 2 portsProfile (half section)axisn × d2DKd3bHface portflange face · DN, PN, Dweld portpipe end · Ø d3, sdraw lines and arcs; name a measurement by a column or an expression, s = (d3 − di)/2Preview◂ DN 50 · PN 16 (row 3 of 42) ▸✓ 42 of 42 rows build ✓ ports on the surface ✓ wall > 0DNPNDKnd2bHd3sSource251611585414163833,72,6our sheet W-11, rev. 34016150110418164248,32,6our sheet W-11, rev. 35016165125418184560,32,9our sheet W-11, rev. 36516185145818184576,12,9our sheet W-11, rev. 3cells as text with their source · CSV in and out · every save a version · example values
A drawn profile, measurements named by columns. The ports are declared on the template, so every row snaps like a norm flange.
Sheet 7 · STEP import
PortfitLibrary · Ball valve, manufacturer XDiagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedvalve_dn50_pn16.step · 2,4 MB · read in the worker123drag to turn · click an opening to select itRecognized openings1flange face Ø 165, bolt circle 125, 4 × Ø 18→ EN 1092-1 DN 50 PN 16Flange face ▾Flip axisThread…✓2flange face Ø 165, bolt circle 125, 4 × Ø 18→ EN 1092-1 DN 50 PN 16Flange face ▾Flip axisThread…✓3cylinder Ø 22, nothing in frontthe stem: not a connectionignored ▾Flip axisThread…✕Family rows (one file per size)KeyFilePortsFace-to-faceKvMassDN 25 PN 16valve_dn25_pn16.step2 of 2 ✓160502,9 kgDN 40 PN 16valve_dn40_pn16.step2 of 2 ✓2001605,6 kgDN 50 PN 16valve_dn50_pn16.step2 of 2 ✓2303408,1 kgDN 65 PN 16no file yet · uploadexample values · each file's ports are checked against its row (bore and bolt circle against DN/PN)
Openings recognized, then confirmed. Each file's ports are checked against its row's DN and PN.

Materials

Every part has a material selector: pipeparts' grades plus the organization's own, every value with source and edition, filtered by the part's product form and by what the line's pipe class allows. The default comes from the pipe class per part kind; an override is shown as one. Calculations, BOM, weight and PED classification read it, and a change marks their results stale.

Sheet 11 · Material selector
Properties · E-1 Elbow 90° 3DFamilyElbow 90° 3D, EN 10253-2 type BSizeDN 50 · 60,3 × 2,9Line50-P-101 · CS150-ENTag—MaterialP265GH · EN 10216-2 ▾from pipe class CS150-ENCertificate3.1 per EN 10204 ▾What calculations readf at 120 °C138 N/mm²t_min−10 °C at 2,9 mmdensity7 850 kg/m³values with source and edition; example valuessearch: 265form: seamless pipe / fitting ×allowed by CS150-EN ×T 120 °C ×GradeStandardFormf at 120 °CSourceP265GHEN 10216-2pipe, seamless138EN 13480-2 Anh. BP235GHEN 10216-2pipe, seamless123EN 13480-2 Anh. BP265GHEN 10253-2fitting138EN 13480-2 Anh. B16Mo3EN 10216-2pipe, seamless180EN 13480-2 Anh. B1.4571EN 10216-5pipe, seamless171EN 13480-2 Anh. BA106 Gr. BASME SA-106pipe, seamless—no S in the libraryGreyed: not allowed by the line's pipe class. Choosing one anyway is an override:the part shows it, the PED and wall-thickness calculations go stale and re-run.+ Add material to our libraryMaterials: pipeparts' norm list (grades, forms, p/T ratings) plus the organization's own,each value with its source and edition. Defaults come from the pipe class per part kind;a part can override; a whole line or sub-skid can be set at once.
Material from a filtered list. Greyed grades are not allowed by the pipe class; the values a calculation will read are shown under the selector.

Calculations hang in the tree where they belong and read the model

A calculation is dropped onto a part, a line, a sub-skid or the skid, or offered by a part family. It sits in the tree under what it is attached to, with its status: ✓ fulfilled, ✗ not fulfilled, ↻ stale, … incomplete. A group's badge sums those below it.

Each input comes from the first source that has it: entered, part, line, group, another calculation, default. It is shown with that source. A changed source marks the result stale.

A result can propose values: a plate thickness, a schedule, a bore, a bolt size, a material. Applying one is an ordinary, undoable edit; nothing is written by itself.

Reports: per calculation as PDF or Word, German or English. Per skid, a dossier of everything below it with a status summary, frozen with an issued revision. In the long run a hydraulic network over the P&ID topology calculates the whole skid.

Sheet 9 · Calculations in the tree
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedTreePropertiesSkid 7✓Weight and centre of gravity412 kg…PED classification, per line1 input missingPump module (sub-skid)✓Pressure drop, suction side0,18 barLine 50-P-101 · DN 50 · CS150-EN✓Pressure drop and velocity0,42 bar✓Wall thickness, all parts8 of 8F-1 Flange WN DN50 PN16↻Flange jointline changedFE-101 Orifice plate✓Orifice, ISO 5167d 32,41✗Plate thicknesse 3 < 4,6HV-101 Ball valvepipe 1 376 mmƒ = a calculation, attached where it was dropped;a group's badge sums those below itPlate thickness · FE-101module blendenplatte, Rechnung v4 · EN 13480 methodnot fulfilledInputValueFromΔp across the plate2,4 barOrifice, ISO 5167p₁ upstream16 bar(g)line 50-P-101Temperature120 °Cline 50-P-101Bore d32,41 mmOrifice, ISO 5167MaterialP265GHpart FE-101Plate thickness E3 mmpart FE-101Corrosion allowance1 mmenteredResultrequired thickness e_req = 4,6 mmexisting E = 3 mm → not fulfilledProposedSet FE-101's plate thickness to 5 mm (next size ≥ 4,6 mm)Apply to the partDismissan edit like any other: undoReportPDFWordDeutsch | EnglishVariation…every input names its source; a changed source marks the result stale (↻)and nothing is written into the model without ApplyCalculationsOn a partƒ Wall thickness (pipe, bend, reducer, cap)ƒ Flange jointƒ Boltingƒ Orifice, ISO 5167ƒ Plate thicknessƒ Opening reinforcementOn a lineƒ Pressure drop and velocityƒ Wall thickness, all partsƒ Blowdown through a deviceOn a skid or sub-skidƒ Weight and centre of gravityƒ PED classificationƒ Volume and blowdownƒ Hydraulic network (later)drag onto a part, line or group in the tree,or let a part's family name its usual onesSkid 7: 8 calculations · 5 ✓ · 1 ✗ · 1 stale · 1 incomplete · Skid report (PDF)
Every input names its source. The plate thickness reads Δp and bore from the orifice calculation, p and T from the line, material and E from the part, and proposes 5 mm.
Sheet 10 · Read, run, report, propose
Modelpart: size, material, Eline: p, T, medium, flowgroup: members, volumeresults of other calcsentered overrides1 · Inputseach from the first sourcethat has it: entered › part› line › group › defaultshown with its sourcemissing → incomplete2 · Runmodule + versionas a job in the worker(calc, pure)result stored with thehash of its inputs3 · Resultverdict ✓ / ✗ per checkvalues, limits, sourcesreport PDF / Word, de / enproposals for the modelreadjobApply a proposal: an ordinary model edit, with undo (never automatic)a changed source → its results stale ↻Calculations feed each other, up to the whole skidOrifice ISO 5167part FE-101Plate thicknesspart FE-101Pressure dropline 50-P-101Hydraulic networkskidSkid reportall of itd, ΔpΔp of the plateper line
Calculations feed each other up to the skid. Modules are code, versioned and tested; existing modules and the existing report engine are where they start.
LevelFirst modulesLater
Partwall thickness, flange joint, bolting, orifice ISO 5167, plate thickness, opening reinforcementnozzle loads
Linepressure drop and velocity, wall thickness of all its parts, blowdown through a devicewater hammer
Skidweight and centre of gravity, PED classification, volume and blowdownhydraulic network; stress via PCF to ROHR2 / CAESAR II

Several users, every change a version, revisions issued and compared

Users and rights: organizations, roles (view, edit, calculate, approve, admin), per-project sharing, a guest link for a customer. Several people open one project. A save is a patch: what changed, per object and field. The server merges it with what others saved since and asks only when two people changed the same field or the merged model breaks a rule.

Versions: every save, with who, when and the change in words, also for MCP edits. Restore makes a new version. Running a calculation makes none.

Revisions: draft, issued, approved by a second person. Issuing has a gate (no stale or incomplete calculation, everything rendered) and freezes model, results, reports, sheets and weld numbers; sheets carry the revision index. Two revisions compare as a change list and a coloured 3D.

MCP: an endpoint per organization, OAuth per user, the user's rights; tools follow the UI. Issuing and approving stay with people.

Sheet 12 · History and revisions
PortfitSkid 7 · Rev B draft · Line 50-P-101Diagram3DSheetBOMCalculationsHistoryLibrary↶ ↷ savedAMJKMCPHistory · Skid 7RevisionsRev Bdraftopen since 21 NovRev Aissuedapproved by J. K., 14 NovIssue Rev B…Compare A ↔ BVersions (autosaved)15:42 · A. M.FE-101 plate thickness 3 → 5 mm (from calculation)15:40 · MCP · A. M.FE-101 corrosion allowance 0 → 1 mm15:31 · J. K.line 50-P-101: leg 2 600 → 650 mm14:58 · A. M.E-1 material P265GH → 1.4571 (override)11:20 · A. M.added HV-101 Ball valve on leg 2restore = a new version from an old one; nothing is ever overwrittenCompare Rev A ↔ Rev B (draft)6 changes · 3 parts · 1 line · 2 calculationschangedFE-101 Orifice plateplate thickness 3 → 5 mmchangedE-1 Elbow 90° 3Dmaterial P265GH → 1.4571changedline 50-P-101leg 2 600 → 650 mm; P2a, P2b re-cutaddedHV-101 Ball valveon leg 2 at 300 mmre-runPlate thickness✗ → ✓re-runWall thickness, all parts✓ → ✓addedchangedissued revisions are frozen: model, results, reports and sheets as issued
Who changed what, in words. An MCP edit is a version like any other, marked as made through MCP.

Model v0 stores decisions, not geometry

One placer per part. A part is placed by an anchor (equipment, the first part of an assembly), by a joint to a placed part, or by a route. Two is an error; none is "not placed".

Routes close or say why not. A leg with no length is free and takes what is left to reach the line's end. A route that cannot close says by how much; nothing is stretched silently.

Generated parts have addresses such as L1/s2/corner. Legs have ids, so a rebuild renames nothing. Overrides and calculations hang on addresses and become orphans, not nothing, when their part goes.

Topology is stored once, in the lines: ends and the nodes on them in flow order. Branches are nodes; a reducer is a component. Results of calculations are kept beside the model, found by the hash of their inputs.

{
  "schema": "portfit-model", "version": 0,
  "units": {"length": "mm", "pressure": "bar(g)", "temperature": "°C",
            "massflow": "kg/s"},
  "groups": [                                // the skid and its sub-skids
    {"id": "g1", "name": "Skid 7"},
    {"id": "g2", "name": "Pump module", "parent": "g1",
     "place": {"at": [2400, 0, 0], "rot": [0, 0, 0]},   // a sub-skid moves as one
     "design": {"p": 16, "T": 120},          // design data for what is under it
     "materials": {"pipe": {"grade": "1.4571", "standard": "EN 10216-5"}}}
  ],                                         // … and a material per part kind
  "specs": ["CS150-EN"],                     // pipe classes used, from the library
  "components": [
    {"id": "c0", "tag": "P-101", "group": "g2",
     "family": "org:pumps/cp-50", "key": {"size": "50-200"}, "params": {},
     "place": {"at": [0, 0, 400], "rot": [-90, 0, 0]}}, // an anchor: the only stored positions
    {"id": "c1", "tag": "HV-101", "group": "g1", "line": "L1",
     "family": "org:valves/ball-dn50",       // pipeparts family or an organization family
     "key": {"DN": 50, "PN": 16}, "params": {},
     "material": {"grade": "P265GH", "standard": "EN 10216-2",
                  "certificate": "3.1"}},    // absent = from the line, its group or the class
    {"id": "c7", "kind": "reference", "name": "Frame", "group": "g1",
     "file": "blob:9c1e…",                   // a STEP shown for context: no ports, not in the BOM
     "place": {"at": [0, 0, 0], "rot": [0, 0, 0]}}
  ],
  "joints": [                                // only between two stored components mated directly
    {"id": "j1", "a": {"c": "c0", "port": "n1"}, "b": {"c": "c2", "port": "face"},
     "gap": 0, "clock": 0, "seam": {"auto": true}}
  ],
  "lines": [
    {"id": "L1", "number": "50-P-101", "spec": "CS150-EN", "DN": 50, "group": "g1",
     "medium": "water", "design": {"p": 16, "T": 120}, "flow": {"m": 2.5},
     "from": {"c": "c2", "port": "weld"}, "to": {"c": "c9", "port": "a"},
     "nodes": ["b1", "c1", "c4"],            // what sits on the line, in flow order:
                                             // components and branch points
     "materials": {},                        // a material per part kind for this line
     "overrides": {                          // on generated parts, by address in this line
       "s1/corner": {"material": {"grade": "1.4571", "standard": "EN 10253-4"}}}},
    {"id": "L2", "number": "25-P-102", "spec": "CS150-EN", "DN": 25, "group": "g1",
     "from": {"line": "L1", "node": "b1"},   // a branch: its fitting from the class's branch table
     "to": {"c": "c12", "port": "a"}, "nodes": []}
  ],
  "routes": [
    {"line": "L1",
     "legs": [{"id": "s1", "dir": "N", "len": 1500},    // corner at its end: from the pipe class
              {"id": "s2", "dir": "U", "len": 600,
               "corner": {"kind": "bend", "xD": 3}},     // … or chosen: a bend, R = 3 × D
              {"id": "s3", "dir": "E", "len": null}],   // free: takes what is left to reach "to"
     "at": [{"node": "b1", "leg": "s1", "at": 800, "dir": "W"},
            {"node": "c1", "leg": "s2", "at": 300}]}    // the node's centre, from the leg's start
  ],
  "calcs": [                                 // attached to a component, a generated part,
    {"id": "k1", "module": "plate_thickness", //   a line or a group
     "on": {"c": "c4"},
     "inputs": {"corrosion": 1.0}},          // only what was entered; the rest is read
    {"id": "k2", "module": "wall_thickness", "on": {"part": "L1/s1/corner"}, "inputs": {}}
  ],
  "pid": {
    "symbols": {"c1": {"x": 420, "y": 180, "rot": 0}},
    "lines": {"L1": {"points": [[120, 180], [700, 180]]}}
  }
}

The browser places, the worker computes, pipeparts knows the parts

Sheet 8 · Architecture
Browser · web/ (React, TypeScript, three.js)P&ID paneSVG editorIso paneSVG editor3D panethree.js, mate.tsLibrary editortables, sketcherModel clientundo, patchesserver/ (Python)API and MCP tools: one service layer, one validatorcommits: patch, merge per object, versions · revisionsderive: route solver, placement, welds, cut list, BOMlibrary · calculation bindings · job queueworker (one job, one process)pipeparts-cad: B-rep, STEP, display meshessheets: HLR projection, iso sheetSTEP reads, port recognitioncalc (pinned versions) · reportspipepartstables, families, ports, fits(), materialsstdlib only, SI insidePostgres and filesorganizations, users, commits, revisions,library, results, jobs · files by content hashother tools (later)imports pipeparts and Portfit's corepatches, job requests · MCP clients come in here toohead changes, derived, meshesjobspart datareads, writesgeometry
No OpenCascade in the web process. B-rep, STEP, sheets, STEP reads and calculations run as jobs, one process each. Snapping while dragging stays in the browser; derive runs in Python on the server, one implementation for UI, MCP, sheets and exports. The design behind this sheet is in docs/DESIGN.md.
PartWhat it isComes from
web/React, TypeScript, Vite; three.js viewer; P&ID and iso as SVG editorsthe existing 3D editor and viewer
server/Python API: organizations, users, projects, commits and merge, revisions, library, derive (route solver, placement, welds, cut list, BOM), calculation bindings, jobs, MCPexisting code: the editor's routes, accounts, autosave, the MCP pattern
workerB-rep, STEP, HLR sheets, STEP reads, port recognition, calculationsexisting code: job runner, STEP reader, assembly sheet
calcpure, versioned calculation modules (numpy, scipy, CoolProp)existing calculation modules, cleaned of any customer's names
reportsone report model → PDF and Word, German and Englishthe existing report engine
pipepartstables, families, ports, fits(), materials with p/T ratings, templates; pipeparts-cadexists, 0.11.0
storePostgres: organizations, users, projects, commits and snapshots, revisions, libraries, results, jobs; files by content hashnew

Two releases; a three-week spike proves the model first

#MilestoneWeeksDone when
M0Foundations: repo layout, CI, pipeparts pinned, model schema v0 with a validator, derive skeleton with fixtures, hosting with backups3CI runs both test suites; a model file validates; the empty app is deployed and a backup restores
SSpike "the model holds": throwaway; one line in three views, plus anchors, a route that must close, a branch, a reducer, an override on a generated part, two browsers saving patches, one calculation going stale3every rule of §4 is shown working or changed; the derive round trip is measured against 200 ms. If the model breaks here, fix it before M1
M13D editor, users, versions: the existing editor moved over; organizations, users, rights; commits with merge, version list in words, undo, restore; groups, lines as data, anchors; worker and jobs; STEP out, assembly sheet, BOM; weld proposal; MCP read and write tools9–11two users edit one project at once and only a true conflict is asked about; a flange–gasket–flange–pipe–elbow assembly is built, versioned, restored, drawn, and built again by Claude over MCP
M2Parts and materials library: library store with versions, releases and pin; materials with selector, defaults and overrides; STEP families with port recognition and editor; table parts (grid with CSV and history, profile sketcher, revolve + hole pattern + ports)10–12a flange family from an empty table and a drawn profile, a valve family from three STEP files, both snap to pipeparts' flanges; each part has a material; taking a new library release shows what changes first
C1Calculations on parts: calculation modules packaged as calc; bindings, resolver, results by input hash; tree nodes and status, inputs with sources, proposals with Apply; reports PDF/Word de/en; modules: orifice ISO 5167, plate thickness, wall thickness, bolting7–9a plate-thickness check on an orifice plate reads Δp from the orifice calculation, fails, proposes 5 mm, is applied and passes; its report names every source; a loop of calculations is refused
RRevisions: issue with gate, freeze, approve (four eyes), guest link, compare with change list and 3D colours, revision index on sheets, calculation dossier5Rev A issued and approved, Rev B compared to it, its sheets show the index; an issue with a stale calculation is refused; Rev A's files re-open unchanged
H1Pilot and hardening A: a design partner builds a real assembly; fixes; user guide; security pass over tenancy and uploads; restore drill3the partner's assembly is issued as Rev A without the developer's hands
Release A: assemblies, library, materials, part calculations, revisions≈ 40–46for makers of small assemblies
M3Lines and pipe class: pipe class as data with an editor (families, materials, branch table); routes with free legs and closure; solver for corners, ends, inline parts, reducers and branches; addresses, overrides and orphans; welds and cut list8–10six legs, one branch and one reducer give the 3D and cut lengths a hand calculation confirms; an override on an elbow survives a route change
P1Schematic: the diagram's flat layout in its basic form: symbols for the part kinds in use, lines between nozzles, parts in order, tags; the flat ↔ isometric switch with an unrouted line as a straight run4a line is drawn flat, switched to isometric as a straight run, given two bends, and its parts keep their order
C2Calculations on lines and skids: pressure drop and velocity, wall thickness of a line, weight and centre of gravity, PED classification, the skid's calculation dossier6a skid report lists every calculation with its status and is frozen with Rev C
M4Iso and documents: isometric editor starting from the schematic, iso sheet (dimensions, balloons, BOM, cut list, title block), weld list, spool split, PCF out (licence checked)8a PCF opens in Spoolyard and one more reader; a fabricator accepts the sheet
H2Pilot and hardening B: a design partner routes a real skid; fixes; guide; restore drill3the partner's iso sheets go to their shop
Release B: schematic, lines, iso, PCF, line and skid calculations≈ 69–77for prefabrication shops and engineering offices
M5Full P&ID: the remaining symbols, instrument bubbles and signal lines, off-page connectors, line list, tag rules; DEXPI later6the P&ID of a small skid is complete enough to issue; a 3D change shows in it
C3The whole skid: hydraulic network from the P&ID topology; blowdown of the skid's volume; PCF to stress tools—
M6After: STEP → template recognition; sweep, branch and extrude features for table parts; formula sheets; slopes; supports—
H1Pilot with a design partner; fixes; user guide; security pass; restore drill3see the milestone
H2Pilot with a design partner; fixes; guide; restore drill3see the milestone

Part calculations need parts and materials but no lines, and nobody ships drawings without revisions: both go into release A. Lines and pipe class carry the iso, PCF, line calculations and the network, so they come before M4, M5 and C3. The basic schematic (P1) comes before the isometric editor because the work goes flat first; instruments, signals and the line list wait for M5. Because lines come late, the spike proves their rules first.

Every milestone in pieces that can be finished and shown

Weeks are the middle of each milestone's range. Each package ends in something that can be tested by itself.

WPWhatWeeksDone when
M0.1Repo layout (web/, server/, worker), CI for both test suites, licence headers, pipeparts pinned0.5a push runs TypeScript and Python tests
M0.2Model schema v0 as JSON Schema; Python validator with the rules of §4; TypeScript types generated from it1a folder of good and bad model files passes and fails as marked
M0.3derive skeleton and the fixture format (model in, derived document out)0.5a one-flange model derives its part and position
M0.4Hosting: VM, Postgres, deploy script, nightly backup off the machine, error tracking, health check1deploy from CI; yesterday's backup restores on a second machine
S.1One line in three throwaway views: 3 P&ID symbols, 3 legs typed, 3D from pipeparts meshes1changing DN in the P&ID resizes the 3D
S.2In derive: anchors, a route between two fixed ports with a free leg, a branch, a reducer; addresses; an override that survives a rebuild; round trip timed1the route closes or says by how much; a moved leg keeps the elbow's material; time at 2 000 parts known
S.3Two browsers on one project: patches, merge, a true conflict, a rule broken only together; one calculation stale by hash1written record: what held, what changed in §4, the measured round trip
M1.1The existing editor moved: viewer, tree left, properties right, library drawer, port snapping2the editor's own test assembly builds in Portfit
M1.2Organizations, users, roles, sessions, project sharing; the data-access layer and its foreign-id test1.5a user of one organization gets nothing of another through any endpoint
M1.3Commits: patch, merge per object and field, validate after merge, snapshots, conflict dialog, live head over server-sent events2the merge fixtures pass; two browsers see each other's edits in seconds
M1.4History: versions in words from the patch, grouped per author and time; restore; undo and redo1every edit kind has its sentence; restore gives a new version
M1.5Groups and sub-skids, lines as data carriers, anchors and place, reference geometry1a sub-skid moves as one; a frame STEP shows and stays out of the BOM
M1.6Worker and job queue: keys, cache, limits, retries, progress; display meshes; STEP out1the same export asked twice runs once; a killed job is retried
M1.7Assembly sheet and BOM from the existing assembly sheet; weld proposal1the sheet of the test assembly matches its parts list
M1.8MCP: OAuth, read tools, write tools for everything in M11Claude builds the M1 assembly from a sentence and reads it back
M2.1Library store: family versions, releases, pin per project, "what changes" before taking a new release1.5a changed flange table shows the affected parts before it is taken
M2.2Materials: pipeparts' grades and the organization's own with sources; selector with filters; defaults by class, group and line; overrides shown1.5every part shows a material and where it came from
M2.3STEP families: upload, read in a locked-down worker process, opening recognition (bores, flange faces → DN/PN), port editor, rows checked against their key3three valve files become a family; a wrong file is flagged against its row
M2.4Table grid: any key, cells with source, CSV in and out, history142 rows pasted from a sheet, one changed, the change is in the history
M2.5Profile sketcher: lines and arcs, measurements named by columns or expressions2the weld-neck flange's half section drawn and bound
M2.6Features revolve and hole pattern; ports on the template; every row built and checked on save1.542 of 42 rows build; ports on the surface; snaps to a pipeparts flange
M2.7MCP tools for the library0.5Claude adds a row and a material and places the part
C1.1Calculation modules packaged as calc, any customer's names removed, versions installed side by side in the worker1the modules' reference cases pass from the package; two versions run on one worker
C1.2Bindings: a module's declared inputs and sources, the resolver, the input hash, the results store, the dependency graph with loop check1.5each input shows value and source; a loop is refused
C1.3Tree nodes and status, the panel, run as a job, stale by lookup, light modules re-run by themselves1.5changing a line's pressure turns its parts' calculations stale, then fresh
C1.4Proposals: offered by a result, applied as a patch with its origin0.5Apply is one undoable version "from calculation k1"
C1.5Reports: PDF and Word, German and English, sources and versions on every page1one report in four forms from one report model
C1.6Four modules wired and checked against references: orifice ISO 5167, plate thickness, wall thickness, bolting1.5each module's reference cases pass through the binding
C1.7MCP: attach, run, read a result and a report, apply a proposal0.5Claude runs the plate-thickness story end to end
R.1Revision states, the issue gate, the freeze manifest, files rendered and stored at issue1.5an issued revision's files have the hashes in its manifest
R.2Approve by another user; guest link (one revision, read-only, expiring)1the issuer cannot approve; a revoked link stops working
R.3Compare: change list by id and address; the 3D with changes coloured1.5Rev A against B lists exactly the edits made between them
R.4Revision index and change note on sheets; the calculation dossier with status summary1the dossier of Rev B lists every calculation and the open points
H1Pilot with a design partner; fixes; user guide; security pass; restore drill3see the milestone
M3.1Pipe class as data and its editor: families per part kind, materials, branch table2CS150-EN entered through the editor gives the take-offs of sketch 5
M3.2Route object: legs with ids, typed input, free legs, closure and its message1.5a route between two fixed nozzles closes; one that cannot says by how much
M3.3Solver: corners, end fittings, inline parts, reducers, branches; addresses3the fixtures with hand-calculated cut lengths pass
M3.4Overrides on generated parts; orphans listed, moved, deleted1a deleted leg leaves its elbow's override as an orphan
M3.5Welds along the route, cut list, BOM of a line; MCP route tools1.5Claude routes a line from "N 1500 U 600 E" and reads the cut list
P1.1Symbols for the part kinds in use (pipe, valve, flange pair, reducer, tee, pump, vessel, orifice), drawn by us1every part of the reference skid has a symbol
P1.2Flat editor: symbols, orthogonal lines between nozzles, tags, flow arrows; writes lines and nodes; MCP tools2the reference schematic drawn from empty; Claude adds a valve to a line and it shows as "not placed" in 3D
P1.3The flat ↔ isometric switch: an unrouted line as a straight run with its parts in order; the mismatch panel between the two1a valve moved past another in the flat layout is flagged on the route, not silently moved
C2.1Pressure drop and velocity of a line1.5against a hand calculation for water in DN 50
C2.2Wall thickness of all parts of a line, one result per part1the thinnest part is named
C2.3Weight and centre of gravity of a group1against the sum of the BOM
C2.4PED classification per line and of the assembly1.5the category and its reason for the reference skid
C2.5The skid's dossier, frozen with a revision1Rev C's dossier re-opens unchanged
M4.1Isometric editor: opens a line from its straight run; legs drawn or typed, corners, parts slid onto legs, branches3the reference line routed from its schematic without the keyboard, and without the mouse
M4.2Iso sheet: dimensions, weld balloons, BOM, cut list, title block, revision index3a fabricator reads it without questions
M4.3Weld list with frozen numbers; spool split at field welds; PCF out1.5a PCF opens in two readers; Rev B keeps Rev A's weld numbers
M4.4The organization's title block and sheet settings0.5a second organization's sheet carries its own block
H2Pilot with a design partner; fixes; guide; restore drill3see the milestone
M5.1The remaining symbols after ISO 10628-2, one per library family kind1.5every family in the library has a symbol
M5.2Instrument bubbles, signal lines, off-page connectors2the reference P&ID complete with its instruments
M5.3Line list; tag and line-number rules1the line list of the reference skid as a table and CSV
M5.4Both directions hardened: a part added in 3D or isometric appears flat, laid out automatically; P&ID sheet with title block and revision index1.5a valve added in 3D shows in the P&ID; the P&ID is issued with Rev C

The biggest risk is a model whose views fight each other

RiskAnswer
A route edit feels slow because the parts come from the serverthe centreline is drawn at once; derive per line, cached by hash; measured in S.2 against 200 ms, with TypeScript in the browser as the fallback
The model is wrong (views fight each other)the spike S proves each rule of §4, before any of it is built properly
Lines arrive after Release A and force changes to what A builtthe model carries lines, routes and addresses from M0; the spike exercises them; A's code never assumes "all parts are stored"
Calculations go stale in a cascade on every edit and the tree turns orangelight modules re-run automatically in dependency order; stale shown per node, summed per group; heavy ones re-run on request
A proposal applied by MCP surprises a userMCP writes are versions marked as such; issuing and approving stay with people
Merging per object is not enough and people still collideconflicts and refused saves are counted; locks per line are the next step
The table-part sketcher grows into a CAD of its ownM2 has revolve and hole pattern only; a profile is lines and arcs; the other features are M6
The existing editor or calculation modules do not move over cleanlyM1.1 and C1.1 are first in their milestones and find out within two weeks
A manufacturer's STEP crashes or stalls the readerone job, one process, with limits; the file is reported, the worker lives
An issued revision cannot be reproduced years laterits files are stored at issue with their hashes; old calc versions stay installed
P&ID grows into a project of its ownP1 holds only what drives the model; M5 only what an issued P&ID needs
Manufacturers' STEPs too heavy for the browserdecimated display mesh per body; the exact B-rep only in the worker
Sheets take minutes on a big modelper-line sheets, jobs in the worker, cache by model hash
Standards texts missing for strength modulesthey stay "provisional" on every report until checked
A customer relies on a wrong calculationreference cases per module version; every report names method, edition, versions and sources; terms say who checks
Licences: PCF, symbols, norm tables, material valuesPCF terms checked before M4; symbols drawn by us; values only with a source
Customers' data lost or seen by another customerbackups off the machine with restore drills; separation in code and database, tested from outside
One developerreuse of existing code; MCP tools let Claude test every feature end to end from M1; no part of the system needs daily care
The estimate69–77 weeks to Release B is over a year; the pilots after A decide whether B's order still holds

Six decisions are taken; ten are still the owner's

Decided on 24 Nov 2026: release A first, with the wider spike before M1; saves are patches merged per object; all work found in review is scheduled and the longer totals stand; derive runs in Python on the server, with the round trip measured in the spike against 200 ms; the P&ID and the iso are one diagram in two layouts, flat first, with the basic schematic built before the isometric editor; the server is Flask on Postgres.

  1. Licence: closed or open core. No AGPL/GPL code either way.
  2. Who it is for first, by name: a design partner for the pilot. Needed before M1 ends.
  3. Hosting: running on a shared Hetzner server, deployed by a self-hosted runner. Open: whether Portfit stays there once it has a database and customers, and where backups go off the machine.
  4. Which calculation modules first, and whether formula sheets are wanted.
  5. Approval rules: who may issue and approve; four eyes required; may a revision be issued with a failed calculation and a deviation note?
  6. Existing coded parts: which of the 33 come along as a reference set.
  7. Sign-up and billing: not before the first release.
  8. Interface language at first release: English and German together, or one first.
  9. Terms for calculations: what reports and contract say about who checks a result.
  10. Error tracking: Sentry's EU region (recommended, free plan to start) or GlitchTip on the server. Needed with M1.2.

What the review found, and where each gap is answered

Section numbers are those of docs/PLAN.md. "Later" means named and left out on purpose.

GapAnswer
Generated parts had no identity, yet carried overrides and calculationsaddresses and orphans, §4; M3.3, M3.4
No part had a position; routes were over-determinedanchors, one placer per part, free legs and closure, §4; S.2, M1.5, M3.2
Joints and routes both placed partsone placer per part; joints only between stored parts, §4
No branches or reducersnodes, branch lines, reducers as components, §4; M3.3
Topology kept in three placesonce, in lines; mismatch shown, §4; P1.3
Corner on the wrong leg, radius without unit, flow without unitcorner at the leg's end, xD, massflow in units, §4
No material per line or groupmaterials on both, §4, §6; M2.2
Calculation runs made versions; results sat in the modelresults beside the model by input hash, §7; C1.2
Whole-document saves collidepatches merged per object, §8; M1.3
Two solvers, browser and serverone derive, in Python on the server (decided, §11)
Calculation loops possibledependency graph with loop check, §7; C1.2
No rule for issuing with failed or stale calculationsthe issue gate, §8; R.1; decision 6
Weld numbers would change between revisionsfrozen at issue, §8; M4.3
MCP write tools only at week 30tools in every milestone, §2; M1.8 onward
Sheet and BOM in no milestone before M4M1.7
Packaging the calculation modules unscheduledC1.1
Hosting, backups, monitoring, tenant separation unscheduledM0.4, M1.2, §8; DESIGN §11, §12
No customer before week 55pilots H1 and H2; decision 2
The spike tested lines, then 30 weeks ran without themspike widened to every rule of §4
Navigation: no place for calculations and history; left pane changed its jobthe shell, §5; sketches to follow in M1.1
Skid frame, supports, insulation not mentionedreference geometry in v0, §4; supports and insulation later (M6)
Slopes, rolling offsets, imperial inputlater; said in §4 and DESIGN §3.5
Spools for prefabrication shopsspool split, M4.3
Tag and line-number rulesM5.3
Interface language and number formatthe shell, §5; decision 9
Project export, an organization's data on leavingDESIGN §11; with H1
Clash detectionlater, not planned
Liability for calculation resultsrisk table; decision 10
The P&ID came last although the work starts thereone diagram, two layouts, §5; P1 before M4
Sketches 1 and 8 behind the plan; slips in sketches 2, 3, 9, 12redrawn with this revision