Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/busbud/coding-challenge-frontend-b

A microsite that lists bus travel schedules for a given route and a given date
https://github.com/busbud/coding-challenge-frontend-b

Last synced: about 1 month ago
JSON representation

A microsite that lists bus travel schedules for a given route and a given date

Awesome Lists containing this project

README

        

# Busbud Front-End Coding Challenge

![osheaga](https://cloud.githubusercontent.com/assets/1574577/12971188/13471bd0-d066-11e5-8729-f0ca5375752e.png)

It will be hot this summer in Montreal with the [Osheaga festival](http://www.osheaga.com/)!
Your challenge is to build a microsite that allows a traveler from Québec to find one-way departure schedules for the festival's opening weekend.

## Functional requirements

- Has a simple onboarding screen that will trigger the departure search
- Lists all the departures for a given origin city (**Québec - geohash: f2m673**) and a given destination city (**Montréal - geohash: f25dvk**) for a given day (**the 2nd of August 2021**) for **1** adult.
- For each departure, we want, at least, to see the **departure time**, the **arrival time**, the **location name** and the **price** (use `prices.total` of the `departure`).

## Non-functional requirements

- Challenge is submitted as pull request against this repo ([fork it](https://help.github.com/articles/fork-a-repo/) and [create a pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/).
- The microsite should be deployed to [Heroku](https://devcenter.heroku.com/articles/getting-started-with-nodejs).

### Bonus

* Localization: support for multiple languages (English, French, ...)
* Responsive design

### Remarks

* You can setup your microsite any way you like; we're partial to NodeJS, ExpressJS and React
* CSS can be written using SASS, LESS or similar higher-level language

### Things that are important to us

- Code quality, maintainability and readability
- Attention to the User Experience

### Things you'll not be evaluated on

- Features we didn't list in this README
- The quantity of code you write

# Documentation

## Supporting API

The following documentation describes the API you'll need to use to build out the challenge deliverable.

The API you'll be using is hosted at https://napi.busbud.com. This is the Busbud production API.

To interact with it from your code, you'll need to provide the following HTTP headers

HTTP Header | Value
------------|------
Accept | `application/vnd.busbud+json; version=2; profile=https://schema.busbud.com/v2/`
X-Busbud-Token | value provided in challenge invitation email (if not contact us)

### Search overview

Search is performed in two steps

1. A [search is initialized](#initialize-search), and may be `complete` if results are served from cache
2. An initialized and incomplete [search is polled](#poll-search) until `complete`

### Initialize search

Initiating kicks off a search against the various supplier systems if one has yet to be started. It also includes a wealth of related models (cities, locations, operators, etc) in its response to ensure a client has all the context necessary to present a compelling experience to the user. If the cache already holds departures for the requested search, the departures will be returned as part of the response.

To get departures, search is initialized via the following endpoint:

https://napi.busbud.com/x-departures/:origin/:destination/:outbound_date

Path parameters:

- `origin` : Origin's geohash
- `destination` : Destination's geohash
- `outbound_date` : ISO 8601 Outbound departure date

Querystring parameters:

- `adult` : Number of adults
- `child` : Number of children
- `senior` : Number of seniors
- `lang` : ISO 639-1 (2 letter code) language code (supported values include `en`, `fr`, `es`, and a few others)
- `currency` : ISO 4217 currency code (supported values include `CAD`, `USD`, `EUR`, and a few others)

The response looks like:
```
{
"origin_city_id": "375dd5879001acbd84a4683dedf9eed1",
"destination_city_id": "375dd5879001acbd84a4683ded9c875b",
"cities": [
{ City },
{ City }
],
"locations": [
{ Location }
{ Location }
],
"operators": [
{ Operator },
{ Operator }
],
"departures": [
{ XDeparture },
{ XDeparture }
],
"complete": false, //