API Documentation: here
- Clone project
- Switch to branch development
yarn install
- Create new file
ormconfig.json
with the content found inormconfig.json.example
file - Install PostgreSQL (or run from docker image, see the section below on Running with docker)
- Create database bitscreen
- Create user
bitscreen
with passwordbitscreen
& grant all privileges - Execute sync command:
yarn schema:sync
- Insert entry into provider table with random created & updated timestamps and id = 0 and anonymous value to all other custom columns
- Run ->
export JWT_SECRET=localDev
- Run server ->
yarn start
- Clone project
- Switch to branch development
yarn install
- Create new file
ormconfig.json
with the content found inormconfig.json.example
file - Install PostgreSQL -> https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-20-04
- Access PostgreSQL ->
sudo -u PostgreSQL psql
- Create database called bitscreen ->
create database bitscreen;
- Create user called bitscreen_api with password
bitscreen
->create user bitscreen with encrypted password 'bitscreen';
- Grant privileges to user on database bitscreen ->
grant all privileges on database bitscreen to bitscreen;
- Execute sync command ->
yarn typeorm schema:sync
- From terminal connect to bitscreen database ->
\c bitscreen
(or if you aren't already in postgres interface ->sudo -u postgres psql -d bitscreen
) - Insert entry into provider table with random created & updated timestamps and id = 0 and anonymous value to all other custom columns ->
INSERT INTO provider(created, updated, id, "walletAddressHashed", country, "businessName", website, email, "contactPerson", address) VALUES('2021-07-16 10:23:54', '2021-07-16 10:24:54', '0', 'anonymous', 'anonymous', 'anonymous', 'anonymous', 'anonymous', 'anonymous', 'anonymous');
- Run server ->
yarn start
- Run
yarn typeorm
to see a complete list of available commands. examples: schema:sync, schema:log, query [query]
- Remove
"type": "module"
frompackage.json
- Set
"module": "CommonJS"
intsconfig.json
- Run
yarn seed:config
andyarn seed:run
yarn start
uses nodemon- You can run the server using the docker image or using
docker-compose up
- When using docker-compose, update the image key to point to a local built image if you want to iterate with docker
- The fastest way to iterate in dev mode:
- Run the postgres db in docker (use docker-compose but comment out the
bitscreen-api:
part) or use the system postgres db instance - Run the server in terminal using
yarn start
but don't forget to runyarn schema:sync
the first time and everytime there is a change to the schema undersrc/entity
- Run the postgres db in docker (use docker-compose but comment out the
Using docker-compose will start the postgres database and the bitscreen server
docker-compose up
The above will use the bitscreen server (bitscreen-backend) latest
docker image (murmurationlabs/bitscreen-backend).
You can build local image like this:
docker build -t murmurationlabs/bitscreen-backend:local .
Use a different tag if you don't want it to overwrite the latest
tag
To connect directly to the db we just started
psql -h localhost -p 5432 -d bitscreen -U bitscreen
# then type the password bitscreen
# now you should be in the plsql `bitscreen=#` prompt so you can issue commands
The main deployment is in EKS:
- Uses the docker image
murmurationlabs/bitscreen-backend:latest
hosted in docker hub This docker image is updated in docker hub on every push to the master branch - Postgres database is deployed using bitnami helm chart
- All node.js commands use the options
--experimental-modules --es-module-specifier-resolution=node --loader ts-node/esm
to allow running typeorm with the current version of typescript