BREP_plm — a PLM server for the BREP CAD application
BREP_plm is a self-hosted product lifecycle management server: parts with
permanent identities and configurable numbers, revisions with a lifecycle,
explicit checkout, bills of materials, change orders and review, over one
embedded SQLite file. It serves its own browser UI and the document API that
the BREP CAD application saves and opens through, and it can host the CAD
application's web build on the same origin.
It is for a team that wants its CAD documents under revision control on a machine it runs, without a separate database server: one binary, one data directory.
Quick start
The first run creates plm-data/ and seeds one administrator, printing its
generated password once:
an administrator account was created:
username admin
password ...
this password is shown ONCE and is not recoverable.
brep-plm: listening on 127.0.0.1:8088
Open http://127.0.0.1:8088/, sign in as admin, and create a second
administrator before you lose the password. SQLite is compiled in, so there is
no system library to install.
What it does
- Parts and revisions. Part types number by counter (
CPART+ 9 digits by default), free text, an administrator's pattern, or a script. Revisions moveDraft → InReview → Released → Superseded | Obsolete; a released revision is immutable, and a draft is written only by the user holding its checkout. - Structure. Each revision's uses list, the indented and flat BOM with rolled-up quantities and costs, the diff between two revisions, and where-used.
- Change orders and review. A set of revisions released or obsoleted together after one review round, all or none; reviewers, a release gate, threaded discussion and an inbox.
- Catalog and sourcing. A category tree with inherited typed attributes, tags, manufacturers and suppliers, and each part's manufacturer part numbers with supplier offers and price breaks.
- Families and templates. Table-driven part families and template spin-out, with a bake queue for headless CAD workers.
- Attachments and workspaces. Files on parts and versioned per-user workspaces, with upload limits.
- Administrator scripts. JavaScript hooks (part number, revision label,
before and after release, review events) evaluated by
BREP_script_core, with an in-browser editor and a test run. A directory of scripts can live in git. - An audit log of every committed change, written in the same transaction.
- Security. PBKDF2 password verifiers, cookie sessions with CSRF tokens,
scoped API tokens (
Authorization: Bearer plm_…) for everything that is not a browser, a sign-in throttle, session limits, security headers, and optional native TLS.
Running it on a network
Behind a reverse proxy instead, serve plain HTTP on loopback and pass
--trust-proxy --secure-cookies on. --lock-script-editor turns the
in-browser script editor off whatever the settings say. brep-plm --help
lists every option, including the upload limits and the oldest CAD client
version the server accepts.
One server owns a data directory: a second one started on the same directory is refused and names the holder's process id. Each change is committed with a full fsync, so give the data directory a disk that is not busy with other syncing work if write latency matters.
Backup, restore and export
A backup is one .tar.gz holding a consistent SQLite snapshot, every revision
document, every attachment and the scripts directory, with a manifest of sizes
and SHA-256 hashes; restore checks it into an empty directory.
Hosting the CAD application
--cad-app <dir> (default <data>/cad-app) serves a web build of the BREP CAD
application at /cad/app/web/index.html, same-origin with the API. The
directory holds the build's web/ and pkg/ directories side by side;
upgrading the CAD application is a file drop into it, not a server release.
Embedding the server
The binary is a thin wrapper over the library, whose axum
router can be served by any host:
use SocketAddr;
use Arc;
use ;
async
This needs tokio (with macros and rt-multi-thread) and axum 0.7 beside
BREP_plm in your own manifest.
Licence
The Autodrop3d licence in LICENSE.md, shipped in the crate (license-file
in the manifest). It is not an SPDX licence: read it before you modify or
redistribute the crate.