Inspiration

“Each year, around 4,600 fatal accidents involving semi-truck drivers occur. About 182,000 people suffer injuries in crashes with large trucks and buses annually. Accidents involving semi trucks often cause substantial injury due to the much larger size of trucks. Aug 23, 2022”

Truck driving is the backbone of the U.S and is integral to the health of our economy. The current pay model for truck drivers revolves on a “cents-per-mile” system. In California, the current pay for solo drivers is 0.28-0.40 cents per mile. However, not all miles are created equally. We sought to evaluate a route's "danger multiplier" using incident data, to provide a more informed argument for truck driver rate negotiations. Using this model we could create safer roads and fairer pay for America's truck drivers.

What it does

After receiving a start and end address for a haul, we generate three different routes using INRIX's Route generation API. We then display the danger multiplier, the distance, and an adjusted rate for each route. We calculate our danger multiplier by cross referencing the route location data with INRIX's Incident tracking API. Using this API we can determine the amount of incidents in a given day and their severity. Using a formula based on the severity of incidents encountered per mile, we receive a multiplier that we can apply to a cents-per-mile flat rate and the total rate distance. We display it all on a scaleable map that visualizes each route and cleanly presents the corresponding data.

How we built it

For our frontend, we used the Angular framework to create all the components, as well as Leaflet specifically for the map. On the backend side, we used the INRIX API to gather the route data, as well as incidents along the route, and also the PositionStack API to convert addresses to coordinates. On the backend, we also have a mathematical formula which calculates the danger multiplier using INRIX data. We send back the coordinates and incident data to the frontend, where it is projected onto the Leaflet map/legend. We merged our work together using GitHub.

Challenges we ran into

All of us were were new to APIs, so we struggled to obtain the data from the API at first. Later on, we had a hard time with connecting our data from the API with the frontend, and it ended up taking up most of our time during the Hack-a-thon. It was especially hard for us to get the map working and projecting the routes onto the map. We also struggled in general because most of us are new to the Angular framework, and have little experience writing code in Typescript.

Accomplishments that we're proud of

We are proud of the fact that we were able to successfully grab and manipulate data from the API, as well as use a new framework and work with maps--which none of us have done previously.

What we learned

We learned that it probably would've been best for us to choose a framework that all of us are comfortable using, so that we don't spend too much time on trying to learn new frameworks, languages, or packages. We could also definitely work on effectively merging our work on GitHub, because it would've saved us a lot of time if we had less merge conflicts to deal with. It would have also been advantageous for us to familiarize ourselves with APIs beforehand.

What's next for Fairway

The next step in fairway would be to further refine the mathmatical algorithm that calculates the danger factor, perhaps utilizing more data, and also try to improve on the efficiency of our code.

Share this project:

Updates