mirror of
https://github.com/Retropex/apolloapi-v2.git
synced 2025-05-12 03:00:48 +02:00
Apollo WebOS 2 Backend
|
||
---|---|---|
apolloui-v2@5ee3a36ea3 | ||
backend | ||
config | ||
docker | ||
docs | ||
migrations | ||
src | ||
.dockerignore | ||
.env.sample | ||
.gitignore | ||
.gitmodules | ||
.nvmrc | ||
knexfile.js | ||
LICENSE | ||
Makefile | ||
package.json | ||
README.md | ||
yarn.lock |
apolloapi
Install
$ yarn
Run dev
$ yarn dev
It will:
- Create .env file in app directory with following variables
- DATABASE_URL=
- APP_SECRET
- Create sqlite database
futurebit.sqlite
in app directory and run pending migrations - 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