Wow, look at this! I’m finally here!
I’ve been wanting to build a website for myself for a super long time, and thanks to Github Pages, Astro, daisyUI, tailwindcss, and Astrofy Template, it’s finally up and running.
If you know me, you know I have a well-rounded developer skillset, but that also means I eventually get out of date in some areas if I focus more on others. This was a nice opportunity for me to refresh myself a little on web technologies during some downtime. I had to add a lot of features and customizations on top of the basic Astrofy Template, so I really learned a lot about how all of the above mentioned tools work.
UPDATE - 19.11.2024
For the contact form, I wanted to hide my email address (of course), so I looked at some options for accepting contact forms and sending corresponding (hah) emails. In the end, I decided to roll my own AWS Lambda for this purpose. In order to prevent abuse, I wanted to use recaptcha, but then I thought “Google - meh…” and implemented Friendly Captcha instead. To send the emails, I initially used GMail, because it’s free and fairly easy to do. However, I couldn’t use a custom domain and sender-email address, so I switched to Mailgun.
So, the client-side basically just renders the captcha widget, which collects a special token from the Friendly Captcha servers, and then calls the AWS Lambda function with the special token and contact form data. The Lambda function does the following:
- validate the request data to prevent abuse
- call to Friendly Captcha’s API to see if the provided special token is valid
- call to Mailgun’s API to send me the contact form data via email
- call to Mailgun’s API to send a confirmation email to the email address provided in the contact form
On success, the client side replaces the contact form content with confirmation content. Overall, it took about 2 full days to educate myself on these tools and get it implemented and stable, but I saved at least 20CHF by doing it myself!