explaingit

dockersamples/example-voting-app

5,691C#Audience · vibe coderComplexity · 2/5Setup · easy

TLDR

A sample multi-container voting app from Docker that shows how five services (Python, Node.js.NET, Redis, Postgres) work together, great for learning how modern distributed apps are structured.

Mindmap

mindmap
  root((repo))
    Frontend
      Python vote page
      Node results page
    Data Layer
      Redis queue
      Postgres database
    Worker
      NET background worker
    Orchestration
      Docker Compose
      Docker Swarm
      Kubernetes
    Learning Goals
      Distributed systems
      Container basics
      Service communication
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Learn how separate app pieces talk to each other without being bundled together

USE CASE 2

Practice running multiple services at once using Docker Compose with a single command

USE CASE 3

Experiment with scaling an app across many machines using Docker Swarm or Kubernetes

USE CASE 4

Use as a hands-on template to understand queues, workers, and databases working together

Tech stack

PythonNode.js.NETRedisPostgreSQLDockerDocker ComposeKubernetes

Getting it running

Difficulty · easy Time to first run · 5min

Run the whole app with one command using Docker Compose. Docker must be installed first. Swarm and Kubernetes options are available for multi-machine setups.

No specific license is mentioned in the explanation, check the repository directly before using it in your own project.

In plain English

This repository is a sample voting application built to demonstrate how multiple software components can work together as separate containers on one machine or spread across many machines. It is maintained by the Docker team as a teaching tool, not as a production-quality system, so expect simplicity over polish. The app itself is straightforward: a web page lets users pick between two options, their votes are collected in a fast in-memory store called Redis, a background worker reads those votes and saves them into a database (Postgres), and a second web page shows the live results. Five pieces of software, five different technologies (Python, Node.js.NET, Redis, Postgres), all running side by side. You can start the whole thing with a single command using Docker Compose, which reads a configuration file and spins up every piece automatically. If you want to run it across multiple machines instead of one, Docker Swarm and Kubernetes are also supported, each with their own short setup steps described in the README. The main purpose of the project is educational. It shows beginners how a real-world distributed system is structured: a front-end service, a message queue, a worker process, a database, and a reporting layer. Each piece communicates with the others without being bundled together, which is a common pattern in modern software. One thing the README notes explicitly: the app limits each browser to one vote and is not meant to be a blueprint for a properly architected system. It is a learning example, kept intentionally simple so the moving parts stay visible.

Copy-paste prompts

Prompt 1
I'm looking at the dockersamples/example-voting-app. Can you walk me through what happens step by step when a user clicks a vote button, from the web page all the way to the results screen?
Prompt 2
Using the example-voting-app as a reference, explain what Redis is doing here and why a fast in-memory store is used instead of saving votes straight to Postgres.
Prompt 3
I want to swap the Python voting frontend in example-voting-app with a simple HTML page I built. What files would I need to change and what should I watch out for?
Prompt 4
Can you explain the Docker Compose file in example-voting-app in plain English? I want to understand what each section does without needing to know Docker deeply.
Prompt 5
What would I need to change in example-voting-app to allow users to vote more than once from the same browser?
Open on GitHub → Explain another repo

← dockersamples on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.