1. Features Overview
๐ข Multi-tenant workspaces
PartsHub is multi-tenant โ one deployment can serve several independent companies (tenants), each with its own isolated database.
- Deep-link URL: open
/<tenant-slug>(e.g./company1,/company2) to land on the login page pre-selected for that tenant. - Login page requires a tenant. Opening
/without a slug shows a "No tenant selected" warning; the Sign in button is disabled. - Multiple memberships: if your account is mapped to more than one tenant, a picker appears right after signing in.
- Switch tenant at any time from the user menu (top-right) โ ๐ Switch tenant.
- The nav bar always shows the current tenant name:
<tenant> ยท PartsHub. - Super-admin users manage the tenant list via Manage โ ๐ข Tenants (super-admin) โ create, activate/deactivate, and assign users.
- Sign-out (manual or after idle timeout) lands on a friendly page that shows only the workspace you just left, so signing back in is one click.
- Per-tenant file storage โ all uploads live under
webui/uploads/<slug>/โฆ; a company2 file can't be reached from a company1 session (the DB row lookup rejects the ID first, before any disk access). - Each tenant gets a nightly automatic backup (retained 7 days by default).
๐ Multi-language
The UI runs in three languages: English, ็น้ซไธญๆ (Traditional), and ็ฎไฝไธญๆ (Simplified). Change it from the user menu โ ๐ Language. The choice persists per browser (localStorage). The user guide is also served in the matching language when opened via the โ Help menu.
๐ Interactive tours
Under โ Help โพ you'll find guided tours that highlight buttons and walk through common flows:
- ๐ Getting started (nav overview)
- ๐ฅ How to Stock IN
- ๐ Reassign ownership
- ๐ง Adjust stock
- ๐งฉ How to Browse Components
Each step points at the real UI element and can auto-navigate to the right tab. Great for onboarding new users.
๐งฉ Component Catalogue
The central record for every electronic part. Each component holds:
- Identity: SN (auto), MPN, manufacturer, category, description
- Electrical: value, specification, package
- Inventory: current stock quantity, storage bins, reorder point
- Files: datasheets, 3D models, design files (uploaded)
- Links: URLs to product pages or datasheet PDFs
- Lifecycle: active / archived status
Components are linked to BOMs, vendor quotes, stock moves, and PO lines. Archiving a component hides it from active lists but preserves all history.
๐ Stock Management
All quantity changes are recorded as moves, not direct edits:
| Operation | Effect | When to use |
|---|---|---|
| IN | Increases stock | Receiving parts from a supplier or PO |
| OUT | Decreases stock | Consuming parts for a project or production |
| Transfer | Moves between bins / ownerships | Rearranging physical storage or reassigning ownership |
| Adjust | Applies a signed delta (+ or โ) to current stock | Correcting stock after a physical count |
| Free Sample | Increases stock | Receiving a free sample โ no PO required |
Each move stores: component, quantity, bin, ownership, date, user, and optional notes.
Date & time: every stock form has a Date and Time field so moves can be backdated. If left blank the current timestamp is used. All users (not just admins) may set this.
Destination (Stock OUT only): an optional field to record where the parts are physically going (e.g. "Company B"). Appears in the history table and export.
Ownership: each move is tagged to an ownership (e.g. "Company A", "Company B"). This controls which owner's inventory changes when the move is recorded.
Sample moves: both free and paid samples use the sample movement type and appear with a teal pill in stock-move history. Sample unit costs are excluded from the Moving Average Cost calculation so they do not distort regular production pricing.
All moves appear in Stock-move history and can be undone via โถ Undo. Undoing a stock move deletes the original move record and reverses inventory โ no compensating row is left behind. Note: Free Sample moves cannot be undone โ use a Stock OUT to correct a mistake.
๐ท๏ธ Lot Tracking (Date Code / Vendor Lot / Expiry)
Every Stock IN creates a lot โ a distinct batch identified by:
- Date code โ optional, e.g.
2352(YYWW = 2023 week 52) or the exact date printed by the manufacturer - Vendor lot / lot number โ optional, distributor's per-reel identifier (e.g.
904042AJ2from a Digi-Key label) - Expiry date โ optional, for MSD-sensitive parts, batteries, adhesives, etc.
How lots are consumed: - Stock OUT and Production consumption deduct FIFO by expiry date (oldest first, NULLs last). "Legacy" lots (created during migration with no batch info) are drawn last so real-batch stock is used first. - Transfer and Reassign ownership preserve each lot's date code + expiry as it moves. - Adjustment with a positive delta creates a new lot; a negative delta consumes FIFO from existing lots.
Where to see lots: - Browse โ Inventory โ click the ๐ท๏ธ button on any row to see every active lot for that bin (date code, vendor lot, expiry countdown; expired = red, expiring < 30 days = amber). - Tools โ ๐ฐ๏ธ Lot expiry โ a filterable report of every lot ranked by days-to-expiry; export to xlsx.
๐ฆ Products and BOMs
A product is an assembly (PCB, module, finished good). Its Bill of Materials lists every component needed and the quantity per unit.
- BOMs can be imported via CSV or entered manually line-by-line.
- Each BOM line can carry reference designators (R1, C3, U5โฆ).
- BOMs are versioned (Rev field on the product).
- BOM lines can be grouped into named sections.
- The BOM list browse lets you search across all products at once.
๐๏ธ Build Feasibility
Tools โ Build feasibility answers: "How many units can I build right now?"
Given a product and a target quantity, the tool checks every BOM line against current stock and classifies each part: - โ Sufficient stock - โ ๏ธ Partial stock (this part limits the buildable quantity) - โ Zero stock (hard blocker)
The result shows the maximum buildable quantity and a per-line stock breakdown.
โ ๏ธ Build Shortfalls
Tools โ Build shortfalls shows a consolidated shortage list across all products โ useful for raising a purchase order to cover multiple builds at once.
๐งฎ BOM Cost Roll-up
Tools โ BOM cost roll-up calculates the total material cost for a product.
- Uses the best available vendor quote (lowest unit price at the required quantity) for each BOM line.
- Converts all currencies to the base currency using the FX rates table.
- Exports to Excel for further analysis.
๐ท๏ธ Vendor Quotes
Vendor quotes record supplier pricing for components. Features: - Multiple vendors per component - Tiered pricing (MOQ breaks): e.g. 1โ99 pcs @ $0.50, 100+ @ $0.30 - Currency per quote (converted via FX rates) - Effective date range support
๐ Purchase Orders
POs track orders placed with suppliers.
- Create: add header (vendor, expected date, currency, owner) + line items (component, qty, unit cost)
- Owner field: when a PO has an owner set (e.g. "Atlantic Signal"), all stock received from that PO is automatically assigned to that owner โ no manual reassignment needed
- Receive: mark a PO as received โ this triggers automatic Stock IN moves for all lines
- Partial receipt: receive individual lines independently; PO stays open until fully received
- Files: attach order confirmations or invoices
- Last updated: the PO detail panel shows when the PO record was last modified
๐ Create POs from BOM (product detail): a shortcut that groups a product's BOM lines by preferred vendor and lets you create one draft PO per vendor in a single click. Features: - Build volume input (default = product's target quantity) - "Consider stock" toggle โ order only the shortfall - ๐ฐ Cheaper-elsewhere hint when another vendor's price is lower than the preferred vendor's - โ ๏ธ MOQ warnings per line - Tick individual vendor groups to include; unassigned components (no preferred vendor) get their own card that you resolve manually
๐ฏ End Customers
Manage โ Manage lists โ End customers โ a lookup of companies you deliver products to. Each row holds: - Name (required) - Website / note (optional) - Profit % โ a target margin used to compute quotation prices for that customer
The profit percentage feeds the Quotations module (below).
๐งพ Customer Quotations
Manage โ ๐งพ Quotation โ issue a quote to an end customer. A single quote can mix any number of component lines and product lines.
- Auto-generated number:
Q-YYYYMMDD-NNN - Auto profit: picks up the end customer's profit % on every new line; override per line if needed
- Auto cost:
- Component line โ uses the component's
unit_cost - Product line โ sums the BOM (
qty per unit ร component unit_cost) automatically - Auto price:
unit_price = unit_cost ร (1 + profit%/100); line total = unit_price ร qty - Misc lines (๐): fully manual โ describe, ref, cost, qty all typed by hand. Use for shipping, tooling, custom labor.
- Tax: percent applied to the subtotal (default 5%). Grand total = subtotal + tax.
- Customer-facing view: the print + xlsx export hide unit cost and profit % โ the customer sees only qty ร unit price ร line total โ subtotal โ tax โ grand total.
- Status: draft / sent / accepted / rejected / expired โ set on the Status dropdown in the edit form header. Every status change is written to
change_logunderop_type=quotation.statuswith the from โ to values, user, and timestamp.
Where to see quotes: Browse โ ๐งพ Customer quotations โ filterable list with per-row actions: - Click a row to reopen and edit - ๐จ๏ธ Print (opens the printable HTML page) - xlsx export - Delete (soft-delete, recoverable by an admin)
๐ Reorder Suggestions
Tools โ Reorder suggestions lists every component whose stock is at or below its reorder point. The table includes the lowest vendor quote so you can immediately assess cost before raising a PO.
๐ญ Production Consumption
Tools โ Production consumption deducts stock for a completed build run. Quantities come from the product's BOM ร build volume โ no manual consumption file required.
| Field | Required | Notes |
|---|---|---|
| Product | โ | Selects the BOM to use |
| Build volume | โ | Number of units built; all BOM quantities are multiplied by this |
| Producer (vendor) | โ | Contract manufacturer who performed the build |
| Production date | โ | Actual date of production (can be backdated) |
| Scrap file | โ | Excel/CSV with columns ID, Scrap, Location for components that had waste. Components not listed default to scrap = 0. |
Workflow: 1. Fill in the fields above and click Preview 2. The preview table loads all BOM lines with deduction quantities and auto-selects the highest-stock bin per component 3. Review for any shortages (shown in red) 4. Click Apply (deduct stock) โ one Stock OUT move is created per BOM line
The operation is logged in the Activity log and can be undone via โถ Undo.
Submitting scrap after the run: if the scrap data arrives after the production run has already been applied, go to Browse โ Production log โ Runs, find the run row, and click + Scrap. Upload the scrap file in the same format โ the system creates additional Stock OUT moves and links them back to the original run.
Scrap file format (optional): upload an Excel or CSV file with three columns:
| Column | Description |
|---|---|
ID |
Component SN (e.g. R00032) |
Scrap |
Number of scrapped units for this component |
Location |
Storage bin the scrap came from |
Components in the BOM but not listed in the scrap file default to scrap = 0. Scrap quantities are deducted separately from the main build deduction and appear in the Scrap report (Tools โ Scrap report).
๐ง Adjustment Report
Tools โ Adjustment report summarises all stock adjustments by component over a chosen date range. Use it to identify parts that are frequently or significantly corrected โ a pattern that may indicate handling losses, a bad reorder point, or an unreliable count process.
| Column | Description |
|---|---|
| # Events | How many separate adjustment entries exist for this component in the range |
| Total adjusted | Net delta across all events โ positive means net addition, negative means net removal |
| Last adjusted | Date of the most recent adjustment |
| By | Users who made adjustments for this component |
The table is sorted by largest absolute total adjusted (biggest discrepancies first). Export to Excel via the โฌ Export xlsx button.
๐ฑ FX Rates
Tools โ FX rates stores exchange rates relative to the base currency (TWD by default). Rates are used by the cost roll-up and quote displays. Update rates manually as needed.
๐ Search
Universal Search
Universal search answers the question "find me anything related to X" โ it searches across all data types at once with a single keyword.
Mental model: it is a keyword lookup, not a full browse.
| Universal Search | Browse screens | |
|---|---|---|
| Use when | You don't know which tab holds what you need | You know what you're looking at and want to filter/sort/export |
| Input | Free-text keyword | Structured filters (category, date range, typeโฆ) |
| Output | Top 50 matches per data type | All matching rows, paginated |
| Scope | Components, Products, BOMs, POs, Quotes, Files, Stock moves, Change log | One data type per screen |
What it searches in each bucket:
| Bucket | Fields searched |
|---|---|
| Components | SN, MPN, description, manufacturer, value |
| Products | Product code, name |
| BOM lines | MPN, product code |
| Purchase orders | PO number, vendor name, notes |
| Vendor quotes | MPN, vendor name |
| Files | Filename, notes |
| Stock moves | SN, MPN, notes, created by, category code/name |
| Change log | Summary, operation type, created by |
50-result cap: each bucket shows at most 50 matches. If a bucket shows "top 50 matches", there are more rows โ use the dedicated Browse screen to see all of them. The Stock movements bucket links directly to Browse โ Stock-move history when capped.
Tip: use a specific keyword (e.g. "MESH", "RC0402", "PO 150123") rather than a broad one โ the more specific, the more useful the results.
Other Search Tools
| Feature | Location | Description |
|---|---|---|
| Component browse | Browse โ Components | Full-text + column filters across the catalogue |
| BOM line browse | Browse โ BOM lines | Search all BOM lines across all products |
| Stock-move history | Browse โ Stock-move history | Full filterable/exportable move history |
| Unused components | Search โ Unused components | Parts in catalogue not referenced by any active BOM |
| Most-used components | Search โ Most-used components | Parts ranked by number of BOMs referencing them |
| Archived components | Search โ Archived components | Soft-deleted components |
Column filters (โพ button in any column header) work like Excel โ filter by exact value, range, or pattern. Active filters are highlighted in blue.
๐ Activity Log and Undo
Browse โ Activity log records every write operation: who did what and when.
- Detail view: click any log row to see the full details. Component, location, and ownership IDs are resolved to their names. If the move was backdated, the Transaction date is shown prominently; the Logged at timestamp shows when it was actually recorded.
- Stock-move history (Browse โ Stock-move history) shows the raw move table with IN / OUT / Destination / By columns. It now starts empty โ set filters and click Search. Filters include: component ID, category, location, type, product (shows moves for all components in a product's BOM, including sub-assemblies), and date range. Results can be exported to Excel.
The โถ Undo button (top nav, Ctrl+Z) reverses the most recent reversible action. For stock moves, undo deletes the original record and corrects inventory โ no compensating row is created. Hover over the button to preview what will be undone. Not all operations are undoable โ the preview will indicate if an action cannot be reversed.
๐งฒ CAD Integration โ Cadence OrCAD Capture CIS
Cadence Capture engineers place parts directly from the PartsHub catalogue. Each schematic instance is stamped with the authoritative PartsHub SN, MPN, footprint, and lifecycle, and Capture's BOM export comes out with the correct internal Part Numbers. Snapshots (.mdb + .olb symbol libraries) are published per release via Tools โ ๐ฅ Cadence CIS Downloads and downloaded by engineer PCs. Full setup and refresh workflows are in section 3 below.
2. How To โ Step-by-Step Workflows
Add a new component
- Go to Manage โ Add component
- Fill in: MPN, category, manufacturer (required)
- Optionally add: value, spec, description, reorder point, initial bin
- Click Save
- The component gets an auto-assigned SN and appears in the catalogue immediately
Bulk-import components (admin)
Use this for seeding a fresh workspace or loading a supplier's parts list in one shot.
- Manage โ ๐ฅ Components import (admin)
- Click โฌ Download template (direct URL:
/api/import/components/template.xlsx) โ an .xlsx pre-filled with the required columns and a Category dropdown listing every existing category code - Fill one row per component in the template; leave optional columns blank
- Drag the file back onto the upload area (or click) โ Preview โ the panel shows every row with a status:
NEW,UPDATE(matched by SN or MPN), orSKIP(validation error) - Fix any row flagged red, re-preview, then click Apply โ components are created/updated in a single transaction
Notes:
- SN is auto-generated for NEW rows (respects the tenant's SN prefix)
- Row-by-row errors don't block the successful rows; the summary reports what was imported and what was skipped
- Everything is logged as components.import and undoable in the Activity log
Bulk-import a BOM
- Open the product โ BOM lines panel โ Import BOM
- Click โฌ Download template on the upload dialog โ pre-set headers so auto-detect maps every column
- Fill one line per component (SN or MPN + Reference designators + Quantity), plus optional DNP / Value / Footprint / Notes
- Upload โ Preview โ the importer resolves every row against the component catalogue (fuzzy match on MPN, exact on SN)
- Pick a replace mode โ
merge(default; upsert only the file's rows),sections(wipe categories present in the file, then insert), orall(wipe every existing line before insert) - Click Apply
Edit an existing component
- Go to Browse โ Components
- Search or scroll to find the component
- Click any row to open the edit drawer
- Modify any field and click Save changes
- Use โถ Undo to reverse if needed
Record stock IN (receiving parts)
- Go to Manage โ Stock IN / OUT / Transfer
- Select the component (type MPN or description to search)
- Choose operation: IN
- Enter quantity and destination bin
- Set Type:
receiptโ standard purchase (default)sample (cost not averaged)โ paid sample; enter unit cost for payment reference, but the price will not be included in the Moving Average Costinitial_countโ first-time stock entrytransfer_inโ receiving a transfer from another bin- Optionally enter unit cost, currency, link to a PO, and add a note
- Click Record
Receive a free sample (no PO)
Use this when a vendor sends parts at no charge โ no purchase order is involved.
- Go to Manage โ Free Sample
- Select the component and bin
- Enter quantity
- Optionally fill in vendor name, sample reference, ownership, and notes
- Click Record Sample
The move is recorded as sample type with a teal pill in stock-move history. Free Sample moves cannot be undone โ record a Stock OUT to reverse if needed.
Record stock OUT (consuming parts)
- Manage โ Stock IN / OUT / Transfer
- Choose OUT
- Select component, quantity, and source bin
- Optionally set Destination (where the parts are going, e.g. "Company B")
- Optionally set ownership and date/time
- Click Record
Transfer between bins
- Manage โ Stock IN / OUT / Transfer
- Choose Transfer
- Select component, quantity, source bin โ destination bin
- Click Record
Correct stock with an adjustment
Use Adjust when a physical count reveals the system quantity does not match reality and you cannot trace the exact cause (unknown scrap, damage, miscounting in a previous receipt, etc.).
Important: Adjust takes a delta โ the difference, not the target total. If the system shows 500 and the physical count is 480, enter โ20. If the system shows 300 and the physical count is 310, enter +10.
Do not use Adjust for scrap โ use the Submit Scrap workflow instead (Browse โ Production log โ find the run โ + Scrap). Using both for the same event causes double-deduction.
- Manage โ Stock IN / OUT / Transfer
- Choose Adjust
- Select component, location, and ownership
- Enter the delta โ positive to add, negative to remove (e.g.
โ20) - Add a note describing why the discrepancy exists (or "physical count" if unknown)
- Click Adjust
To review all past adjustments across components, use Tools โ Adjustment report. Filter by date range and category to identify parts with frequent or large discrepancies.
Create a new product and BOM
- Manage โ New product โ enter name, revision, status
- Open the product (Browse โ Products โ click row)
- In the BOM tab, click Import BOM to upload a CSV, or Add line to enter manually
- CSV format:
MPN, Quantity, Reference(one line per component) - Unmatched MPNs will prompt you to create new components on the fly
Check if you can build a product
- Tools โ Build feasibility
- Select a product
- Enter target quantity
- Review the โ / โ ๏ธ / โ status per component
- The header shows the maximum buildable quantity
Calculate BOM cost
- Tools โ BOM cost roll-up
- Select a product and quantity
- The table shows unit cost and extended cost per line
- Click Export to Excel to download
Create a Purchase Order
- Manage โ Purchase Order
- Fill in: vendor, currency, expected delivery date, and optionally Owner (who paid for / owns this stock)
- Click Add line for each component โ enter MPN, qty, unit price
- Click Save PO
- When parts arrive: Browse โ Purchase orders โ click the PO โ Receive
- All received stock is automatically assigned to the PO's owner
Receive a PO (partial or full)
- Browse โ Purchase orders โ click a PO row
- For each line that has arrived, check the box and confirm quantity
- Click Receive selected โ stock IN moves are created automatically
- Unreceived lines remain open on the PO
Create POs from a product's BOM
- Open the product (Browse โ Products โ click row)
- In the BOM lines panel, click ๐ Create POs from BOM
- Enter the build volume
- Optionally tick "Order only shortfall" to subtract current stock
- Review the per-vendor cards โ each shows the lines, qty, unit price, per-currency totals
- Watch for hints:
- ๐ฐ = cheaper elsewhere (another vendor has a lower price at this qty)
- โ ๏ธ = below MOQ or no preferred vendor
- Untick any vendor group you don't want to create right now
- Click Create selected POs โ one draft PO per vendor group
Issue a customer quotation
- Make sure the customer exists: Manage โ Manage lists โ End customers. Set the Profit %.
- Manage โ ๐งพ Quotation opens the New quotation form
- Pick the end customer (their profit auto-fills)
- Choose quote date, valid-until date, currency, notes
- Add lines:
- + Component โ enter SN or MPN, cost auto-loads from
components.unit_cost - + Product โ enter product code, cost auto-sums from the BOM
- Edit quantity, unit cost, or profit % per line โ unit price and line total recompute live
- Click Save โ quote gets an auto number
Q-YYYYMMDD-NNN - Find it in Browse โ ๐งพ Customer quotations
- From the list: ๐จ๏ธ Print, xlsx Export, or delete
Record a lot / batch on receipt
When receiving parts that carry a manufacturer's date code or a distributor lot number:
- Manage โ Stock IN
- Fill in the standard fields (component, location, qty, ownership)
- Fill in the optional lot fields:
- Date code โ e.g.
2352 - Lot number โ from the distributor's label (e.g.
904042AJ2) - Expiry date โ for age-sensitive parts
- Submit โ this creates a distinct lot. Every future Stock OUT or Production run consumes FIFO by expiry.
To view all lots for a bin: Browse โ Inventory โ click the ๐ท๏ธ button on the row. To find expiring parts: Tools โ ๐ฐ๏ธ Lot expiry.
Switch between tenants
If your account has access to more than one tenant:
- User menu โ ๐ Switch tenant opens a picker with all tenants you belong to.
- Or bookmark
/<slug>(e.g.https://www.adaptox-tw.com/company1) โ clicking it always lands you in that tenant. - The current tenant is shown in the nav bar as
<tenant> ยท PartsHub.
Change UI language
- Click your name (top-right) to open the user menu
- Under ๐ Language, pick English / ็น้ซไธญๆ / ็ฎไฝไธญๆ
- The choice persists on this browser. The user guide (โ Help โ ๐ User guide) also switches to match.
Add a vendor quote
- Open a component (Browse โ Components โ click row)
- Go to the Quotes tab in the edit drawer
- Click Add quote
- Enter: vendor, currency, MOQ, unit price, effective dates
- Add additional price tiers for quantity breaks if needed
Record a production run
- Tools โ Production consumption
- Select the product and enter the build volume (number of units built)
- Optionally fill in: producer/vendor, production date, and a scrap file (Excel/CSV with columns
ID,Scrap,Location) - Click Preview โ the table loads one row per BOM line with auto-selected bins (highest-stock bin per component) and calculates total deduction = BOM qty ร build volume
- Review the preview: rows shown in red indicate a shortage
- Click Apply (deduct stock) โ one Stock OUT move is created per BOM line
- The run is logged in the Activity log; use โถ Undo to reverse if needed
If scrap data arrives later: go to Browse โ Production log โ Runs, click + Scrap on the relevant run, and upload the scrap file. Additional OUT moves are created and linked to the original run automatically.
Find what to reorder
- Tools โ Reorder suggestions
- Review the list of parts below their reorder point
- Click on any row to open the component for more detail
- Use the quote information to raise a PO
Export data
| What | How |
|---|---|
| Component list | Browse โ Components โ Export (Excel) |
| Stock-move history | Browse โ Stock-move history โ Export |
| BOM cost | Tools โ BOM cost roll-up โ Export to Excel |
| Adjustment report | Tools โ Adjustment report โ โฌ Export xlsx |
| Activity log | Browse โ Activity log โ Export |
Manage users (admin only)
- Manage โ ๐ฅ Users
- Click + Add user to create an account โ set username, display name, role, and temporary password
- On any row:
- Edit โ profile fields; Password โ reset password
- Role โ opens a dropdown modal with admin / user / readonly
- Enable / Disable โ flip
is_active(self-disable is blocked) - Make super / Revoke super โ visible only to a super-admin; grants the cross-tenant super-admin flag (self-revoke blocked to avoid lockout)
- Delete โ soft-delete; a Show deleted checkbox surfaces hidden rows with Restore / Delete forever
- Delete forever now also removes the corresponding
master.usersrow and itsuser_tenantsmapping if the user has no other memberships โ no more ghost entries in the Tenants panel - Roles:
adminโ full write access in the tenantuserโ normal write accessreadonlyโ view onlysuper-adminโ cross-tenant privilege (Tenants panel, per-tenant DB sizes in Storage usage, can enter any tenant); orthogonal torole- Users can change their own password via the top-right dropdown โ Change password
New signup flow: registered users start as readonly + is_active=0 and can't sign in until an admin flips them active. Approval emails go to every super-admin plus every admin of the target tenant.
Manage tenants (super-admin only)
- Manage โ ๐ข Tenants (super-admin)
- Existing tenants show slug, name, DB, user count, active toggle, and an optional SN prefix (3 uppercase letters, unique across tenants โ prepended to auto-generated component SNs as
PFX-R00001) - To create a new tenant: fill in slug (lowercase, URL-safe) + display name, then optionally the First admin section (username / full name / email / temporary password). Click Provision โ creates a new empty database with the current schema and category list seeded (locations, ownerships, and other lookup lists start empty). If a first admin is given, they get a welcome email with sign-in details.
- Toggle active off to hide a tenant from the login picker without deleting anything
- In the User โ Tenant mapping grid, tick which users belong to which tenants
- Backups โ automatic nightly dump at 03:00 UTC, retained 7 days per tenant. Click Backup now for an on-demand snapshot.
File storage isolation: uploaded files (product files, datasheets, PO attachments, component design files, company logos, manufacturer/vendor logos) live under webui/uploads/<tenant-slug>/โฆ โ each tenant's files are on a separate subtree and can only be reached through its own DB.
Update FX rates
- Tools โ FX rates
- Enter the rate for each currency relative to the base currency (TWD)
- Click Save โ cost roll-ups immediately use the new rates
Check storage usage
- Manage โ ๐พ Storage usage (admin only)
- Directories โ per-kind file counts and disk usage for the current tenant's upload subtree (
webui/uploads/<slug>/โฆ) - Database โ per-table row counts and sizes for the current tenant's DB
- Disk โ free space on the VM
- Super-admins additionally see a ๐ข Per-tenant database size table listing every tenant's DB size and table count so they can spot which workspace is growing fastest
View stock-move history
- Browse โ Stock-move history
- Set one or more filters: component ID/MPN, category, location, type, product, date range
- Click Search
- Results show IN / OUT quantities, destination, and who recorded the move
- Click Export โ to download the filtered result as Excel
The Product filter is especially useful: selecting a product shows all moves for every component in its BOM, including components from sub-assemblies.
3. Admin Only
Features gated to admin role (or higher). Regular users won't see the menu entries.
Quick index โ where each admin feature lives
| Task | Where | Notes |
|---|---|---|
| Bulk-import components | Manage โ ๐ฅ Components import | .xlsx template with category dropdown; preview then apply |
| Manage users (create, role, enable, password reset, delete) | Manage โ ๐ฅ Users | See "Manage users" |
| Manage tenants (create workspaces, first admin, backups) | Manage โ ๐ข Tenants (super-admin) | Super-admin only |
| Grant / revoke Super-admin | Users tab โ Make super / Revoke super | Super-admin only; can't revoke self |
| Storage usage | Manage โ ๐พ Storage usage | Tenant-scoped for admins; per-tenant DB breakdown for super-admins |
| Edit legacy lot expiry | Tools โ ๐ฐ๏ธ Lot expiry โ Edit per row | Fix expiry/date-code/vendor-lot on pre-PartsHub stock |
| Backdate stock moves | Any Stock IN/OUT/Transfer/Adjust form โ Date field | Non-admins can only backdate ~5 min in the past |
| Export "Update source file" | Browse โ Components โ Update source file | Overwrites component_coding.xlsx on the VM (backup taken first) |
Delete permanently (Delete forever) |
Users tab โ Show deleted โ Delete forever | Purges master.users + user_tenants; irreversible |
Admin sanity checklist
Do these once when spinning up a new tenant:
- Provision the tenant with a First admin so someone can approve future signups
- In Manage โ Manage lists, seed the initial Locations (physical bins) and Ownerships
- Optionally set an SN prefix in Tenants so component SNs read
PFX-R00001 - Configure SMTP on the VM (
webui/.env) so approval / welcome emails actually send
Role reference
| Role | Read | Write | Manage users | Cross-tenant |
|---|---|---|---|---|
readonly |
โ | โ | โ | โ |
user |
โ | โ | Own profile only | โ |
admin |
โ | โ | Full within tenant | โ |
super-admin (flag) |
โ | โ | Full + Tenants panel | โ |
super-admin is orthogonal to role โ you can be user + super, or admin + super. Grant/revoke via Users โ Make super / Revoke super.
โ๏ธ Automatic off-site backup
Goal: every night, a .zip of your tenant's DB + uploads lands in your own OneDrive / Google Drive / Dropbox โ without giving PartsHub any cloud credentials.
How it works
- PartsHub gives you an API key + a ready-made script.
- You save the script on your PC and schedule it (Task Scheduler on Windows / cron on macOS / Linux).
- The script downloads a fresh
.zipevery night into a folder you choose. - Your OneDrive / Google Drive / Dropbox client is already syncing that folder โ the backup lands in your cloud automatically.
One-time setup (~3 minutes)
- Open Manage โ ๐พ Storage usage โ โ๏ธ Automatic off-site backup.
- Click + Generate API key, give it a label like "OneDrive โ my PC". Copy the key โ it's shown only once.
- Click โฌ Windows script (.ps1) or โฌ macOS / Linux script (.sh) โ the file downloads.
- Open the script in a text editor and:
- Paste the key into the
$BackupKey = '...'line. - Set
$DestDirto a folder your cloud client already syncs (e.g.C:\Users\me\OneDrive\PartsHub-Backups\adaptox). - Register the script with Task Scheduler (Windows) or
crontab -e(Mac / Linux) โ daily at your preferred time.
Turning it off / rotating keys
- Click Revoke next to any key โ that script starts failing with
401immediately. - Generate a new key (different label) if you move to a different PC.
- The Last used column tells you if your script is actually running.
What's inside the zip
db.sqlโ full mysqldump of your tenant's databaseuploads/โ every uploaded file for your tenant (product docs, datasheets, logos, PO attachments)MANIFEST.txtโ tenant slug + timestamp + who created the backup
Security notes
- Keys are shown once and stored hashed on the server. Nobody (including the server owner) can recover the plaintext.
- A key issued from your tenant only downloads your tenant's data โ never another workspace.
- Every create / revoke / download is written to the Activity log (
backup.key.create,backup.key.revoke,tenant.backup). - If you lose the PC that has the script, revoke the key from the app.
4. CAD Integration
๐งฒ Cadence OrCAD Capture CIS
Capture engineers can place parts directly from PartsHub. The schematic instance is stamped with the authoritative PartsHub SN, MPN, footprint, and lifecycle, and the BOM export from Capture already carries the correct internal Part Numbers.
How it works (snapshot mode)
- A release operator runs
scripts\refresh_cis.baton a Windows PC. - The script reads the
cis_componentsview from the tenant DB and buildspartshub_cis_<tenant>_<YYYY-MM-DD>.mdbfrom a template. - The
.mdbis uploaded to PartsHub via/api/cis/upload(admin only). - Engineers download the newest
.mdbfrom Tools โ ๐ฅ Cadence CIS Downloads and drop it in%USERPROFILE%\PartsHub\. - Capture's CIS configuration reads the local
.mdb(SN, MPN, manufacturer, value, footprint, package, unit cost, datasheet, lifecycle, symbol). - One
.DBCfile per part category tells Capture which columns to bind to which schematic properties and which symbol library to place from.
The catalog refreshes once per release โ no live DB connection required from engineer PCs, and no MySQL port exposed on the VM firewall.
Admin card: Tools โ ๐ฅ Cadence CIS Downloads
- Lists every artefact uploaded for the current tenant with a coloured
Kind badge โ
Snapshot(.mdb),Library(.olb),Config(.dbc) โ plus size, row count, git SHA and upload time. - Upload a new snapshot โ drops any
.mdb/.olb/.dbcinto the tenant store; the same file uploaded again overwrites. - Download โ direct link per file. Engineers use the Latest
download URL copy button to grab the freshest
.mdbwithout clicking through the list. - Delete โ admin-only cleanup for stale files.
How to โ publish a new CIS download
- Double-click
scripts\refresh_cis.bat. It readsscripts\refresh_cis.env(create once fromscripts\refresh_cis.env.examplewith yourMYSQL_PASSWORD+PARTSHUB_SESSIONcookie), pulls the latest cloud DB into local (scripts\pull_cloud_to_local.ps1), rebuilds the.mdbfrom that, uploads to PartsHub, and prints the download URL. - Confirm in Tools โ ๐ฅ Cadence CIS Downloads that today's
.mdbis at the top with a fresh timestamp. - Notify engineers so they re-download. The Latest download URL
copy-button on the card is the stable URL you can hand out โ
it always resolves to the newest
.mdb.
How to โ build an offline handover bundle
.\scripts\pack_cis_zip.ps1 builds
exports\cis\partshub-cis-YYYY-MM-DD.zip containing the latest .mdb,
every .olb from PartsHub, and a README with the setup steps. Email or
USB-transfer the zip to any engineer PC โ no PartsHub login needed on
that side. Same-day rebuild: run refresh_cis.bat first so the bundle
picks up today's snapshot.
How to โ upload a new symbol library (.olb)
- One at a time โ Tools โ ๐ฅ Cadence CIS Downloads โ Upload a new
snapshot โ pick the
.olb. - Many at once โ drop the
.olbfiles in a folder and runscripts\upload_olbs.ps1 "<folder>". It reads the session cookie from the samerefresh_cis.envfile.
.olb files are one-time uploads; they're only replaced when the
symbol itself changes.
How to โ assign a Capture symbol to a part
Capture's Schematic Part is a bare symbol name (e.g. R,
INDUCTOR, MAX__MAX1719_0) โ not LIBRARY:PART syntax. On placement,
Capture searches every registered .olb for a part with that exact
internal name and uses the first match.
Three levers, in order of preference:
- Per-part field in the UI (recommended) โ open the Edit Component drawer (double-click any row in Browse Components) and set CIS Schematic Symbol at the bottom of the form. This is a normal editable field; blank means fall back to the category default.
- Per category default โ for parts that all share one symbol (resistors, capacitors, generic connectors). Currently seeded:
| Category | Default |
|---|---|
| R | R |
| C | C |
| L | INDUCTOR |
| D | DIODE |
| SW | SW PUSHBUTTON-SPST |
| CON | CONNECTOR |
| Q, IC, LED, F, Y, T | none โ must set per part |
Change with SQL on the tenant DB:
sql
UPDATE component_categories SET cis_default_symbol='DIODE' WHERE code='D';
- Bulk / scripted โ scripts\set_cis_symbol.ps1 -Sn <SN> -Symbol <name>
updates both local and cloud in one shot. Useful for scripted seeds
(see scripts\setup_ic_olbs.sql for the initial seeding mapping).
After any change, run scripts\refresh_cis.bat and engineers
re-download the .mdb. refresh_cis.bat auto-pulls cloud โ local
before building, so cloud is always the source of truth.
Gotchas
- The DB accepts any string. Nothing stops you assigning
Cto a resistor โ Capture would happily draw a capacitor on the sheet. Whoever fills the field owns correctness. - If two
.olbs both contain a symbol with the same name (e.g. two libraries both definingR), Capture picks the first match by library search order โ silently. Keep symbol names unique across the uploaded.olbset.
How to โ set up a new engineer PC
Prereqs (once per PC):
- Install the standalone Microsoft Access Database Engine 2016
Redistributable (64-bit) โ download
AccessDatabaseEngine_X64.exe(79.5 MB) from Microsoft's page. Install it from an elevated PowerShell with theSkipQuickReg=1flag โ this makes it work even when the PC already has Microsoft 365 / Office (which ships its own ACE driver that CIS is not compatible with):
powershell
Start-Process -FilePath "C:\path\to\AccessDatabaseEngine_X64.exe" `
-ArgumentList "/quiet","/norestart","SkipQuickReg=1" -Verb RunAs -Wait
Verify the standalone version is registered (not the Office version):
powershell
Get-ItemProperty 'HKLM:\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)' |
Select-Object Driver
Expected: C:\PROGRA~1\COMMON~1\MICROS~1\OFFICE16\ACEODBC.DLL
(version 16.0.4999.1000). If it says \Microsoft Office\root\vfs\
instead, the Office ACE driver won and CIS will drop the connection
every 1โ5 minutes. Re-run the install, then reboot.
- Create the folder
%USERPROFILE%\PartsHub\. - In Access: File โ Options โ Trust Center โ Trust Center Settings
โ Trusted Locations โ Add new location, path
%USERPROFILE%\PartsHub\, tick Subfolders trusted. This prevents Mark-of-the-Web from blocking each freshly-downloaded.mdb.
Get the files:
- Option A (online) โ log into PartsHub โ Tools โ ๐ฅ Cadence CIS Downloads โ click Download on the top
.mdb(rename it topartshub_cis.mdbwhen saving to%USERPROFILE%\PartsHub\โ the fixed name means Capture never needs reconfiguring per release). Then download each.olbfrom the list into the same folder. Leave the file writable (do not tick Read-only โ Capture needs write access for its internal temp table). Unblock the file after download: right-clickpartshub_cis.mdbโ Properties โ tick ่งฃ้คๅฐ้ / Unblock โ OK. Windows marks downloaded files with a security zone flag (Mark of the Web) that can restrict Access driver access; unblocking removes it. Repeat after every refresh. - Option B (offline handover) โ the admin runs
.\scripts\pack_cis_zip.ps1and emails you apartshub-cis-YYYY-MM-DD.zip. Extract into%USERPROFILE%\PartsHub\. Contains the.mdb, every.olb, and a README.
Configure Capture (once):
- Launch OrCAD Capture CIS (not plain Capture โ File โ Change Product if needed).
- Open or create a project.
- Options โ CIS Configuration โ Setup โ Newโฆ
- Name:
PartsHub - Data source: Microsoft Access Database
- Database file:
%USERPROFILE%\PartsHub\partshub_cis.mdb - Tick
cis_componentsโ Next - Wizard steps: Part_Number โ
Part Number, Value โValue, Part_Type โCategory Code, Schematic_Part โSchematic Part, Browsable โ tick Datasheet, Visibility โ keep Part Number- Value, Keyed โ tick both. Finish.
- In Project Manager โ Library folder โ right-click โ Add
Fileโฆ โ select every
.olbin%USERPROFILE%\PartsHub\.
Test:
- Place โ Database Partโฆ (
Z) โ pick a resistor (R00001) โ Place. - Confirm the placed symbol carries the PartsHub SN as its Part Number property.
If Capture pops "Package X not found in configured libraries list",
click Configure Library on the dialog and add the missing .olb
from %USERPROFILE%\PartsHub\.
How to โ refresh after the database changes
Engineer side, per release:
- Close Capture before updating โ replacing the file while Capture has it open causes a connection drop and triggers the Select Database popup.
- Tools โ ๐ฅ Cadence CIS Downloads โ Download the top row.
- Save as
%USERPROFILE%\PartsHub\partshub_cis.mdb, overwrite the previous file. - Unblock: right-click
partshub_cis.mdbโ Properties โ tick ่งฃ้คๅฐ้ / Unblock โ OK. (Every download resets the MotW flag.) - Reopen Capture โ the new rows appear in the CIS browser.
If a symbol library changed, also re-download the new .olb.
How to โ handle Windows / Office updates that break CIS
Symptom: after a Windows Update, Office 365 update, or Access reinstall, Capture's CIS starts popping the Select Database dialog every 1โ5 minutes. This means an OS update has re-registered the Office Click-to-Run ACE driver on top of the standalone one that CIS needs.
Recovery โ 30 seconds, no install needed. Two ways:
Easy way โ double-click scripts\repair_ace_odbc.cmd
from the repo (or the copy someone dropped on your Desktop). It reads
the current ODBC registration, decides whether a fix is needed,
prompts for UAC only if it has to change anything, and reports the
outcome. Idempotent โ safe to run whenever CIS acts up.
Manual way โ do it inline if you don't have the script handy:
-
Verify the ODBC driver has flipped back to the wrong DLL:
powershell Get-ItemProperty 'HKLM:\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)' | Select-Object DriverBad: a path containing\Microsoft Office\root\vfs\. Good:C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEODBC.DLL. -
If bad, flip the ODBC registration back to the standalone DLL directly โ run these four commands in an elevated PowerShell (right-click โ Run as administrator), no re-install needed:
powershell $dll = 'C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEODBC.DLL' # 64-bit ODBC (checked by 64-bit tools and some apps) reg.exe add "HKLM\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)" /v Driver /t REG_SZ /d $dll /f reg.exe add "HKLM\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)" /v Setup /t REG_SZ /d $dll /f # 32-bit ODBC (checked by Capture, which is a 32-bit process) reg.exe add "HKLM\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)" /v Driver /t REG_SZ /d $dll /f reg.exe add "HKLM\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)" /v Setup /t REG_SZ /d $dll /fBoth the 64-bit (SOFTWARE\ODBC\โฆ) and 32-bit (SOFTWARE\WOW6432Node\ODBC\โฆ) keys must point at the standalone DLL โ Capture is a 32-bit process and reads the WOW6432Node hive. Fixing only the 64-bit key leaves the popup recurring.
Verify both afterwards:
powershell
Get-ItemProperty 'HKLM:\SOFTWARE\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)' | Select-Object Driver
Get-ItemProperty 'HKLM:\SOFTWARE\WOW6432Node\ODBC\ODBCINST.INI\Microsoft Access Driver (*.mdb, *.accdb)' | Select-Object Driver
Both should show C:\Program Files\Common Files\Microsoft Shared\OFFICE16\ACEODBC.DLL.
-
Reboot Windows (belt-and-braces โ some cached ACE DLLs stay loaded in Capture until process/OS restart).
-
Reopen Capture. Pop-ups should stop.
Why the installer isn't enough: re-running AccessDatabaseEngine_X64.exe
sees the same version already installed and does a no-op โ the ODBC
registration Office overwrote never gets restored. The reg.exe fix
above is what actually takes.
When to use the installer: only if the standalone DLL itself is missing (e.g. fresh PC that never had this fix, or someone uninstalled the redistributable).
Preventive habits:
- Keep
AccessDatabaseEngine_X64.exearchived somewhere durable (a shared drive,C:\Tools\, etc.) so it's not lost during PC refreshes. - If IT can't uninstall Access from Office 365 (usually blocked by admin policy), the standalone-install-with-SkipQuickReg workaround is the only reliable path.
- Compact & Repair the
.mdbonce a month via Access (File โ Info) โ an unmaintained.mdbbloats from ~250 KB to several MB and starts dropping connections again even with the right driver. - Ask IT to exclude
%USERPROFILE%\PartsHub\from Windows Defender real-time scan โ occasional AV locks can trigger the same dialog.
Setup files and DBC template
The DBC template and full engineer walkthrough live in
docs/cis/.
Document last updated: 2026-09-15