{"id":18086900,"url":"https://github.com/denismakogon/voteapp","last_synced_at":"2026-04-16T17:44:19.713Z","repository":{"id":152748763,"uuid":"76542307","full_name":"denismakogon/voteapp","owner":"denismakogon","description":"Voting app serverless demo","archived":false,"fork":false,"pushed_at":"2017-08-24T22:35:57.000Z","size":163,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T01:28:03.452Z","etag":null,"topics":["distributed","functions","functions-as-a-service","golang","python3","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","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/denismakogon.png","metadata":{"files":{"readme":"README.rst","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":"2016-12-15T08:58:38.000Z","updated_at":"2017-08-22T12:35:28.000Z","dependencies_parsed_at":"2023-07-19T23:00:47.787Z","dependency_job_id":null,"html_url":"https://github.com/denismakogon/voteapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/denismakogon/voteapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Fvoteapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Fvoteapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Fvoteapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Fvoteapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/denismakogon","download_url":"https://codeload.github.com/denismakogon/voteapp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/denismakogon%2Fvoteapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265883674,"owners_count":23843792,"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":["distributed","functions","functions-as-a-service","golang","python3","serverless"],"created_at":"2024-10-31T16:59:22.034Z","updated_at":"2026-04-16T17:44:14.653Z","avatar_url":"https://github.com/denismakogon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Cats versus Dogs vote app\n=========================\n\nArchitecture\n------------\n\nCurrent architecture includes 4 major components. Two of the are daemons::\n\n    PostgreSQL 9.5\n    VotingApp\n\nTwo of them are functions containers::\n\n    denismakogon/vote-task\n    denismakogon/result-task\n\n\nExecution flow\n--------------\n\nWhen user votes (sends HTTP Post) VoteApp HTTP route handler triggers asynchronous voting function,\nthis function saves user's vote to persistent storage - PostgreSQL.\n\nOnce user wants to retrieve get voting results (sends HTTP Get) VoteApp HTTP route handler\ntriggers synchronous resulting function to retrieve voting statistics.\n\nBuilding function images\n------------------------\n\nYou can build your own images from given functions, but you are feel free to use pre-built and uploaded to DockerHub images::\n\n    denismakogon/vote-task\n    denismakogon/result-task\n\n\nRunning PostgreSQL container\n----------------------------\n\nPersonally recommend to use `this PG image`_ because it has 1M+ pulls.\nUse following commands to start PG container::\n\n    docker pull sameersbn/postgresql:latest\n    docker run --name postgresql -d -p 0.0.0.0:5432:5432 --env-file voteapp/voteapp.env sameersbn/postgresql:latest\n\nVoteApp configuration\n---------------------\n\nVoteApp depends on big set of parameters like::\n\n    API host\n    API port\n    PostgreSQL host\n    PostgreSQL user/password\n    PostgreSQL database\n\nNot all of them are mandatory, almost all parameter can be applied as operating system environment variables::\n\n    VOTEAPP_HOST stands for --host\n    VOTEAPP_POST stands for --port\n    PG_HOST stands for --pg-host\n    DB_USER stands for --pg-username\n    DB_PASS stands for --pg-password\n    DB_NAME stands for --pg-db\n    APP_NAME stands for --app-name\n\nNot all of them are defined with default values, that is why there are only several of them are required, for our particular case::\n\n    VOTEAPP_HOST\n    VOTEAPP_PORT\n\nare not required because they were defined with default values.\n\nVoteApp is identified by single Python module **app.py** that is CLI tool to start a web service::\n\n    Usage: app.py [OPTIONS]\n\n    Options:\n      --host TEXT             API service host.\n      --port INTEGER          API service port.\n      --pg-host TEXT          PostgreSQL connection host.\n      --pg-username TEXT      VoteApp PostgreSQL user.\n      --pg-password TEXT      VoteApp PostgreSQL user password.\n      --pg-db TEXT            VoteApp PostgreSQL connection.\n      --app-name TEXT         Existing Picasso app name\n      --help                  Show this message and exit.\n\nBuilding VoteApp container\n--------------------------\n\nIn order to simplify VoteApp usage, i recommend to build a container from it, corresponding Dockerfile included.\nAlso there's a file - voteapp.env, you should be aware that it's a sample file, because it is required to adjust a lot parameters there like::\n\n    VoteApp daemon configuration\n    PosgreSQL configuration\n\nOnce env file is ready use following command to build a container::\n\n    docker build -t voteapp .\n\nTo start a container::\n\n    docker run --name voteapp -d -p 0.0.0.0:11111:9999 --env-file voteapp.env voteapp\n\nOr you can use pre-built container::\n\n    denismakogon/voteapp\n\nTo pull container::\n\n    docker pull denismakogon/voteapp\n\nTo start container::\n\n    docker run --name voteapp -d -p 0.0.0.0:11111:9999 --env-file voteapp.env denismakogon/voteapp\n\n.. _this PG image: https://hub.docker.com/_/postgres/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismakogon%2Fvoteapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdenismakogon%2Fvoteapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdenismakogon%2Fvoteapp/lists"}