an electronic parts inventory manager
Go to file
King Kévin dfe0f5c924 sql: change mysql auto_increment to sqlite autoincrement 2023-03-08 11:01:30 +01:00
public js: better handle multiple queries 2023-02-26 12:11:57 +01:00
.gitignore add attachement support 2023-01-26 11:55:56 +01:00
LICENSE add license 2023-01-28 05:56:17 +01:00
README.md doc: update attachment handling 2023-02-01 01:45:39 +01:00
kicad_lib.rb kicad: pretty print library 2023-02-26 12:14:37 +01:00
populate.sql rename properties table 2023-01-31 21:54:27 +01:00
schema.sql sql: change mysql auto_increment to sqlite autoincrement 2023-03-08 11:01:30 +01:00
server.rb server: switch from mysql to sqlite 2023-02-26 12:11:27 +01:00

README.md

partdb is an electronic parts inventory manager.

usage

Once the service is installed, there is a single page to search, add, delete, or update parts. The only aspect not handled by the web frontend is the attachment deletion. Just remove the files directly on the server under public/attachments/<part_name>/.

To import an LCSC part, simply go to the /import/lcsc/Cxxxx page and the part will be added to the database.

goals

I wished for a part manager with the following properties:

  • self hosted: I do not wish to rely on an external service (which could become unreachable or simply disappear)
  • web interface: this removes the need of yet another window running while designing boards, and just integrates well with the remaining part searching activity (e.g. on manufacturer and distributor web pages)
  • customizable: simply because everyone has a different designing work flow, and wants to optimize their tools according to it (particularly myself)

One matching solution I found is PartKeepr. I used it for several year, and it could still be OK for my needs. But some aspects are just not that optimal anymore:

  • it is not developed anymore since 2018 (a docker image keeps it runnable)
  • logging in, and searching for parts is slow
  • customizing it is really hard (views, features, ...)
  • you always have to edit the part and click several times to copy any kind of value

I recently also discovered Binner. It does not allow to add custom part properties, or third parties distributors. But it's a young project and seems promising.

Because they did not fit by power user demands, I decided to implement my own solution. partdb is very crude, but it works, particularly for me.

components

Part information is:

  • stored in a MariaDB/mySQL database
  • retrieved using a sinatra HTTP/REST server
  • displayed using minimal HTML+JS pages

installation

install software dependencies (here for Arch linux):

sudo pacman -S mariadb
sudo pacman -S ruby-sinatra ruby-webrick
pikaur -S ruby-mysql2

configure database

sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
sudo mysql
CREATE DATABASE partdb;
CREATE USER 'partdb'@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON partdb.* TO 'partdb'@localhost;
exit
mysql --user=partdb --password=password --database=partdb < schema.sql

put the database access information in credentials.json and run server.rb. now go to http://localhost:4245 and you are ready to use it. the port is defined in server.rb.

use a proxy web server to handle the authentication, TLS, compression, ...