An Update Regarding GoWeb
April 13, 2023
Maximilian Patterson
Goals of the project
Get the repo here
GoWeb aims to be a simple easy-to-use framework for building web applications and APIs. Its inspiration comes from
frameworks like Laravel and Django, which I am familiar with and serves as a good introduction to using Go for web
development for people new to the language and familiar with MVC frameworks, or for people familiar with Go and new to
MVC. My motivation is to have five things:
- A simple, easy-to-use framework for building web applications and APIs
- Something I built for myself, which all subsequent projects can use, resulting in codebases written entirely by me
- Little to no dependencies to take advantage of the Go compatibility promise and security updates
- Get up and running, without writing boilerplate, so I can just start creating applications right away
- Finally, to share it with people, and to help others to learn Go and web development
There are some features I had originally considered adding like e-mail support, that, because of their complexity and bloat (in this example an entire email server or some kind of email dependency) I have decided can be added by the developers themselves on a per-project basis, either by dependency or a new implementation tailored to the needs of the application.
What has been accomplished
Since the project’s creation and my first article on this subject, I have made a lot of progress. Here’s what’s new:
- Simple database migration system
- CSRF protection
- Multiple expiring user sessions per account
- Arbitrary Scheduled tasks (passed into the scheduler as an anonymous function)
These new, essential, features have been added while maintaining my original goals of no external dependencies (outside of the Postgres driver and x/crypto), maintaining simplicity, and ease of use.
The total up-to-date feature list is outlined at the beginning of the readme here: GoWeb Repository
What’s left
Before I will consider this project ready for production in my own applications (Version 2.0) I would like to add the following features:
- Parse CLI arguments that can hook into scheduled functions or create some alias system to map CLI arguments to " commands"
- Middleware for routes, this will mainly just be an example to piggyback off of when building your own middleware
- Maybe a utility for handling file uploads
Future projects using GoWeb
Here are some ideas I have for projects, that I would build using GoWeb:
- Open source all-in-one chat server and client
- It would have a simple API and the front-end would be mostly javascript that makes calls to the back-end server
- Installation would be extremely simple, a current hurdle for other alternatives like Matrix
- It would mimic all the essential features of Discord that moderators depend on (another hurdle for Matrix)
- The front-end client could be toggled on/off if server administrators would want their users only using alternative clients
- Maybe this is outside the scope of the article, but it would be interesting to build a Desktop/Mobile client in Flutter or React Native
- Auto-deploy for Hugo
- This would listen to a Hugo Git repo, any updates on master would result in three things:
- Clone the repo
- Build with Hugo, into a specified directory (like /var/www/mywebsite)
- Clean up build files and repo
- This would listen to a Hugo Git repo, any updates on master would result in three things: