https://github.com/blockchainsllc/opinionator-backend
https://github.com/blockchainsllc/opinionator-backend
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/blockchainsllc/opinionator-backend
- Owner: blockchainsllc
- Created: 2019-09-30T08:58:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:41:36.000Z (over 3 years ago)
- Last Synced: 2024-12-30T07:43:35.207Z (over 1 year ago)
- Language: TypeScript
- Size: 1.22 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# blockchain-voting-backend
## Documentation
To view the OpenAPI documentation:
1. Go to https://editor.swagger.io/
2. Copy'n'paste the content of `docs/openapi.yaml` into the editor
3. Enjoy!
## Build/run with docker
To build this as a docker image run:
`docker build -t blockchain-voting-backend .`
To run it on docker:
`docker run -it --rm --init -p 9999:9999 blockchain-voting-backend`
It'll listen on port `TCP 9999` for http requests. `CTRL-C` to stop it.
## Build/run old-fashioned
Make sure to have installed:
- NodeJS (current LTS recommendeD)
- TypeScript `npm install -g typescript`
- The ability to build `node-gyp` modules
To build:
1. `npm install`
2. `tsc`
To run: `node ./build/server.js`
## Configuration
The backend can be configured by some environment variables:
Variable | Description | Default
--- | --- | ---
`DB_HOST` | Postgres database host | `localhost`
`DB_USER` | Postgres database user | `votingadmin`
`DB_PASSWORD` | Postgres database password | `supersecret`
`CONTRACT_ADDR` | Ethereum smart contract address | `0x50ba2e417d573fcd67fab8ee5d6d764b105cd5f7`
`PORT` | HTTP API port to listen on | 9999
`RPC_URL` | URL to the ethereum client RPC | `http://localhost:8545`