Typical Rest Server

screenshot of Typical Rest Server

Pragmatic Boilerplate for Golang RESTful Server Implementation

Overview

This article discusses the features and installation process of a work-in-progress (WIP) project called Typical-Rest. The project aims to provide a pragmatic Golang RESTful server implementation. It follows the typical-go build tool and incorporates various features such as environment variable configuration, layered architecture, SOLID principles, dependency injection, ORM usage, database transactions, HTTP server with the Echo framework, server-side caching, RESTful API operations, testing using table-driven tests and mocking, and other functionalities like database migration and seed tools. The project also emphasizes a standardized Go project layout.

Features

  • Go-Standards Project Layout
  • Environment Variable Configuration
  • Health-Check and Debug API
  • Graceful Shutdown
  • Layered architecture
  • SOLID Principle
  • Dependency Injection
  • ORM Usage
  • Database Transaction
  • HTTP Server with the Echo framework
  • Server Side Caching
  • Cache but revalidate
  • Set Expiration Time
  • Return 304 if not modified
  • Request ID in logger
  • RESTful API Operations (Create, Update, Partially Update, Find, Offset Pagination, Sorting, Total count, Check resource, Delete resource)
  • Testing using Table Driven Test
  • Mocking
  • Database migration and seed tool
  • Generate code, .env file, and USAGE.md according to the configuration
  • Generate code for the repository layer (pending)
  • Releaser

Summary

This article provides an overview of the Typical-Rest project, including its features and installation process. It outlines the key functionalities such as the project layout, environment variable configuration, RESTful API operations, testing, and mocking. The article also mentions the use of dependency injection, ORM, database transactions, and server-side caching. The installation guide includes steps to set up the project, generate code, build and run the application, and test it. Overall, Typical-Rest aims to provide a pragmatic Golang RESTful server implementation with a focus on standardization and best practices.