Overview

A server-rendered inventory manager that connects raw materials to finished products. Each product has a bill of materials describing the components needed to produce it.

Main workflows

  • Create and edit categories, materials, and products.
  • Record material purchases to replenish stock.
  • Produce finished goods by consuming the required quantities of materials.
  • Record sales by deducting finished-product stock.
  • Filter records by category and optionally protect changes with a shared password.

Implementation

Express handles routing and form submissions, EJS renders the pages, and express-validator supplies server-side form checks. PostgreSQL queries are separated from controllers and presentation templates.

The production operation checks material availability in SQL and uses a transaction to deduct materials and add finished goods together. Small browser scripts provide availability feedback on production and sales forms.

The repository includes database setup instructions and a seed script for local development. It requires a running Node.js server and PostgreSQL database.