Skip to content

jstefanop/apolloapi-v2

Repository files navigation

apolloapi

Install

$ yarn

Run dev

$ yarn dev

It will:

  1. Create .env file in app directory with following variables
  • DATABASE_URL=
  • APP_SECRET
  1. Create sqlite database futurebit.sqlite in app directory and run pending migrations
  2. Start GraphQL API on http://localhost:5000/graphql

Production build

You can't build this on a low-resources MCU (<= 512MB ram), so there is a script to run the builder in a docker that simulates an OrangePI with Armbian and create a file with all the node_modules compiled.

$ ./scripts/build

It will generate the file build//futurebit.tar.gz

Next step required:

  • scp futurebit.tar.gz to the MCU
  • extract it in a tmp directory
  • copy (overwrite) node_modules to /opt/apolloapi directory
  • pull changes
  • restart apollo service

Production usage

In the system MCU there are several commands built-in:

Apollo API manager:

$ sudo systemctl start|stop|restart|status|... apollo

Miner manager:

$ sudo systemctl start|stop|restart|status|... bfgminer

Wifi manager:

$ nmcli help