Server for panamanian fiscal printers, written in NodeJS by Roberto E. Zubieta.
Software made in Panama
- Install NodeJS (Minimum Version: 7.6.0. Recommended: 8+)
sudo npm install yarn -g
To enable yarn.yarn install
to download all dependencies- Fill
private.json
with your ZOHO books credentials. Useprivate.sample.json
as example. npm run
to start the server
- Tested on NodeJS 8.1.2 running on Ubuntu 16.04.2 LTS
- The server entry point is in
bin/server.js
- Written in Koa v2
Includes some minimal unit tests for double-checking the output strings. They
can be executed by running npm test
This server was designed to work directly inside a Docker container. No
git pull
required.
- Install Docker
- Write
./private.env
with your Zoho Books credentials. Use./private.env.sample
as example. - Execute the following command to start the service:
docker run -p 5000:5000 -v /srv/gatomalo/database:/srv/gatomalo/database \
--env-file=private.env --device=/dev/ttyUSB0 --restart=always \
-d zubietaroberto/gatomalo
Details about this command:
- -p binds port to 5000 (Allows entry to the server on localhost:5000)
- -v Saves the database file on
/srv/gatomalo/database
on the host machine. Otherwise theprinted_invoice
will be reset whenever the host image changes. - --env-file adds the contents of private.env as environment variables to the container
- --device name of the USB port where the printer is installed. Must be the
same as the one in
./Puerto.txt
- --restart the service will always start with the host computer.
- -d run as a daemon.
- zubietaroberto/gatomalo the name of this image in Docker Hub
An even easier deployment experience.
- Install Docker
- Install Docker-Compose
mkdir /srv/gatomalo2
mkdir /srv/gatomalo2/database
cd /srv/gatomalo2
- Write
/srv/gatomalo2/private.env
with your Zoho Books credentials. Use./private.env.sample
as example. - Copy
./docker-compose.yml
into/srv/gatomalo2/
- Start the service:
docker-compose up -d
The docker-compose
will install all the dependencies, mount the folder as a
volume, create the SQLite database and automatically restart the container when
the machine restarts.