|
|
Local, offline planner for polymer processing. Stack: |
npm install
npm run devOpen http://localhost:3000.
.
├─ src/
│ ├─ app.ts # Express app bootstrap
│ ├─ db.ts # SQLite connection + migrations
│ ├─ routes/ # HTTP routes (auth, experiments, reports, notes, etc.)
│ ├─ services/ # Business logic (auth/report/tasks/qualification/markdown)
│ ├─ repos/ # Data access layer (SQLite queries)
│ ├─ middleware/ # Auth/access/permission middlewares
│ ├─ domain/ # Domain math/helpers (DOE imports/stats/designs)
│ ├─ views/ # EJS pages + partials
│ ├─ public/ # Frontend assets (app.css, app.js, illustrations)
│ └─ tests/ # Integration tests
├─ dist/ # Compiled output (`npm run build`)
├─ im_doe.sqlite # Local SQLite database
├─ plan.md # Product/feature roadmap
└─ README.md
Create a .env file based on .env.example and set:
SESSION_SECRETADMIN_EMAILADMIN_TEMP_PASSWORDGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRET
- The first admin account is created on startup using
ADMIN_EMAIL+ADMIN_TEMP_PASSWORD. ADMIN_TEMP_PASSWORDis used only for initial seeding. Changing it later does not update an existing admin password.- After first login with the temp password, the admin must set a new password.
- Passwords are stored as bcrypt hashes (not in plain text).
- Roles:
admin,manager,engineer,operator,viewer. - Access:
admin/managersee all experiments and processes.Process Ownercan access and manage experiments in their process.Experiment Ownercan manage their experiment and sign/unsign report.- entity assignees get access to assigned experiment entities.
- Open process list on
/. - Open a specific process at
/<process_route_code>(e.g./injection). - Create an experiment in this process with recipes and machine assignment.
- Run the 6‑step Scientific Molding qualification (each step has its own setup + runs).
- Create multiple Detailed Optimization (DOE) studies under the same experiment.
- Configure factors, generate runlists, and enter run data.
- Review analysis (charts + heatmap + 3D when possible).
- Generate and edit reports (multiple reports per experiment).
- Track Tasks on a kanban board inside each experiment.
Planned: export data to CSV.
- Process list:
/ - Process page:
/<process_route_code>(configured in Process settings, admin-only) - Experiment canonical URL:
/<process_route_code>/<experiment_id> - Legacy routes like
/experiments/:idare still accepted and redirected/rewritten for compatibility. - Process settings are available on the process page (
Process settingsdialog), not on the process cards.
- Tasks live inside each experiment and are shown as a 4-column kanban (Init / In progress / Done / Failed).
- Create a task with title, description, due date, and owner (defaults to the experiment owner).
- Link tasks to entities:
- Qualification steps (1–6)
- DOE studies
- Reports (signature required)
- Task progress is calculated from linked entities; tasks without entities are driven by manual status moves.
- Reports can be signed inside the task popup (manager/engineer/admin).
- Each task has calendar actions: download .ics or open a Google Calendar link.
- Experiment owner (and admin/manager) can assign responsible users to:
- Qualification steps
- DOE studies
- Assignment creates/updates an automatic task for the assignee.
- Assignees get in-app notifications (with unread badge in top navigation).
- Profile page includes:
- assigned entities list (entity + experiment links)
- notifications feed with mark-read actions
- Report signature is restricted to the experiment owner.
- Two calendar surfaces are available:
My Calendaron/meProcess Calendaron/<process_route_code>(collapsible panel)
- Calendar events include:
- tasks (
task) - DOE runs (
run) - qualification runs (
qual_run)
- tasks (
- Date updates:
- drag one event to move one entity
- move a selected group by dragging one selected event
- bulk move selected events with
Move selected+ date input
- Selection model:
Shift/Cmd/Ctrl + clicktoggles entity selection- lasso selection (mouse rectangle) selects intersecting events
- click empty calendar area or
Clear selectionto drop selection
- Event click opens a details popup with:
- event type/status/date/owner
- link to run/task
- link to parent entity/experiment
- Process calendar remembers panel open/closed state in browser
localStorage.
- New DB entities:
process_typesprocesses(withowner_user_id,route_code,status)experiments.process_id
- Startup migration ensures:
- default type
Injection - default type
Compounding (Twin-Screw Extrusion) - default type
Coating - default process
Injection Default Process - default process
Compounding Default Process - default process
Coating Default Process - existing experiments are attached to default process
- default type
- Notes are available in a bottom drawer on:
- Experiment page
- Qualification step page
- DOE page
- Run page
- Report page
- Full note feed is available at
/experiments/:id/journal. - Notes are entity-linked (
experiment,qualification_step,doe,run,report,task). - Daily mode:
Ctrl/Cmd + Enterappends to your current daily note in the same entity context.Ctrl/Cmd + Shift + Enterforces a new note.
- Filters:
- text search
- date filter
- entity-only toggle (in entity drawers)
- Soft-delete is enabled for
admin/manager.
Qualification is process-specific (6-step pack is selected by process_type):
Injection(Scientific Molding):
- Rheology / Viscosity curve
- Cavity balance
- Pressure drop
- Cosmetic process window
- Gate seal study
- Cooling time optimization
Compounding(Twin-Screw Extrusion):
- RTD / Residence Time Stability
- SME Map / Energy Window
- Melt Temperature / Thermal History Map
- Feeding / Side-Feeder Qualification
- Degassing / Moisture Control
- Dispersion / Mixing Quality Check
Coating(Water/Solvent/Extrusion Coatings):
- Rheology Window
- Wetting / Surface Energy Check
- Coat Weight Calibration
- Drying / Curing Window
- Adhesion Qualification
- Barrier / Functional Check
Implementation notes:
- Qualification step UI is process-specific:
Injectionkeeps Scientific Molding step-specific screens.CompoundingandCoatinguse an independent generic step editor (runs + fields), without cavity/rheology/gate-seal injection UI.
- Each qualification step is edited independently (
/experiments/:id/qualification/:step): runs, values, assignee, and step fields are isolated per step.
- DOE generation/analysis uses one shared module across process types.
- Defaults are process-specific:
- active factors by
process_type, - active measured outputs by
process_type.
- active factors by
- Analysis reads
analysis_run_valuesfirst, and falls back torun_valuesby field code when needed (useful for migration/demo data).
Reference book (Amazon search):
- Robust Process Development and Scientific Molding (Suhas Kulkarni): https://a.co/d/aDv52KL
The current report plan lives at report_plan in the project root.
- Machine library now supports parameter tokens in the format
%machineId:paramId%. These tokens can be used inside qualification setup inputs and custom fields. - UI shows live previews for tokenized values; inputs keep the token, summaries display the resolved value.
- Step calculations resolve tokens at runtime (server + client), so values survive reloads.
- Machine edit page shows a small read-only token field next to each parameter for quick copy.
- Report generator now saves report configs per experiment (multiple reports per experiment).
- Report list lives inside the experiment, right after Detailed Optimization.
- Report editor (Editor.js) with seeded structure and embedded charts (rheology + process window).
- Editable report documents are stored in
report_documentsand opened via/reports/:id/editor.
The importer accepts two common formats:
Component,Recipe A,Recipe B
Resin 1,50,60
Resin 2,50,40
Additive,3,2
- Column 0: component name
- Other columns: recipe name with PHR values
,Recipe A,,Recipe B,
,phr,,phr,
Resin 1,50,,60,
Resin 2,50,,40,
Additive,3,,2,
- Row 1 contains recipe names
- Row 2 contains
phrunder recipe columns - Subsequent rows are components
- The SQLite database is
im_doe.sqlitein this folder. - Custom input/output fields are stored in the flexible
param_definitionsandrun_valuestables. - SCREEN design is a sampled factorial (labeled in-app). For higher rigor, add a dedicated generator.
npm run dev- start with hot reloadnpm run build- compile todist/npm run start- run compiled output
