All Projects → schlpbch → Bookingapi

schlpbch / Bookingapi

Licence: apache-2.0
A simple API to book tickets for public transport in Switzerland.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bookingapi

Vbb Modules
List of JavaScript modules for Berlin & Brandenburg public transport.
Stars: ✭ 47 (+213.33%)
Mutual labels:  api, public-transportation
Shgf
Simple HTTP golang framework
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Jenkins4j
Simple and effective Jenkins API wrapper written in Java
Stars: ✭ 12 (-20%)
Mutual labels:  api
Stocks
Haskell library for the IEX trading API: https://iextrading.com/developer/docs/
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Api Example
WIP: Just sample app with API
Stars: ✭ 12 (-20%)
Mutual labels:  api
Currencyviewer
Short python framework that dynamically displays and converts the cryptocurrencies in your Kraken wallet into equivalents fiat money.
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-26.67%)
Mutual labels:  api
Xlnt
📊 Cross-platform user-friendly xlsx library for C++11+
Stars: ✭ 876 (+5740%)
Mutual labels:  api
Nhversion
NHVersion for version your api
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Meaju
meaju is a free link shortener from Germany, which everyone can install on his own server.
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Office365 Management Api Elk
An API connector for the Office 365 Management API and the Elastic Stack
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Screwdriver
An open source build platform designed for continuous delivery.
Stars: ✭ 870 (+5700%)
Mutual labels:  api
Osrs.me
A comprehensive dataset for OldSchool Runescape.
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Chn Eolinker Ams Lite 4.0 For Php
中国最大的在线API管理平台EOLINKER 旗下API管理系统开源精简版,适合个人以及微型团队使用。
Stars: ✭ 869 (+5693.33%)
Mutual labels:  api
Weixinbot
网页版微信API,包含终端版微信及微信机器人
Stars: ✭ 6,903 (+45920%)
Mutual labels:  api
Aseag Python
Das sollte mal zu einer vernünftigen API-Implementation werden, ist derzeit aber einfach nur ein Client
Stars: ✭ 11 (-26.67%)
Mutual labels:  public-transportation
Geochile
Esta es una api de Geocodificación, para que, con las coordenadas Latitud y Longitud se entregue una lista de ciudades cercanas.
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Falko Api
📈 Falko API: Plataform for agile projects management 📊
Stars: ✭ 13 (-13.33%)
Mutual labels:  api
Covid 19 Api
Covid-19 Virus Data API from Johns Hopkins CSSE
Stars: ✭ 15 (+0%)
Mutual labels:  api
Active Forks
Find active github forks of a repo https://git.io/vSnrC
Stars: ✭ 879 (+5760%)
Mutual labels:  api

Build Status dependencies Status

About

This a simple Node.js based mock server to test the bookingAPI. The mock implementation is intended for fast protoyping and to get the API right (Getting APIs right is hard).

To get the API right, a small web application is provided (we are drinking our own champagne).

Once the API is right, the API will be implemented of SBB's distribution system and provided by a simple to access API Management tool. Here is an example of how it might look like:

More to come...

Here you can find a initial functional road map.

Installing

The easiest way is to pull the docker image:

docker pull schlpbch/bookingapi

The latest docker image is always available at https://hub.docker.com/r/schlpbch/bookingapi/.

Running the Mock Server

The easiest way is to run the docker image:

  docker pull schlpbch/bookingapi
  docker run -d -p 80:8080 --name bookingapi-mock schlpbch/bookingapi

or start with

  node app.js

The web app and the API are then running at http://localhost/

Running the Mock Server with NGINX Firewall

Using docker-compose a software defined firewall (see NGINX) is added in front of the mocked server and is linked to the mock server using a software defined network. This allows us to test authentication methods using JSON Web Tokens (JWT) later.

See docker-compose.yml for details.

To start simply use

  docker-compose up

The server uses self signed certificates, they must be replaced with real ones for production!

Live App and Documentation

The Web App is available at:

Thanks to SwaggerUI the up-to-date documentation is always available at:

and the latest JSON can be accessed at:

Developing First, Nodejs and npm which comes with it is needed. Then to install all the modules, simply run:

  npm install

This will install the package defined in package.json file.

To edit the API interactively, do:

  swagger project edit

The browser will then provide you with tab to edit the specification.

To run Swagger in mock mode, start with:

  swagger project start -m

To run the tests:

  swagger project test

To run the mock server, do:

  swagger project start

or more simple:

  npm run dev

npm run dev runs the the express app. It also creates a bundle for the front-end part. This bundle includes source maps for debugging.

To run the app in production please run the following command

  npm run prod

which minifies the bundle and excludes source maps as we do not want to deliver our code in plain text.

To run the mock server as docker container, do:

  docker build .
  docker run -d -p 8080:8080 --name api-mock-srv <containerId>

ToDo

  • Integrate Swagger Middleware to easily pre-populate data
  • Get the API right
  • Expose journey planning as a route of its own
  • Setup API Management
  • Setup Security (JSON Web Token)
  • Products API
  • Cache-Control
  • SuperSaver Prices
  • Validity-Information for Prebookings (20 min offers 30 min prebookings)

Done

  • Clarify legalese
  • Align with FSM specification
  • Complete wiring Wep App with API
  • Translate API to English
  • Write a client to verify the usability of the API (APIs are UIs for developers).
  • Align with Fahrplan team
  • Align with Open Data (better Open API) team
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].