Publicover & Co., Winter 2020–present
I had just landed in Hamburg after leaving an agency job, and I was unsure if I was going to move to freelance or look for more agency work. Plower API is a portfolio piece for either choice. It simulates a snowplow business in Ashtabula, OH, my hometown, a place used to seeing heavy snow.
This Rails and GraphQL API uses JWT for authorization. There's no front end. Users are admins, drivers or customers. Admins set a service menu with prices. There's an admin panel where they approve service to customers and set up billing. Users sign up for the services they want and are given the option to be an Early Bird customer, which guarantees their driveway will be plowed before 7:30, the time most people leave for work.
Each day at 3:00 AM and 5:00 AM, the system reaches out to a local weather service API. If there is a significant amount of snow that has fallen by that time, the route calculation services are kicked off. These can also be activated by a seeing a specific rate of snowfall that means driveways will need to be plowed by 7:00 AM even if the threshold from the first criterion is not met. To determine what route a driver should take, the system reaches out to the Open Source Routing Machine twice: once to calculate the shortest route for the Early Bird customers, then again to create the route for the remaining customers. Drivers plow all the snow, and, when the routes for the day are marked as complete, the user receives an email requesting payment through the system via the Stripe API.
Just like with Tankr, state management of the order along with the routing concerns took more than a minute to untangle.