@onereach/types-hitl-api v0.0.63-rc.0
Getting Started
In this section we are going to explain how to run the application locally, without (almost) any OneReach dependencies.
Make sure OneReach NPM token is available
In order to install some dependencies you are going to need a valid token available as a variable - OR_NPM_TOKEN
. If it is not available using echo $OR_NPM_TOKEN
- you should ask someone to help you setup access to OneReach NPM.
Installing local PostgreSQL
If you already have a local PostgreSQL installed, or know how to do so - you are free to go to the next section.
The easiest way to install a local database - is by using Docker - Install Docker Desktop. After making sure Docker is installed and is available through command line as docker
- we can proceed with installing and creating a local database.
Run the following commands (and replace mysecretpassword
here and in the examples below with an actual password):
docker pull postgres
docker run --name postgresql-local -e POSTGRES_USER=hitl-app -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=hitl-app-db -p 5432:5432 -d postgres
You should be able to connect to this database using command (enter the password, if it is asked):
docker exec -it postgresql-local psql hitl-app-db -U hitl-app -W
Connecting to the local database
Create a file named .env
in the project root directory with the following content:
APP_DEV_PORT=8080
DB_USER=hitl-app
DB_PASSWORD=mysecretpassword
DB_HOST=localhost
DB_PORT=5432
DB_NAME=hitl-app-db
You can change all the values above, if you want to, just make sure that the variables in .env
file point to some valid PostgreSQL instance.
Retrieving deploy config
Make sure you have deploy-platform
project installed on your machine, and a command or
is globally available.
Run the following commands:
or get-config --branch local --client development --env qa --feature master --project hitl-api --service hitl_api.config --service-or-eval service > config.json
A file config.json
, which is ignored by git, should appear in the project root with some content.
Installing packages and starting the application
After installing third party dependencies, we can finally run:
npm install
npm start
This will start the application in the development mode as a simple express
server. Changes to the code will be tracked and server will restart automatically.
An almost empty config.json
file is required to build the application. In order to run the application on AWS, we are going to need real env variables that we are going to retrieve later.
Server now is ready to accept requests, but it will probably fail on every attempt to access database. In order to read and write from database we need to send a request to create or update our SQL tables.
In order to run all migrations to the latest version, run the following request in the console (or in Postman):
curl --location --request POST 'http://localhost:8080/api/v1/migrations' --header 'Authorization: user'
After successful response you should be able to send all other requests.
Testings the application
In order to verify that (most of) the application logic works, you should run:
npm test
If all tests pass successfully - congratulations, this means that the local deployment was successful.
12 days ago
12 days ago
22 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
8 months ago
10 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
6 months ago
9 months ago
10 months ago
10 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
11 months ago
1 year ago
1 year ago
12 months ago
12 months ago
12 months ago
11 months ago
1 year ago
1 year ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago