Subdomain Request Website

Background

After founding the Maker Club at my high school, I wanted to establish a strong web presence. The default Google Sites subdomain (sites.google.com/site/sitename) simply wasn’t doing it for me. But I also didn’t think it was worth it to by a domain just for the Maker Club. So I bought the “mphs.club” domain, which are the initials to my high school. My hope was that any club that wanted a cool looking custom domain, such as maker.mphs.club, could get it, and everything would be under the “mphs.club” umbrella. For only $9 a year (or something like that, ICANN keeps raising prices) every club at my school could have a nice looking domain, and Google Sites would work with it for free. The problem was that I couldn’t manually enter a DNS record for every club who wanted it at the school. It’s not that I don’t want to, but rather this would make it too hard. It should be easily doable by anyone who wants it, and “knowing Brooks” shouldn’t be a prerequesite. So I set out to make a website that could automatically add those records for me.

How I did it

Answer: ChatGPT. Maybe not my proudest moment, but I had this idea floating around for a while and knew it could be done quickly, I just didn’t know javascript (yet). Cloudflare, the DNS provider (and host for this website) has a good API, I knew from experience using it with my Docker Server and Traefik. Well, I didn’t really code anything with it, but I knew of its existence. I knew I’d need a backend, since I couldn’t just put the API token in the source code of the html. So I asked ChatGPT to help me code a simple frontend and “backend” (it’s a very small cloudflare worker). The user would enter their desired subdomain (so “maker” if they wanted the domain “maker.mphs.club”), the TXT verification record given to them by Google (so Google can verify they “own the property”), and a password, so this could only be used by authorized users. And after a lot of debugging and several follow up prompts, we (ChatGPT and I) finally put together something that worked!

Conclusion

The website worked, so I put together some documentation. It’s located at the GitHub repo for the website, here. And while it hasn’t had too many users, I hope more will use it soon. Another club was able to use it without my intervention, so my documentation can’t be too confusing😂.

GitHub

Feel free to check out my github for other projects, although I don’t do that many (sadly). https://github.com/randomodbuild

Thanks!