Giter Club home page Giter Club logo

sky-bus's Introduction

sky-telehouse/sky-bus

Develop (latest): Build Status

Master (release-1.0.0): Build Status

Installation

  1. Get docker
  2. Pull Postgres container: docker pull postgres
  3. 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
  4. Get a pgadmin: docker pull dpage/pgadmin4
  5. Run pgadmin container:
    First use: docker run -p 80:80 --name sky_pgadm -e '[email protected]' -e 'PGADMIN_DEFAULT_PASSWORD=1q2w3e' -d dpage/pgadmin4
    Later: docker start sky_pgadm
  6. 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
  1. 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.
  2. Input the default login/password: [email protected]/1q2w3e (from p. 5). You should see the pgAdmin dashboard.
  3. 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 to postgres and password to 1q2w3e (username and password are from p. 3).
  4. Press Save.
  5. In the Browser tab (on the left) select servers->sky_pg->Databases->postgres.
  6. Open Tools->Query tool in the top bar.
  7. Paste all of the code from dump.sql file from the root of the repository to the Query editor and press the ▶ button above.
  8. Refresh the page. You should be able to see sky scheme in Schemas.
  9. Go to the root of the cloned repository and run:
yarn
yarn dev
  1. Input localhost:3000/ping in your browser address bar. You should get PONG 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

API Docs

Sputkin

Open door

POST /open

Body description

{
   uuid: "entryphone id"
}

Body example

{
   uuid: "xxxx-xxxx-xxxx"
}

Set people inform

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"
}

Set people poll

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"
}

Sigur integration

  1. Enable event sending to web server in Sigur mysql db (use web integration docs)
  2. Set webhook url to http://localhost:3000/sigur/event
  3. reboot sigur via Sigur server monitoring tool

sky-bus's People

Contributors

adenhertog avatar f883 avatar greenkeeper[bot] avatar justingreenberg avatar kanishev2002 avatar savolkov avatar

Watchers

 avatar

sky-bus's Issues

Реализовать типизированные ошибки

Добавить стандартизированные ошибки типа notFoundError, accessDeniedError которые будут обрабатываться в логике приложения. Может быть даже entryphoneOfflineError и другие, чтобы не пробрасывать ошибки axios в бизнес логику

Реализовать persistent storage

Необходимо научиться работать с персистентным хранилищем. Сейчас шина хранит все данные в ОЗУ что не очень хорошо при высоких нагрузках.
Почитать о персистентных хранилищах
Реализация с postgres

Наверное есть смысл написать свой адаптер под какой-нибудь Redis

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.