Deploy in minutes on Google App Engine, Kubernetes or Docker

This story introduces hugo-mx-gateway a recently published open source (built in Go, Apache 2.0 License) project meaning to provide a generic yet effective RESTful API to handle contact/demo request forms on Hugo static websites.

Image for post

hugo-mx-gateway — Architecture and operations overview

This story first quickly explains the motivation of hugo-mx-gateway along with its key features and architecture. An in-depth analysis demonstrating how original it is, i.e. with regard to the state of the art, is provided later in this article. Before that, we’ll describe a sample of deployment using Docker and an integration with a static contact form built with Hugo.

Introduction

As a “Sunday” open source developer I often need to create basic websites to promote my projects. Though being a non web developer — I’m actually used to be better building cloud and monitoring things, I would’t like to spend lots of time, efforts, nor money to develop complex web stacks — even a CMS with LAMP is not an option ☺. That’s why I’m a big fan of static websites. Hugo being my favorite generator.

However, one of challenges of static websites is to effectively cope with the support of contact/demo request pages. See for example here a related discussion in the Hugo’s forum. At this point our choice for static website appears to be very fragile, and we might be tempted to abandon that to opt for a dynamic website where contact requests seems to be easy to handle.

Didn’t you ever experience such a situation? If so, this story is for you! Let’s discover how hugo-mx-gateway can make your journey easy to handle contact requests on your next or current static websites.

Key features

Here is a non-exhaustive list of hugo-mx-gateway features.

  • Deploy in minutes on Google App EngineKubernetes, or Docker: No hidden complexity, we just have to set the required configuration parameters and we’re done.
  • Secured against spams and bots: each form submission is validated against a configurable list of allowed origin domains. To prevent bot submissions, it’s also possible to enable form validation with Google reCAPTCHA (v2).
  • SMTP relay with authentication and TLShugo-mx-gateway acts as a SMTP client to relay contact requests. For each request, it automatically generates a templated summary email (based on Go HTML Template) and sends it to the requester — for confirmation, while bbcing a copy of that email to the site owner for tracking and follow up. For an enhanced security, it requires an authenticated SMTP account along with a server supporting TLS.
  • Forward back to the origin page: upon the processing of each request (on success or failure), hugo-mx-gateway handles the reply to the calling static page by redirecting the browser with specific URL parameters describing the completion status. Hence, with a few lines of Javascript within the page, the reply parameters can be retrieved and displayed to the user — like on the below screenshot.

#gohugo #docker #static-website-design #kubernetes #google-app-engine

A generic RESTful API for handling contact forms on Hugo static websites
19.10 GEEK