Giter Site home page Giter Site logo

basilcea / huxley2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jpsingleton/huxley2

0.0 0.0 0.0 279 KB

A cross-platform JSON proxy for the GB railway Live Departure Boards SOAP API

Home Page: https://huxley2.azurewebsites.net

License: European Union Public License 1.2

C# 96.66% HTML 3.29% Dockerfile 0.04%

huxley2's Introduction

Huxley 2 Community Edition

A cross-platform JSON proxy for the GB railway Live Departure Boards SOAP API

This project is treeware! If you found it useful then please plant a tree for me.

Buy me a tree!

Note: Huxley 2 is considered feature-complete and will only be updated to fix bugs or move to a new .NET LTS version.

About

Huxley 2 is a CORS enabled cross-platform JSON ReST proxy for the GB NRE LDB WCF SOAP XML API (called Darwin). It supports both the Public Version (PV) and the Staff Version (SV). It's built with ASP.NET Core LTS (.NET 6.0), C# 10 and lots of abbreviations!

The primary purpose of Huxley 2 is to allow easy use of the LDB API from browser-based client-side PWAs made with JavaScript or TypeScript. Additionally, it opens up the Windows enterprise API to agile developers on macOS and Linux.

Get Started

Check out the live demo server for API documentation and to give it a try.

The demo server comes with zero guarantees of uptime. It can (and regularly does) go down or break.

Get Your Own

There are detailed instructions on how to host your own instance on Azure in this blog post.

Running with Docker

  1. Ensure you have Docker and Docker Compose installed
  2. Create an .env file in the Huxley2 directory with the access tokens. You can delete the ones you're not using.
  3. Run docker-compose up
  4. The app should be available at localhost:8081

Example .env file:

ACCESS_TOKEN=abcde12345
STAFF_ACCESS_TOKEN=abcde12345
CLIENT_ACCESS_TOKEN=abcde12345

To rebuild use docker-compose build or docker-compose up --build.

Station Codes File

If you need to regenerate the station codes CSV file in this repo then you can do so easily with jq (and curl) using an instance that has access to the staff API (and has been restarted recently). On Linux, you can install simply with your package manager, e.g. sudo apt install jq (on Ubuntu/Debian).

For example, using the Huxley 2 demo instance you can run this one-liner:

curl --silent https://huxley2.azurewebsites.net/crs | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > station_codes.csv

If using a local server with a self-signed certificate:

curl --silent --insecure https://localhost:5001/crs | jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' > station_codes.csv

License

Licensed under the EUPL-1.2-or-later.

The EUPL covers distribution through a network or SaaS (like a compatible and interoperable AGPL).

huxley2's People

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.