{"id":19854326,"url":"https://github.com/rhaamo/stockazio","last_synced_at":"2025-02-28T21:28:17.335Z","repository":{"id":36974234,"uuid":"230617472","full_name":"rhaamo/StockazIO","owner":"rhaamo","description":"Components/hardware management webapp for DIYers.","archived":false,"fork":false,"pushed_at":"2025-01-01T17:32:24.000Z","size":11021,"stargazers_count":19,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-11T13:47:30.650Z","etag":null,"topics":["electronic","inventory","inventory-management","stock"],"latest_commit_sha":null,"homepage":"","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhaamo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-28T14:01:54.000Z","updated_at":"2025-01-01T17:32:27.000Z","dependencies_parsed_at":"2023-12-19T16:34:23.519Z","dependency_job_id":"b91166d3-b89b-4a71-9d9d-a7ac71292aca","html_url":"https://github.com/rhaamo/StockazIO","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaamo%2FStockazIO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaamo%2FStockazIO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaamo%2FStockazIO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhaamo%2FStockazIO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhaamo","download_url":"https://codeload.github.com/rhaamo/StockazIO/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241244385,"owners_count":19933290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electronic","inventory","inventory-management","stock"],"created_at":"2024-11-12T14:09:13.864Z","updated_at":"2025-02-28T21:28:17.305Z","avatar_url":"https://github.com/rhaamo.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StockazIO\n\nManage your inventory of electronic stuff\n\n# Notes\n\nThis is very opinionated and made from my workflow.\n\nThe frontend is also a bit finicky and sometimes just crap itself, it would really benefits a real rework by someone that knows what they are doing.\n\nExcept that, everything is working okay-ish. Anyway it's API first, so you can build any frontend you want for it too.\n\n# Features\n\n- API first! Everything is done through the backend API, auth via oauth2.\n- yummy bugs\n- partkeepr import from CSV (fixed fields, see [here](https://github.com/rhaamo/StockazIO/blob/master/api/controllers/part/management/commands/import_partkeepr.py#L14) for them) \n- Categories tree for parts\n- Storage categories and Storage Locations (with possible pictures)\n- Footprints categories and actual footprint in them (with possible picture)\n- Parts can have distributors SKU, manufacturers SKU, parts parameters and file attachments\n- Parts and Storage Locations have UUIDs and QRCode (containing a specific URI usuable in the search input)\n- Quick add form and a full-featured one\n- Can import orders from vendors (Mouser for now) and selective import into inventory with category matching through regexpes\n- Project management with BOM with parts from inventory or free-form (with export of BOM to CSV or XLSX)\n- PDF Generator for labels printing of Storage Locations (plus bulk-generation) or Parts\n- Add item image from webcam\n\n# Requirements\n- Python 3.x (latest ideally !)\n- A pretty decent NodeJS + Yarn\n- Nginx\n- PostgreSQL\n\n# API Documentation\n\nAfter installing the backend, Swagger documentation will be accessible at:\n- http://backend_url/api/doc/swagger/\n- http://backend_url/api/doc/redoc/\n\nA better guide for the Oauth2 Auth flow is [available here](./oauth2_flow.md).\n\n# Install - manual\n\nWe assume in here you are installing under the `stockazio` user with default home directory `/home/stockazio`, like by doing:\n```\nuseradd -m -s /bin/bash stockazio\n```\n\n## API Backend\n\n```shell\nsudo su - stockazio\ngit clone https://github.com/rhaamo/StockazIO/ stockazio\ncd stockazio\npython3 -m virtualenv venv\nsource venv/bin/activate\npip install --requirement api/requirements.txt\n# For production environment\ncp deploy/env.prod.sample .env\n$EDITOR .env\n# For local development see the other section\ncd api\npython manage.py collectstatic\n# don't forget to run migrations\npython manage.py migrate\n# and then seed some initial datas (categories, manufacturers, footprints, ...)\npython manage.py seeds_database\n# create a superuser\npython manage.py createsuperuser\n```\n\nYou can uses `deploy/stockazio-server.service` for your systemd service. \n\n## NodeJS warning\nYou might need to uses thoses commands because of weird things in NodeJS and incompatibilities...\n\nIf using NodeJS 16.x uses the following commands for the frontend instead of the other ones:\n```\nCXXFLAGS=\"--std=c++14\" yarn install\ndo yarn build classic\n```\n\nFor NodeJS 17.x:\n```\nCXXFLAGS=\"--std=c++14\" yarn install\nNODE_OPTIONS=--openssl-legacy-provider yarn build\n```\n\nThe build might also fails related to memory (https://github.com/vitejs/vite/issues/2433) so the workaround is:\n```\nnode --max_old_space_size=16384 ./node_modules/vite/bin/vite.js build\n```\n\n## Frontend\n```shell\nsudo su - stockazio\ncd stockazio/front\nyarn install\nyarn build\n```\n\n## Nginx\nSee the file `deploy/stockazio-nginx.conf` for a sample, don't forget you need all the `location /xxx` as the example to make it works.\n\n## Development\n\nFor local development, you always needs to export `DJANGO_SETTINGS_MODULE=config.settings.local` to have the right config:\n```\ncp deploy/env.dev.sample .env\n$EDITOR .env\ncd api\nexport DJANGO_SETTINGS_MODULE=config.settings.local\npython manage.py ...\n```\n\nA sample config and extensions list for VScode are provided in `api/.vscode/` and `front/.vscode/`, open two separate instance for front and api to use them.\n\n### Docker All-In-One image build\n```\ndocker build -t stockazio-allinone -f Dockerfile-allinone .\n```\n\n## Updating\nLook at release changes first if anything is needed.\n\n```\nsudo su - stockazio\ncd stockazio\nsource venv/bin/activate\ngit pull\ncd front\nyarn install\nyarn build\ncd ../api\npip install -r requirements.txt\npython manage.py migrate\n```\n\nThen restart your `stockazio-server` service.\n\n# Install - docker All In One\nYou can use the `Dockerfile-allinone` to run StockazIO, a `docker-compose.yml` is also given as an example if wanted.\n\nSee the file ./deploy/env.prod.sample for the list of ENV variables you can use for the container.\n\nYou can copy that env file, edit it, and use `--env-file your-env-file.prod` for `docker run/exec` too.\n\nThe volume for uploads is `/uploads`, `/statics` for the static files.\n\nTo migrate the database:\n```\ndocker exec -it stockazio /venv/bin/python manage.py migrate\n```\n\nTo seed database:\n```\ndocker exec -it stockazio /venv/bin/python manage.py seeds_database\n```\n\nTo create your superuser:\n```\ndocker exec -it stockazio /venv/bin/python manage.py createsuperuser\n```\n\nExample build \u0026 run:\n```\ndocker build -t stockazio-allinone -f Dockerfile-allinone .\ndocker run --net=host --name stockazio -it --rm --env-file .env -v /local/path/to/uploads:/uploads stockazio-allinone:latest\n```\n\nUses the following when using Docker Compose:\n```\ndocker compose exec -it web /venv/bin/python manage.py\n```\n\nYou will still have to runs the \"crons\" (like importers) from your main system crontab.\n\nExamples:\n```\n# /etc/cron.d/stockazio\n# Choose only one\n# System\n0 0 * * * root /home/stockazio/venv/bin/python /home/stockazio/stockazio/api/manage.py import_orders\n# Docker\n0 0 * * * root docker exec -it stockazio /venv/bin/python manage.py import_orders\n# Docker Compose\n0 0 * * * root docker compose exec -it -p stockazio web /venv/bin/python manage.py import_orders\n``` \n\n# Install - docker split frontend \u0026 backend\nTODO\n\n# Orders importer\n- Current vendors supported: Mouser\n- Set the required values in the `.env` file for Mouser\n- Run one time everyday a cron uder the user running the app with:\n```\n/path/to/app/venv/bin/python /path/to/app/api/manage.py import_orders\n```\n\nIt will by default import from 'ThisMonth', you can use `--filter=LastMonth` to fetch previous orders.\n\nAvailable realistic and useful values for filtering: Today, ThisWeek, ThisMonth, LastMonth, ThisYear, LastYear and All.\n\nYou then will have to navigate to 'View - Order importer' in the web ui to manage orders: set a default vendor matching the ones in the db, set categories, manage the categories matchers, etc.\n\n# TODO List\n- Export of all components or a category or search\n- Mobile app / better mobile layout\n- More substitutions for labels template\n- Web QrCode scanner\n\n# Generated QRCodes format\nFormat changed but both URLs are handled by the search.\n\n- StorageLocation: `web+stockazio:storageLocation,{uuid}` (old format: `stockazio://storageLocation/{uuid}`)\n- Part: `web+stockazio:part,{uuid}` (old format: `stockazio://part/{uuid}`)\n\n# Label templates\nThe two builtin label templates are also available in the `docs` folder to use with https://pdfme.com/template-design\n\n# Changelog of breaking changes\n- Part file attachments split into file and picture, if you had uploads prior to that split, use that command to migrate them: `python3 manage.py migrations_move_from_one_to_two_part_file_fields`\n## 1.4\nLabel Templates format changed. Three text fields are now possible: `name` (fixed), `category` (fixed) and `description` (templated).\nSee the file https://github.com/rhaamo/StockazIO/blob/master/api/controllers/part/management/commands/seed_label_templates.py#L16 for the new formats to adapt yours.\nThe 12mm template only gets `name` and a `description` with category name and description, while the bigger one gets the three separated.\nThe 12mm template has been changed to a width of 60.\n## 1.4.1\nLabel templates fixes\n\n# Images sources\n- Footprints\n    - Unless noted, from https://commons.wikimedia.org/, original names, some have been edited to add a transform for orientation and size.\n    - plcc.svg by cpsdqs\n    - so8.svg other\n    - tqfp.svg other\n    - qip-component-package-photo.jpg [here](https://blog.mbedded.ninja/pcb-design/component-packages/qip-component-package/#\u0026gid=1\u0026pid=1)\n- Manufacturers\n    - \\*shrug*\n\n# Contact\n- Fedivers: dashie at nya.otter.sh\n- Email: stockazio at otter dot sh\n\n# License\nAGPL v3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaamo%2Fstockazio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhaamo%2Fstockazio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhaamo%2Fstockazio/lists"}