Go RESTful Series
Let’s build a real-world production-grade RESTful Web Services project with Go (Golang).
Published in
2 min readSep 2, 2019
As I’m experimenting Go (Golang) for my own future projects, I’m building a real-world production-grade RESTful Web Services project as proof of concept and logging my work to this series.
This project’s source code, documentation, and issues tracking are all published and updated to this Github repository. Please refer there for further details and updates.
Objectives
The project covers:
- An optimized Go implementation follows The Clean Architecture, provides mechanism to declare Entities, Use cases, and External Services (e.g. data access).
- An optimized Go implementation provides mechanism to expose Entities and Use Cases as RESTful Web Services.
- An optimized Go implementation of Token-based Authentication and Authorization.
- An optimized Go implementation provides abstract mechanism to access Relational Databases.
- An optimized Go Development Environment with Git, Docker, Go Modules, Go Debuggers (GDB/Delve) and popular code editors (VSCode/GoLand/Vim).
- An optimized CI/CD Solution with Github Actions and AWS.
- An optimized Distribution Solution with Github Releases and Github Package Registry.
- A scalable and highly-available Production Deployment Solution over AWS using Terraform.
- An optimized Staging Environment replicating Production Environment for testing purposes.
- An optimized Issues Tracking mechanism with Github Project, Issues and Pull Requests.
- Continual improvements.
Business requirements
A “mini” Medium, a small publishing/blogging platform, allows:
- Users to create accounts with their email and basic information.
- Authenticated users to create articles, publish, edit and remove their articles.
- Every user to see all published articles.
- Authenticated users to clap others’ articles with a maximum of 50 claps per user per article.
- Authenticated users to follow other users.
Content
- #2. Setup a Simple Go Development Environment with Docker.
- #3. A Complete Go Development Environment with Docker and VSCode.
- #4. Manage Go dependencies with Dep within Docker and VSCode Remote-Containers.
- #5. Summary of a Go Full-time Local-quality VSCode-powered Containerized Development Environment.
- #6. Comparing Golang’s built-in HTTP server implementation with the most popular community package gorilla/mux.
- #7. Switch to Go Modules from Go Dep.
- #8. Iteration #1 — Requirements and Specification.
- #9. Iteration #1 — A Brief Introduction to Architecture Design Using the Clean Architecture Approach.
- #10. Iteration #1 — Implement Basic User Entities.
- to be continued…