20210531 backend
The month of May 2021 was spent authoring the frontend and backend of the ragdolldynamics.com website. Let's have a look at what makes it tick.
Overview
Here's life of the website in a nutshell.
- 1,500 lines of Markdown/HTML
- 2,000 lines of CSS
- 500 lines of JS
- 600 lines of Python
- Server via Hetzner
- Flask to communicate with Stripe
- WyDay to generate serials
- Mongo to store/match customers and serials
- Mongo to store logs
- mkdocs to generate most of the site
- Flask to generate a reproducible, persistent customer receipt
- Email via sendgrid
That is, we want a user to put the versions and amount of seats for Ragdoll into a "cart" and for that "cart" to be passed on to Stripe for the transaction to take place. Once Stripe is done, we'll want to generate a serial to go with it.
With a serial in hand, we'd then like to generate a web page specifically for this one purchase. Ideally something the user can revisit later if they forget their key(s).
Because many things can go wrong in these few steps, we need to record each step of the way, including log messages, such that we can debug any such issue.
And that's it. Let's have a look at practicalities.
Static Website
Because most of the site - namely the landing page and contact page - is static I opted to use the same static site generator I use for https://learn.ragdolldynamics.com. Namely mkdocs.
Unlike the learn domain, this one wouldn't require a theme as we're laying everything out ourselves.
One of the pages need purchase-specific information - namely your serial numbers - so that needs a "dynamic site generator", and for that I'll use flask because of my brief excursion many years ago for Pyblish Events.