Skip to content

therebelrobot/remix-bus-scheduling

Repository files navigation

Remix Bus Scheduling

This is an example application built as a coding challenge for Remix.

See it live @ github.aster.hn/remix-bus-scheduling

Tech used:

Features / Acceptance Criteria

  • The left edge of each rectangle should be positioned according to its start time. The right edge of each rectangle should be positioned according to its end time. Represent each minute as one pixel.
  • The height of the rectangle should be the same across all trips.
  • The rectangle should display the trip’s id field inside.

Still 00001


  • A selected trip should be visually distinct from other trips.
  • Clicking on an unselected trip should select that trip.
  • Clicking on a selected trip should unselect that trip.
  • No more than one trip should ever be selected at the same time.
  • It should be clear to the user that trips are clickable.

Gif 00001


  • To move a trip between buses, select the trip, then click on the row of the bus you want to move it to.
  • Clicking on a trip in another row should still update the selection instead of moving the selected trip.
  • It should not be possible to assign a trip to a bus where it would conflict with existing trips.
  • Two trips conflict if they overlap at any point other than their endpoints.
  • After moving a trip, it should no longer be selected.
  • If a bus has no trips assigned to it, it should not be displayed.

Gif 00002


  • When a trip is selected, a new “provisional” row should appear at the bottom of the schedule. This row should be empty.
  • Clicking on this row should assign the trip to a new bus.
  • When no trip is selected, the provisional row should not be displayed.

Gif 00003


  • Add zebra striping to the rows. Every other row should be a light grey color.
  • At the top of the page, add an x-axis, with tick marks on the hour, to make it easier to see when trips start and end.
  • At the left side of each row, add a header, containing:
    • A name or identifier for the bus
    • The earliest start time among trips in the bus
    • The latest end time among trips in the bus

Still 00004


Additional Polishes:

  • Dark mode Gif 00004

  • Route dragging between buses Gif 00005

  • SVG buses replacing the boxes Still 00002

  • faint vertical dividers per hour Still 00003

  • "ghost" route on select/hover Gif 00006

Development

Setup

nvm use # sets node version to 14
yarn # installs dependencies
yarn start # starts development server (or prod server if ENVIRONMENT=production)

then go to localhost:9898

Note: .env is included in this repo for convenience of setup, standard practice is to omit it

Build + Deploy

yarn build

This will create a new build in /docs (This folder name wasn't my choice, github pages is opinionated for their base folder naming)

Pushing into main branch will deploy automatically to github.aster.hn/remix-bus-scheduling