Code Monkey home page Code Monkey logo

gatomalo2's Introduction

GATOMALO

Server for panamanian fiscal printers, written in NodeJS by Roberto E. Zubieta.

Software made in Panama

Summary

  1. Install NodeJS (Minimum Version: 7.6.0. Recommended: 8+)
  2. sudo npm install yarn -g To enable yarn.
  3. yarn install to download all dependencies
  4. Fill private.json with your ZOHO books credentials. Use private.sample.json as example.
  5. npm run to start the server

Details

  • 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

Testing

Includes some minimal unit tests for double-checking the output strings. They can be executed by running npm test

Running through Docker

This server was designed to work directly inside a Docker container. No git pull required.

  1. Install Docker
  2. Write ./private.env with your Zoho Books credentials. Use ./private.env.sample as example.
  3. 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 the printed_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

Running through docker-compose

An even easier deployment experience.

  1. Install Docker
  2. Install Docker-Compose
  3. mkdir /srv/gatomalo2
  4. mkdir /srv/gatomalo2/database
  5. cd /srv/gatomalo2
  6. Write /srv/gatomalo2/private.env with your Zoho Books credentials. Use ./private.env.sample as example.
  7. Copy ./docker-compose.yml into /srv/gatomalo2/
  8. 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.

gatomalo2's People

Contributors

zubietaroberto avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.