{"id":20657932,"url":"https://github.com/tarathep/voting-stack","last_synced_at":"2026-04-11T02:46:20.446Z","repository":{"id":122466895,"uuid":"443696385","full_name":"tarathep/voting-stack","owner":"tarathep","description":"A simple distributed application running across multiple Docker containers.","archived":false,"fork":false,"pushed_at":"2022-01-04T02:11:19.000Z","size":158,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T11:33:33.525Z","etag":null,"topics":["docker","docker-compose","kubernetes","redis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarathep.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":"2022-01-02T06:18:20.000Z","updated_at":"2022-12-02T05:00:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"5009d90b-a2ce-4000-9e53-aaefbf9097e9","html_url":"https://github.com/tarathep/voting-stack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarathep%2Fvoting-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarathep%2Fvoting-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarathep%2Fvoting-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarathep%2Fvoting-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarathep","download_url":"https://codeload.github.com/tarathep/voting-stack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242768074,"owners_count":20182098,"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":["docker","docker-compose","kubernetes","redis"],"created_at":"2024-11-16T18:24:04.982Z","updated_at":"2026-04-11T02:46:15.412Z","avatar_url":"https://github.com/tarathep.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Example Voting App\n=========\n\nA simple distributed application running across multiple Docker containers.\n\nGetting started\n---------------\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\n\n## Linux Containers\n\nThe Linux stack uses Python, Node.js, Java, with Redis for messaging and Postgres for storage.\n\n\u003e If you're using [Docker Desktop on Windows](https://store.docker.com/editions/community/docker-ce-desktop-windows), you can run the Linux version by [switching to Linux containers](https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers), or run the Windows containers version.\n\nRun in this directory:\n```\ndocker-compose up\n```\nThe app will be running at [http://localhost:5000](http://localhost:5000), and the results will be at [http://localhost:5001](http://localhost:5001).\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```\ndocker swarm init\n```\nOnce you have your swarm, in this directory run:\n```\ndocker stack deploy --compose-file docker-stack.yml vote\n```\n\nThe app will be running at [http://localhost:5000](http://localhost:5000), and the results will be at [http://localhost:5001](http://localhost:5001).\n\n\nRun the app in Kubernetes\n-------------------------\n\nThe folder k8s-specifications contains the yaml specifications of the Voting App's services.\n\nFirst create the vote namespace\n\n```\n$ kubectl create namespace vote\n```\n\nRun the following command to create the deployments and services objects:\n```\n$ kubectl create -f k8s-specifications/\ndeployment \"db\" created\nservice \"db\" created\ndeployment \"redis\" created\nservice \"redis\" created\ndeployment \"result\" created\nservice \"result\" created\ndeployment \"vote\" created\nservice \"vote\" created\ndeployment \"worker\" created\n```\n\nThe vote interface is then available on port 31000 on each host of the cluster, the result one is available on port 31001.\n\nArchitecture\n-----\n\n![Architecture diagram](architecture.svg)\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/) queue which collects new votes\n* A [Java](/worker/src/main) 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) webapp which shows the results of the voting in real time\n\n\nNote\n----\n\nThe voting application only accepts one vote per client (IP Address). It does not register votes if a vote has already been submitted from a client.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarathep%2Fvoting-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarathep%2Fvoting-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarathep%2Fvoting-stack/lists"}