This repository contains the source code for the database (PostgreSQL) and REST API (FastAPI) of the Smart Inventory ecosystem. The database is designed to host data for the inventory management, storage management, material order management and cabinet access monitoring features of the platforms of the ecosystem (Smart Lock, Augmented Worker Interface, DVIC's website).
- Download the docker-compose.yml file and edit it for your application :
curl -OL https://raw.githubusercontent.com/DeVinci-Innovation-Center/SMART-INVENTORY-DB-API/main/docker-compose.yml
- From the same directory, start the API and DB with :
docker-compose up
Primary keys are underlined and foreign keys are preceded by a hash sign :
users (uid, firstname, lastname)
cabinets (id, description)
categories (id, title, description, #parent_id)
items (id, title, description, price, link, #category_id)
orders_requests (id, date, state, #item_id, #user_id)
storage_units (id, state, verified, #item_id, #cabinet_id)
cabinets_unlock_attempts (id, date, granted, #user_id, #cabinet_id)
Run the unit tests with:
docker exec -it smartinventory_api python3 -m pytest
