Giter Club home page Giter Club logo

bubonem's Introduction

bubonem

About

bubonem is built with ruby and javascript. Good stuff... It used to be on jquery for a while but now it is running on vanilla. Great....

Install locally

The ruby things are set up in the Gemfile. Use whatever ruby version that is in .ruby-version with rbenv or something. Install bundler:

gem install bundler

and then install all the gems

bundle install

The javascript things are alls native to the browser so no need to install anything. Some fonts and likewise are drawn from the internets.

Configuration

For the APIs with Storstockholms Lokaltrafik you will need API tokens. To avoid putting them in code the library dotenv is used. You need to create a file called .env in the root folder and put tokens in it like so:

SL_API_KEY_SEARCH=<your-search-token>
SL_API_KEY_DEPARTURES=<your-departures-token>

The search API is only used when setting up a dashboard on the front page. If you know the stop ids from somewhere else you can use them directly instead. The departures API is used once a minute for each station on the dashboard which means that the lowest level is not enough. If you are running out of quota you will get a message about that involving the error code 429 instead of departure times. To get API keys you need to register with trafiklab.

Bubonem used to go against the undocumented APIs behind the SL site but there has been harder security put in place so the official APIs are the way to go now.

Run locally

The app is served by sinatra and the easiest way to run it locally is by using rackup:

bundle exec rackup config.ru

Open a browser at http://localhost:9292 to behold the started things

Run server side

On the server unicorn is used to run things. It can connect with nginx over native sockets which is nice for performance. (Not important but nice.....)

The configuration for unicon lives in unibubonem.rb. To run it on a server:

bundle exec unicorn -c unibubonem.rb -E production -D

This tells unicorn to run as a daemon in production mode. Sweet.

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.