Alma Self-Checkout application (fork) that can run in a contact-free environment (using a scanner).
K-State Libraries forked this as a PoC for self-checkout in Vet teaching hospital library.
It is deployed to libutil, and has DNS at selfcheck.library.colostate.edu.
It is managed with systemd, so to start/stop/restart use the appropriate systemctl
functions.
It is deployed with Ansible, so if changes need to be made make them to the ksu-branded branch of this repo, then on the Ansible host run the libutil playbook with the selfcheck
flag to deploy changes.
To change the timeout, change the LOGOUT_TIME_LIMIT
value in client/src/App.js
and rebuild/redploy with Ansible.
The app is IP-based, which is controlled in the Apache config. To change this, changed the IPs allowed in /etc/apache2/sites-available/selfcheck.library.colostate.edu.conf
. The config.js file in the projects root only sees the localhost address, changing things here will not have the intended effect.
This web app utilizes the Alma API to power a self checkout station. There are two components to the selfcheck app: a client and a server.
The (node) server proxies ALMA api requests so that secrets don't have to be shared with clients. The server also filters ip addresses so that access is limited to intended sources.
The (react + tailwind) client facilitates touchless interaction, given the availability of a barcode scanner. This application has been built with the aim of making the library covid-safe by supporting touch free interactions for all user input.
- Clone the repository to your machine.
- Run
npm install
in the cloned directory. - Copy
example_config.js
, rename it toconfig.js
, and set the configuration variables. - Set your node env port if you don't want it to run on 3000 (recommended).
- Optionally, set up an Apache reverse proxy, and limit to the IP address(es) of your kiosk(s). The server can only handle requests from IPs in the configuration file.
- Navigate to the
/client
directory - Run
npm install
andnpm run build
to set up the client. The server will serve the client directly from/client/build/
which is generated in thenpm run build
step.
Once you have completed the installation steps:
node main.js
To get the benefits of hot reloading that come with create-react-app, this workflow works:
- Modify
client/src/api/apiConstants.js
so that port is hardcoded to 3000 (never push this change). - Run
node main.js
(now listening on 3000). - In
/client
, instead ofnpm run build
, runnpm start
. This will probably try to host on port 3000 and ask if you'd like to use a different port. Choose yes (it will probably host on 3001).
Now, http://localhost:3001 is the create-react-app webpack hosted version of the client (it's not being served by the server). This means that client side code updates hot-reload and server requests continue working (because you hardcoded the port and started the server to begin with).