Skip to content

Repository files navigation

Component Inventory

Self-hosted inventory management for electronic components.

The project is built as a practical local alternative to the discontinued Mouser Inventory workflow. It is not affiliated with Mouser, RS, or any distributor.

What It Does

  • Tracks electronic component stock across one or more storage locations
  • Stores part numbers, manufacturer data, vendor part numbers, bins, quantities and reorder points
  • Supports manual product entry and CSV import
  • Receives stock by part number, vendor part number, Mouser part number or printed INV-* label
  • Issues/loans products to consumers with optional return-required dates
  • Tracks active transactions, completed transactions, returns and non-returned quantities
  • Generates reports for current inventory, history, bin usage, consumer usage, overdue loans and reorder needs
  • Exports reports as CSV
  • Prints Code39 barcode labels for Avery 5163 and DYMO 30256-style labels
  • Includes user management, roles and per-location permissions
  • Includes organisation, location and consumer admin settings
  • Uses dark mode by default, with a browser-saved light/dark toggle
  • Can enrich products from Mouser Search API when MOUSER_API_KEY is configured
  • Provides RS search links for reorder workflows

Tech Stack

  • PHP 8.3 with Apache
  • SQLite database
  • Plain HTML/CSS/JavaScript
  • Docker Compose

No Node, Composer or external build step is required.

Quick Start

Copy the environment file:

cp .env.example .env

Start the app:

docker compose up -d --build

Open:

http://localhost:8080

Complete the first-run setup wizard to create:

  • organisation
  • first storage location
  • first administrator account

Windows PowerShell Start

Copy-Item .env.example .env
docker compose up -d --build

Then open:

http://localhost:8080

Environment Variables

The default values are in .env.example.

APP_NAME="Component Inventory"
APP_ENV=production
APP_URL=http://localhost:8080
APP_PORT=8080

MOUSER_API_KEY=
MOUSER_API_BASE=https://api.mouser.com/api/v1

RS_SEARCH_BASE=https://dk.rs-online.com/web/c/?searchTerm=

APP_PORT controls the host port. Example:

APP_PORT=8090
APP_URL=http://localhost:8090

Then restart:

docker compose up -d --build

Data Storage

The SQLite database is stored on the host:

storage/inventory.sqlite

This file is ignored by git. Back it up if the inventory matters.

Recommended backup flow:

docker compose down
cp storage/inventory.sqlite storage/inventory-backup.sqlite
docker compose up -d

Windows PowerShell:

docker compose down
Copy-Item .\storage\inventory.sqlite .\storage\inventory-backup.sqlite
docker compose up -d

Product Import CSV

Download the template inside the app from:

Products -> Import CSV

Supported headers:

part_number,manufacturer,manufacturer_part_number,vendor,vendor_part_number,description,bin,quantity_on_hand,reorder_point,reorder_quantity,loanable,active

If a row has the same part_number in the current location, the product is updated and quantity changes are logged as inventory movements.

Mouser API

Mouser API support is optional.

Without an API key, the app still works with manual product entry, CSV import and supplier search links.

With MOUSER_API_KEY configured, Products -> Mouser Match can look up part data and enrich local inventory records with:

  • Mouser part number
  • manufacturer part number
  • manufacturer
  • description
  • datasheet URL
  • product URL
  • product image URL
  • lifecycle status
  • RoHS status
  • packaging

Official Mouser pages:

Set the key in .env:

MOUSER_API_KEY=your_key_here

Restart the container:

docker compose up -d --build

RS Integration

RS integration currently generates reorder search links using:

RS_SEARCH_BASE=https://dk.rs-online.com/web/c/?searchTerm=

A direct RS product API adapter can be added later if RS provides API credentials and documentation.

Useful Commands

Start or rebuild:

docker compose up -d --build

View logs:

docker compose logs -f

Stop:

docker compose down

Reset all local inventory data:

docker compose down
rm storage/inventory.sqlite
docker compose up -d

Windows PowerShell reset:

docker compose down
Remove-Item .\storage\inventory.sqlite
docker compose up -d

Project Structure

.
├── docker/
│   └── apache.conf
├── public/
│   ├── assets/
│   │   ├── app.css
│   │   └── app.js
│   └── index.php
├── src/
│   └── bootstrap.php
├── storage/
│   └── .gitkeep
├── .dockerignore
├── .env.example
├── .gitignore
├── docker-compose.yml
├── Dockerfile
└── README.md

GitHub Notes

Safe to commit:

  • source code
  • Docker files
  • .env.example
  • .gitignore
  • .dockerignore
  • storage/.gitkeep

Do not commit:

  • .env
  • storage/inventory.sqlite
  • storage/*.sqlite-*
  • private API keys

These are already covered by .gitignore.

Verification Checklist

  • Open http://localhost:8080
  • Complete setup wizard
  • Add one product manually
  • Import the CSV template with a changed part number
  • Receive stock using a product part number
  • Print labels and use INV-* in Receive
  • Select a product and create an issue transaction
  • Return the issued quantity from transaction detail
  • Generate and export a report
  • Check reorder list after setting a reorder point
  • Toggle light/dark mode in the top bar
  • Add MOUSER_API_KEY and run Products -> Mouser Match

Current Status

The app is usable as a first self-hosted version. Main future improvements would be distributor-specific API adapters, more label formats, audit filtering and richer CSV/XLSX import/export.

About

Self-hosted inventory management for electronic components. The project is built as a practical local alternative to the discontinued Mouser Inventory workflow. It is not affiliated with Mouser, RS, or any distributor.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages