Skip to content

niflaot/bomify

Repository files navigation

Bomify

Bomify

BOM (Bill of Materials) builder for production workshops — patterns, materials, cut optimization, and costing, in one workspace.

Checks GHCR Release Node >= 22 Next.js 16 TypeScript strict Prisma 7 License


Bomify centralizes the production workspace for a manufactured product: upload piece patterns (DXF), catalog reusable materials with pricing, define color/material combinations, and let the app compute optimized cutting layouts, material consumption, and real production cost/profit — then export it all as print-ready PDFs.

Features

  • Products & pieces — create products, upload DXF pattern pieces, and preview them directly in the browser.
  • Materials catalog — a shared, reusable catalog of materials (name, color, roll width, price per linear meter) attachable to any product.
  • Combinations — define named material/color combinations per product, assigning a material to each role a piece needs, plus a sale price used for profit calculations.
  • Additions — track non-material costs (hardware, labor, miscellaneous), grouped by category, each with a quantity and unit price.
  • Production cut optimization — automatic bin-packing of pieces onto material sheets, with efficiency, used area, and waste reporting per material.
  • Consumption — see exact material length, sheets required, and cost for any number of production units.
  • PDF exports:
    • Materials list — purchase-rounded material quantities and cost, plus additions grouped by category.
    • Pieces list — grouped by material or by piece, with optional rendered piece thumbnails.
    • Printable labels — one sticker per piece with an adjustable gap, ready to print and cut.
    • Ficha técnica (technical sheet) — exact (non-rounded) per-unit material cost, additions, sale price, and profit for the active combination.
  • Internationalization — full English and Spanish UI via next-intl.
  • S3-compatible storage — product photos and DXF files are stored in any S3-compatible bucket (AWS S3, MinIO, etc.).

Tech stack

Getting started

Prerequisites

  • Node.js >= 22
  • A PostgreSQL database
  • An S3-compatible object store (e.g. MinIO for local development)

Setup

npm install
cp .env.example .env   # then fill in DATABASE_URL and S3_* values
npm run prisma:generate
npm run prisma:migrate
npm run dev

The app runs at http://localhost:3000.

Environment variables

Variable Description
DATABASE_URL PostgreSQL connection string
NEXT_PUBLIC_SHEET_MARGIN_MM Laser-cut safety margin (mm) added around each material sheet
S3_ENDPOINT S3-compatible endpoint URL
S3_REGION Bucket region
S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEY Storage credentials
S3_BUCKET Bucket name
S3_PUBLIC_BASE_URL Public base URL used to build asset links
S3_FORCE_PATH_STYLE Set to true for path-style access (required by most self-hosted S3 servers)

Scripts

Command Description
npm run dev Start the development server
npm run build Build for production (standalone output)
npm start Run the production build
npm run lint Run ESLint
npm test Run the Jest test suite
npm run typecheck Run the TypeScript compiler in check-only mode
npm run prisma:generate Generate the Prisma client
npm run prisma:migrate Run Prisma migrations in development

Testing

npm run lint
npm run typecheck
npm test
npm run build

All four are run in CI on every pull request (see .github/workflows/checks.yml).

Docker

A production image is published to GitHub Container Registry on every push to main and on every v* tag (see .github/workflows/ghcr.yml):

docker pull ghcr.io/niflaot/bomify:latest
docker run -p 3000:3000 --env-file .env ghcr.io/niflaot/bomify:latest

On every container start, the entrypoint runs prisma migrate deploy before starting the server, so pending migrations are applied automatically — no manual step required after pulling a new image. prisma migrate deploy only applies pending migrations and is safe to run on every boot.

To build locally:

docker build -t bomify .

Project structure

src/
  app/         # Next.js routes and server actions (kept thin)
  views/       # Page-level UI composition
  layout/      # Shared layout shells (header, sidebar, canvas)
  components/  # Reusable UI building blocks
  core/        # Domain services, types, and framework-agnostic utilities
prisma/        # Schema and migrations
messages/      # en/es translation files

License

UNLICENSED — all rights reserved.

About

BOM calculator and product material NextJS tool.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages