Coder Social home page Coder Social logo

rest-api-microservice-demo's Introduction

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 ./...

rest-api-microservice-demo's People

Contributors

brandonto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.