Ski Training Bookings

Because of the pandemic the UK 'dry slope' ski season has almost entirely been cancelled this year, with most slopes having closed in March and only re-opening, with heavy restrictions, in July.

Even in July, our local ski club — Bowles — was only able to train with racers in family 'bubbles', at a fairly prohibitive cost. Thankfully in August there was a loosening of restrictions and the slope was able to allow up to 15 racers to train.

Booking system screenshot

Spoiler - I wrote a booking system

Of course, that kind of limitation brings another problem — there are more club members who want to train than there are places available, so there needs to be a booking system. We've used the free app/service Teamer before, but have found it to be a little confusing and (I'm told) the admin interface is complicated — which left me wondering whether I could build a bespoke booking system and host it at minimal (ideally no) cost.

Next.js & Vercel to the rescue

I was somewhat familiar with next.js and was vaguely aware that they had an associated hosting solution, but was very pleasantly surprised to discover that Vercel has a robust free tier which is more than enough for my purposes.

I used a next.js starter project that I'd previously tried 'following-along' with (I cheated and pulled the repo, since there were a number of improvements in the codebase compared to my copy); this gave me a boiler-plate for user accounts, sessions and interaction with a MongoDB database, meaning I could concentrate on the 'code logic' and UI for the booking system.

The app took 5-6 days to complete (mostly in evenings, we've been busy at work!), and is now hosted on Vercel. Code is in a public GitHub repo — PRs gladly received.

And for my next trick ...

Whilst I'm pleased with how this came out, what I really wanted was to just add this to the existing BSRC website. The reason I didn't: that site is a static site built using Gatsby, and initially I wasn't sure whether it would be possible to build the booking system since (obviously) it needs access to a back-end (at the very least, the database).

Having done some reading though, it looks as though it is totally possible to do this with some "serverless" work, so watch this space ...