{"id":13399393,"url":"https://github.com/dockersamples/example-voting-app","last_synced_at":"2025-04-23T20:58:57.850Z","repository":{"id":37550491,"uuid":"46233451","full_name":"dockersamples/example-voting-app","owner":"dockersamples","description":"Example distributed app composed of multiple containers for Docker, Compose, Swarm, and Kubernetes","archived":false,"fork":false,"pushed_at":"2024-10-10T15:05:06.000Z","size":1234,"stargazers_count":5126,"open_issues_count":46,"forks_count":12574,"subscribers_count":126,"default_branch":"main","last_synced_at":"2025-04-23T20:58:42.181Z","etag":null,"topics":["demo","docker","docker-compose","example","kubernetes","sample","swarm"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dockersamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-11-15T19:59:56.000Z","updated_at":"2025-04-23T10:58:45.000Z","dependencies_parsed_at":"2023-10-20T19:24:08.722Z","dependency_job_id":"19d3cdc5-e11b-40dd-8cc4-4c7d0f0ba13c","html_url":"https://github.com/dockersamples/example-voting-app","commit_stats":{"total_commits":153,"total_committers":40,"mean_commits":3.825,"dds":0.7973856209150327,"last_synced_commit":"63e9150ca17af4ed05880d4245e486481f73fcb4"},"previous_names":["docker/example-voting-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fexample-voting-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fexample-voting-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fexample-voting-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dockersamples%2Fexample-voting-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dockersamples","download_url":"https://codeload.github.com/dockersamples/example-voting-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514767,"owners_count":21443208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","docker","docker-compose","example","kubernetes","sample","swarm"],"created_at":"2024-07-30T19:00:37.237Z","updated_at":"2025-04-23T20:58:57.831Z","avatar_url":"https://github.com/dockersamples.png","language":"C#","funding_links":[],"categories":["C# #","C#","HarmonyOS","Docker","swarm","Complex Apps (4+ independent services/apps in solution)"],"sub_categories":["Windows Manager","Phaser"],"readme":"# Example Voting App\n\nA simple distributed application running across multiple Docker containers.\n\n## Getting started\n\nDownload [Docker Desktop](https://www.docker.com/products/docker-desktop) for Mac or Windows. [Docker Compose](https://docs.docker.com/compose) will be automatically installed. On Linux, make sure you have the latest version of [Compose](https://docs.docker.com/compose/install/).\n\nThis solution uses Python, Node.js, .NET, with Redis for messaging and Postgres for storage.\n\nRun in this directory to build and run the app:\n\n```shell\ndocker compose up\n```\n\nThe `vote` app will be running at [http://localhost:8080](http://localhost:8080), and the `results` will be at [http://localhost:8081](http://localhost:8081).\n\nAlternately, if you want to run it on a [Docker Swarm](https://docs.docker.com/engine/swarm/), first make sure you have a swarm. If you don't, run:\n\n```shell\ndocker swarm init\n```\n\nOnce you have your swarm, in this directory run:\n\n```shell\ndocker stack deploy --compose-file docker-stack.yml vote\n```\n\n## Run the app in Kubernetes\n\nThe folder k8s-specifications contains the YAML specifications of the Voting App's services.\n\nRun the following command to create the deployments and services. Note it will create these resources in your current namespace (`default` if you haven't changed it.)\n\n```shell\nkubectl create -f k8s-specifications/\n```\n\nThe `vote` web app is then available on port 31000 on each host of the cluster, the `result` web app is available on port 31001.\n\nTo remove them, run:\n\n```shell\nkubectl delete -f k8s-specifications/\n```\n\n## Architecture\n\n![Architecture diagram](architecture.excalidraw.png)\n\n* A front-end web app in [Python](/vote) which lets you vote between two options\n* A [Redis](https://hub.docker.com/_/redis/) which collects new votes\n* A [.NET](/worker/) worker which consumes votes and stores them in…\n* A [Postgres](https://hub.docker.com/_/postgres/) database backed by a Docker volume\n* A [Node.js](/result) web app which shows the results of the voting in real time\n\n## Notes\n\nThe voting application only accepts one vote per client browser. It does not register additional votes if a vote has already been submitted from a client.\n\nThis isn't an example of a properly architected perfectly designed distributed app... it's just a simple\nexample of the various types of pieces and languages you might see (queues, persistent data, etc), and how to\ndeal with them in Docker at a basic level.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fexample-voting-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdockersamples%2Fexample-voting-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdockersamples%2Fexample-voting-app/lists"}