Categorygithub.com/brandonto/rest-api-microservice-demo
repositorypackage
0.0.0-20240509030932-3bcaa81c9621
Repository: https://github.com/brandonto/rest-api-microservice-demo.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

REST API Microservice Demo

Let's learn some Golang with a simple REST API microservice.

Implemented using chi for routing, bbolt for data persistance, swagger for sdk and ui generation, testify for testing.

Architecture

Since this is a very simple microservice, there wasn't much architecture needed. There is just one simple resource managed. Below is a simple high level diagram describing the architecture.

                                         ________      _________      __________
  ClientApplication [SDK] ------------- |        |    |         |    |          |
                            < HTTP >    |  HTTP  |    | Message |    | Database |
  ClientApplication [SDK] ------------- | Server | -- | Service | -- |          |
                                        |________|    |_________|    |__________|
                   "/messages"              |
                   "/messages/{messageId}"  |
                                            |
                                            |
  Web Browser ------------------------------
                   "/swagger"

Documentation

The RESTful API is described in an OpenAPI 3.0 document found here: (openapi.json)

Running

usage: ./rest-api-microservice-demo db_path [port] [db_bucket_name]

Testing

go test ./...