Kerst In Het Julianapark

The idea

The idea of KIHJ was to make a simple solution for people to book their tickets for an event in Utrecht, The Netherlands.

This made it rather easy for me to come up with a quick prototype since it's a pretty easy solution as it's basically 1 form and an Email.

The initial version

I started of working on KIHJ in an evening when the frontend was already created for my by Mitchel, who has been an enormous help during the creating and was the one who asked me to help on this project.

The biggest part was done, the UI, but it was time for me to finally get working on the big part, the form submission. 

The form needed to get stuff from the DB on load and put it into the DB on submittion, the data it needed to get from the DB is:

That part was rather easy since the project was done in Laravel which has it's great Eloquent database solution & blade templating. The database part was rather easy since I don't need to store alot of information about the user. The only information stored was their name, email address & number & the only information stored about the timeslots were the begin & end time. 

As soon as this initial version was ready it was back to Mitchel to test with the KIHJ team & update the frontend according to the tests. While Mitchel was doing this I was getting ready on the admin side, which in my case was done using the amazing filament PHP. Which made it really easy for us to create the tables & stats. 


The first hiccup:

As soon as the site went live everything went amazing, until we saw an issue in the admin panel, the bookings were getting duplicated in some cases, This of course wasn't ideal since there was a set amount of tickets people could book, The only option for us was to quickly issue a fix. While I was thinking of a fix I really wanted to overcomplicate a really easy issue. The fix? store a deduplication token in cache so people can't refresh the page to create a new order but instead just display the information of the previous order. This fix was luckily created, tested & deployed in less then 10 minutes. When creating an order we add an UUIDV4 to the form, which acted as our deduplication field, this field is then used to easily track if the form has already been submitted by storing it into the cache & checking if the cache for the key exists when placing an order, This made it possible for us to show the order page without sending an email or creating the DB entry. 

This could have been prevented by doing better planning before going live, like making the name field be a unique value or creating the deduplication in the first pass of the website.


Credits

Huge thanks to the people & project which have contributed or made the process easier:

Made with alot of by Thijmen Rierink