Part-DB / Part-DB-server

Part-DB is an Open source inventory management system for your electronic components
https://docs.part-db.de/
GNU Affero General Public License v3.0
782 stars 88 forks source link
database electronics inventory inventory-management inventory-management-system inventory-system mysql part-db php symfony symfony-application symfony5

Scrutinizer Code Quality PHPUnit Tests Static analysis codecov GitHub License PHP Version

Docker Pulls Docker Build Status Crowdin

Documentation | Demo | Docker Image

Part-DB

Part-DB is an Open-Source inventory management system for your electronic components. It is installed on a web server and so can be accessed with any browser without the need to install additional software.

The version in this repository is a complete rewrite of the legacy Part-DB (Version < 1.0) based on a modern framework and is the recommended version to use.

If you find a bug, please open an Issue on GitHub, so it can be fixed for everybody.

Demo

If you want to test Part-DB without installing it, you can use this Heroku instance. (Or this link for the German Version).

You can log in with username: user and password: user.

Every change to the master branch gets automatically deployed, so it represents the current development progress and is may not completely stable. Please mind, that the free Heroku instance is used, so it can take some time when loading the page for the first time.

Features

With these features, Part-DB is useful to hobbyists, who want to keep track of their private electronic parts inventory, or maker spaces, where many users should have (controlled) access to the shared inventory.

Part-DB is also used by small companies and universities for managing their inventory.

Requirements

Installation

If you want to upgrade your legacy (< 1.0.0) version of Part-DB to this version, please read this first.

Hint: A docker image is available under jbtronics/part-db1. How to set up Part-DB via docker is described here.

Below you find a very rough outline of the installation process, see here for a detailed guide on how to install Part-DB.

  1. Copy or clone this repository into a folder on your server.
  2. Configure your webserver to serve from the public/ folder. See here for additional information.
  3. Copy the global config file cp .env .env.local and edit .env.local:
    • Change the line APP_ENV=dev to APP_ENV=prod
    • If you do not want to use SQLite, change the value of DATABASE_URL= to your needs ( see here) for the format. In bigger instances with concurrent accesses, MySQL is more performant. This can not be changed easily later, so choose wisely.
  4. Install composer dependencies and generate autoload files: composer install -o --no-dev
  5. Install client side dependencies and build it: yarn install and yarn build
  6. Optional (speeds up first load): Warmup cache: php bin/console cache:warmup
  7. Upgrade database to new scheme (or create it, when it was empty): php bin/console doctrine:migrations:migrate and follow the instructions given. During the process the password for the admin is user is shown. Copy it. Caution: These steps tamper with your database and could potentially destroy it. So make sure to make a backup of your database.
  8. You can configure Part-DB via config/parameters.yaml. You should check if settings match your expectations after you installed/upgraded Part-DB. Check if partdb.default_currency matches your mainly used currency (this can not be changed after creating price information). Run php bin/console cache:clear when you change something.
  9. Access Part-DB in your browser (under the URL you put it) and log in with user admin. Password is the one outputted during DB setup. If you can not remember the password, set a new one with php bin/console app:set-password admin. You can create new users with the admin user and start using Part-DB.

When you want to upgrade to a newer version, then just copy the new files into the folder and repeat the steps 4. to 7.

Normally a random password is generated when the admin user is created during initial database creation, however, you can set the initial admin password, by setting the INITIAL_ADMIN_PW env var.

You can configure Part-DB to your needs by changing environment variables in the .env.local file. See here for more information.

Reverse proxy

If you are using a reverse proxy, you have to ensure that the proxies set the X-Forwarded-* headers correctly, or you will get HTTP/HTTPS mixup and wrong hostnames. If the reverse proxy is on a different server (or it cannot access Part-DB via localhost) you have to set the TRUSTED_PROXIES env variable to match your reverse proxy's IP address (or IP block). You can do this in your .env.local or (when using docker) in your docker-compose.yml file.

Donate for development

If you want to donate to the Part-DB developer, see the sponsor button in the top bar (next to the repo name). There you will find various methods to support development on a monthly or a one-time base.

Built with

Authors

See also the list of contributors who participated in this project.

Based on the original Part-DB by Christoph Lechner and K. Jacobs

License

Part-DB is licensed under the GNU Affero General Public License v3.0 (or at your opinion any later). This mostly means that you can use Part-DB for whatever you want (even use it commercially) as long as you publish the source code for every change you make under the AGPL, too.

See LICENSE for more information.