Point of Sale for Dead Mongoose
To install the package locally, you first have to install nvm
. Instructions can be found here.
Make sure you install at least the latest LTS release.
- Clone the repo to a directory of your choice.
- Enter the directory:
cd /path/to/your/directory
. - Follow the guide at "Install NFC" for making NFC Functional.
- Run
npm i
. This will use nvm that you've installed before. - Copy over
sample.env
and name it.env
:cp sample.env .env
- To update the values in
.env
, simply enter the file using your favorite editor, e.g.nano .env
. - Start the application with
npm start
.
If changes are made to files in the semantic folder, these changes will become active only after you run the following command:
npm run build-semantic
.
Making a NFC Reader functional is quite a task so here is a guide how to make NFC Functional. When using Linux there is a driver in place for handling Smartcard readers. We don't use this driver so we have to disable it and use the driver provided with the native node module which has to be installed with some specific steps.
- If you want to use NFC-PCSC you should follow their guide on how to install the extension.
- Check if the smartcard reader is connected to your pc by running the command
lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 3: Dev 6, If 0, Class=Chip/SmartCard, Driver=pn533_usb, 12M
...
This should return something comperable to this. If you don't see Class=Chip/SmartCard
The NFC reader is not recognized and should first troubleshoot this issue.
- In This case you can see the driver
pn533_usb
is being used. You dont want this since we use the driver provided with pcsclite. Run
lsmod | grep pn533_usb
Module Size Used by
pn533_usb 20480 0
pn533 45056 1 pn533_usb
nfc 131072 1 pn533
This will return a list of drivers being used and these need to be disabled.
- Run
sudo nano /etc/modprobe.d
and insert all the modules likes this:
pn533_usb
pn533
nfc
- Reboot your PC
- After restarting run these commands
# systemctl enable pcscd
# systemctl start pcscd
The repository supports building a deb-package to be able to install the app on debian/ubuntu machines (or any derivatives). To create the deb-package, run the following command:
npm run build
The deb-package can be found in dist/installers.
When the deb-package is installed and opened via gnome, the application expects the environment file to be in /home/$USERNAME
. Make sure you copy sample.env
to this location, rename it to .env
, and update its values.
You can also just run source .env
to add your environment variables to the current shell session. Add it to your .bashrc
to make it permanent.