Skip to content

augustus-0/BOM-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOM Generator

A web-based Bill of Materials (BOM) enrichment tool that matches KiCAD BOM exports to an inventory database.

Features

  • Inventory Management: Add, edit, and delete component parts with manufacturer details
  • KiCAD BOM Upload: Import BOM files via CSV or Excel format
  • Smart Matching: Exact and fuzzy matching algorithms to link BOM items to inventory
  • Manual Override: Fix incorrect matches with dropdown selection
  • Export Options: Download enriched BOM as CSV or Excel
  • Local Storage: All data persists in your browser (no server required)

Quick Start

Local Testing

  1. Clone or download this repository
  2. Open index.html in any modern web browser
  3. Click "Load Demo Data" to populate sample inventory
  4. Upload a KiCAD BOM CSV file
  5. Review matches and export enriched BOM

GitHub Pages Deployment

  1. Create a new repository on GitHub
  2. Upload all files from this project
  3. Go to SettingsPages
  4. Under "Source", select Deploy from a branch
  5. Select main branch and / (root) folder
  6. Click Save
  7. Wait 2-3 minutes, then visit https://yourusername.github.io/bom-generator/

Usage Guide

1. Managing Inventory

Navigate to the Inventory tab to manage your component database:

  • Add Parts: Fill in the form and click "Add Part"
  • Edit Parts: Click any cell to edit inline
  • Delete Parts: Click the "Delete" button
  • Import/Export: Use CSV files to backup or share inventory
  • Load Demo: Quick-start with 20 sample resistors and capacitors

2. Uploading BOM

Go to the Upload BOM tab:

  1. Drag and drop your KiCAD BOM CSV file, or click to browse
  2. Supported formats: .csv, .xlsx, .xls
  3. Preview the parsed data
  4. Click "Match to Inventory" to run the matching algorithm

3. Reviewing Results

On the Results tab:

  • View match confidence (Exact, Fuzzy, Not Found)
  • Use dropdown menus to manually correct matches
  • Export as CSV or Excel
  • Print or save the enriched BOM

KiCAD BOM Format

The tool expects KiCAD BOM exports with these columns:

Qty,Reference,Value
7,TP1-TP7,TestPoint
2,SW1-SW2,Temp. Switch
24,R3-R32,330R_5W
2,R2-R20,1k_0.5W

Required Columns:

  • Qty or Quantity: Component quantity
  • Reference or Refs: Designators (e.g., R1, R2, C3)
  • Value: Component value or part identifier

Matching Algorithm

The tool uses a three-tier matching system:

  1. Exact Match (100% confidence): Case-insensitive, space-insensitive exact match
  2. Fuzzy Match (60-99% confidence): Similarity scoring using Fuse.js
  3. Alternative Patterns: Handles resistor shorthand (4k7 → 4.7k), unit variants (330R ↔ 330ohm), power ratings (330R_5W → 330R)

Keyboard Shortcuts

  • Ctrl+S: Export results to CSV
  • Ctrl+1: Switch to Inventory tab
  • Ctrl+2: Switch to Upload BOM tab
  • Ctrl+3: Switch to Results tab

Browser Compatibility

Works in all modern browsers:

  • Chrome 80+
  • Firefox 75+
  • Safari 13+
  • Edge 80+

Data Storage

All data is stored locally in your browser using:

  • localStorage for inventory database
  • IndexedDB available for future expansion

Note: Clearing browser data will erase your inventory. Use the Export CSV feature to create backups.

File Structure

bom-generator/
├── index.html                 # Main application
├── css/
│   └── styles.css            # Custom styles
├── js/
│   ├── app.js                # Main app logic
│   ├── inventory.js          # Inventory management
│   ├── matcher.js            # Fuzzy matching algorithm
│   ├── bom-parser.js         # CSV/Excel parsing
│   └── export.js             # Export functionality
└── data/
    └── sample-inventory.json # Sample data

Libraries Used

  • Tailwind CSS 3.4: Utility-first CSS framework
  • SheetJS 0.18: Excel file reading/writing
  • PapaParse 5.4: CSV parsing
  • Fuse.js 7.0: Fuzzy search matching

All loaded via CDN - no build step required!

License

MIT License - Feel free to use, modify, and distribute.

Troubleshooting

Q: My BOM items show "Not Found" A: Check that your inventory has matching part values. The matching is case-insensitive but requires close similarity.

Q: Can I use this on mobile? A: Yes! The interface is responsive and works on tablets and phones, though desktop is recommended for editing large inventories.

Q: How do I clear all data? A: Open browser DevTools → Application → Local Storage → Delete bom-inventory and current-bom-data keys.

Q: Can multiple people share an inventory? A: Not directly with this version. Export your inventory as CSV and share the file, or consider upgrading to a version with cloud storage.

Future Enhancements

Potential features for v2.0:

  • Cloud sync with Firebase
  • Barcode/QR code scanning
  • Price tracking from suppliers
  • Stock quantity management
  • Team collaboration features
  • API for ERP integration

Happy BOM generating! 🔧📋

About

Bill of Material Generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors