Simple Voting Service

In this workshop you will build a simple voting service that exposes a RESTful API with a single /votes resource that supports two methods:

  1. HTTP POST to create a vote submission
  2. HTTP GET to retrieve voting results

You will use the following simplified model of a vote:

// Vote represents one voter casting one vote in one poll.
// A single voter can only vote once for any given poll.
type Vote struct {
    Voter  string `json:"voter"`
    Poll   string `json:"topic"`
    Choice string `json:"choice"`
}

First you will write a simple version of the service to learn the basics of the event-driven architecture event cycle. Once you understand the basics, you will improve the service by adding in more realistic functionality, including: