STD Plus API
STD Plus is a backend API for managing materials, inventory, orders, and workflow in a glass manufacturing operation.Tech Stack
| Technology | Purpose |
|---|---|
| Node.js + Express 5 | HTTP server and routing |
| MongoDB + Mongoose | Database and ODM |
| JWT | Authentication (Bearer Token) |
| Socket.IO | Real-time WebSocket events |
| Zod | Request validation |
| Helmet / CORS | Security |
Base URL
/api.
Health: GET /api/health (no auth) — see Health check.
Documentation map
Use the Documentation tab for prose guides and the API Reference tab for every HTTP endpoint (OpenAPI + playground).Documentation tab
| Section | Pages |
|---|---|
| Getting Started | Introduction · Quickstart (install, env, scripts, integration tests) · Authentication (JWT, roles, permissions) |
| QR Scanning | QR Scanning · QR Check-in |
| WebSocket | WebSocket overview · WebSocket events |
API Reference tab
Endpoint groups match the server implementation (each group expands to list/create/update/delete and related routes where applicable): Health · Auth · Workers · Customers · Materials · Inventories · Material Logs · Requests · Withdrawals · Orders · Claims (including from-pane) · Panes · Pane Logs · QR Scanning (single-pane scan + batch scan) · Production Logs · Station Templates · Stations · Roles (including list permissions) · Notifications · Sticker Templates · Job Types · Pricing SettingsFeatures
REST API
Install, environment, npm scripts, and how to run integration tests against a live server.
QR Scanning
Pane routing, lamination, and station scan flow; links to scan API under API Reference.
Real-time WebSocket
Socket.IO path, rooms, and inbound events (
order:updated, pane:updated, etc.).Auth & RBAC
JWT, system roles, permission keys, and ownership rules.
API Reference
Full OpenAPI spec: try requests with the playground (Bearer auth).
Resources
Domain resources exposed by the API (see API Reference for HTTP operations on each):| Resource | Description |
|---|---|
| Workers | Staff accounts with authentication |
| Roles | Permission sets; system roles (admin, manager, worker) plus custom roles; GET /api/roles/permissions lists all permission keys |
| Customers | Client records with discount tracking |
| Materials | Material definitions with spec details |
| Inventories | Stock levels by material and type (Raw / Reuse); move endpoint |
| Material Logs | Audit trail for material movements |
| Requests | Customer purchase requests (auto requestNumber) |
| Withdrawals | Material withdrawals (auto withdrawalNumber WDW-…) |
| Orders | Production orders (auto orderNumber, stations, progress) |
| Claims | Defect/claim reports (auto claimNumber); create by order or from pane |
| Panes | Individual glass panes; laminate parent/sheet/survivor; list hides merged_into unless includeMerged=true |
| Pane Logs | Scan/action timeline per pane; material timeline endpoint |
| Production Logs | Legacy/action logs per pane and station |
| Station Templates | Configurable UI schemas (uiSchema) for station types |
| Stations | Work stations (colorId, optional laminate flag) |
| Notifications | Worker alerts (reference id/type, priority) |
| Sticker Templates | Label layouts (elements, dimensions) |
| Job Types | Catalog (code, sheetsPerPane, default glass types) |
| Pricing Settings | Singleton document: glass price maps, hole/notch pricing |