Backend of the Pick-by-Light-System
Ever searched for items in a shelf? Tools or parts in a workshop organizer?
Pick By Light is a concept for helping people find things. The position of the currently desired object will be shown through visual signals. This concept is used by logistic centers like storage buildings, but can also be used on a smaller scale.
This pick-by-light-project (alias pbl-project) is intended to enable people to build their own pick-by-light system – big or small and easily adaptable.
It was developed as a students project in the course “SWT-Projekt” at Technische Hochschule Mittelhessen (THM).
Documentation can be found in Project Wiki
- NodeJS → The backend server is a NodeJS server.
- MongoDB → The database in which the application's data is organized is a MongoDB database.
- Mongoose → The schema-based technology Mongoose is used in order to provide an easy way to handle data within the database.
- Chai → Automatic testing is realized through the testing framework Chai.
- LDAP → Supports authorization via LDAP-Server (but authorization via backend without LDAP is also possible).
cd pbl-backend
npm install
npm run dev
npm run start
npm run build
NODE_ENV=docker_dev docker-compose up --build --detach
docker-compose down
Defined in config
- debug → if set true debugging logs will be printed
Defined in default, docker_dev, docker_prod and test
- disableAuth → if set true any authorization functionality will be turned off - used for testing and development only!
- disableLDAP → if set true only local authentication is used!
Defined in constants
-
jwtkey → JWT stands for json web token and is a standardized acces token, which secures data between two parties. → An implementation of JWT can be found at https://jwt.io/. → The jwt key defined in config constants is used to sign and verify the payload in the files (see auth.controller.ts and auth.module.ts)
-
expirationTime → time until jwtkey expires
-
requiredLangs → languages that are required ("en" as English, "de" as German)
Make sure your testing database is empty. Execute tests defined in tests
NODE_ENV=test npm run test
In case you might want to use test data add test data from json-Files tests into mongo database
npm run addData
npm run removeData
For some pcs the docker startup needs some extra commands. Try
systemctl start docker
before doing anything else and add sudo when starting the mongo server
sudo NODE_ENV=docker_dev docker-compose up --build --detach