- Get docker
- Pull Postgres container:
docker pull postgres
- Run Postgres container:
First use:docker run -d -p 5432:5432 --name sky_pg -e POSTGRES_PASSWORD=1q2w3e postgres
Later:docker start sky_pg
NB: credentials are hardcoded in sky-bus, later will be moved to.env
- Get a pgadmin:
docker pull dpage/pgadmin4
- Run pgadmin container:
First use:docker run -p 80:80 --name sky_pgadm -e 'PGADMIN_DEFAULT_EMAIL=user@user.user' -e 'PGADMIN_DEFAULT_PASSWORD=1q2w3e' -d dpage/pgadmin4
Later:docker start sky_pgadm
- Connect containers in a network so they are able to reach each other (make a shell script or run each of the following lines):
docker network create sky_network
docker network connect sky_network sky_pg
docker network connect sky_network sky_pgadm
docker network inspect sky_network
- Type
localhost
in your web-browser's address bar. If you have done everything correctly, you should be able to see a pgAdmin login page. - Input the default login/password:
user@user.user
/1q2w3e
(from p. 5). You should see the pgAdmin dashboard. - Press "Add new server" in Quick Links section. In General tab in Name input sky_pg, then go to connection tab and set Host name/address to
localhost:5432
, username topostgres
and password to1q2w3e
(username and password are from p. 3). - Press Save.
- In the
Browser
tab (on the left) selectservers->sky_pg->Databases->postgres
. - Open
Tools->Query tool
in the top bar. - Paste all of the code from
dump.sql
file from the root of the repository to the Query editor and press the ▶ button above. - Refresh the page. You should be able to see
sky
scheme in Schemas. - Go to the root of the cloned repository and run:
yarn
yarn dev
- Input
localhost:3000/ping
in your browser address bar. You should getPONG GET
in response.
You are ready to develop. You can use yarn dev
to run the bus.
If you want to run specific version, use docker:
docker pull savolkov/sky-bus
docker run -p 3000:3000 --name sky_bus -d savolkov/sky-bus
POST
/open
Body description
{
uuid: "entryphone id"
}
Body example
{
uuid: "xxxx-xxxx-xxxx"
}
POST
/inform
Body description
{
uuid: "entryphone id"
dateFrom: "",
dateEnd: "",
audioFileUrl: ""
}
Body example
{
uuid: "xxxx-xxxx-xxxx"
dateFrom: "2018-08-09T18:31:42",
dateEnd: "2018-08-09T18:31:42",
audioFileUrl: "https://some.file.mp3"
}
POST
/inform
Body description
{
uuid: "entryphone id"
dateFrom: "",
dateEnd: "",
audioFileUrl: ""
}
Body example
{
uuid: "xxxx-xxxx-xxxx"
dateFrom: "2018-08-09T18:31:42",
dateEnd: "2018-08-09T18:31:42",
audioFileUrl: "https://some.file.mp3"
}
- Enable event sending to web server in Sigur mysql db (use web integration docs)
- Set webhook url to http://localhost:3000/sigur/event
- reboot sigur via Sigur server monitoring tool