{"id":17436058,"url":"https://github.com/poboisvert/poll-redis-votes","last_synced_at":"2026-02-08T08:32:35.369Z","repository":{"id":257883934,"uuid":"872641329","full_name":"poboisvert/poll-redis-votes","owner":"poboisvert","description":"Redis, WebSocket Votes Polls Streaming","archived":false,"fork":false,"pushed_at":"2024-11-21T23:55:48.000Z","size":70,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T19:46:03.751Z","etag":null,"topics":["golang","polls","redis","votes","websocket"],"latest_commit_sha":null,"homepage":"https://github.com/poboisvert/poll-redis-votes/raw/main/preview.png","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poboisvert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2024-10-14T19:53:01.000Z","updated_at":"2024-11-21T23:55:51.000Z","dependencies_parsed_at":"2024-10-16T22:04:13.895Z","dependency_job_id":"c90ce664-fd70-426c-a382-7b671a8f48d6","html_url":"https://github.com/poboisvert/poll-redis-votes","commit_stats":null,"previous_names":["poboisvert/poll-redis-pubsub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/poboisvert/poll-redis-votes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboisvert%2Fpoll-redis-votes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboisvert%2Fpoll-redis-votes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboisvert%2Fpoll-redis-votes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboisvert%2Fpoll-redis-votes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poboisvert","download_url":"https://codeload.github.com/poboisvert/poll-redis-votes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poboisvert%2Fpoll-redis-votes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29225477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T06:05:31.539Z","status":"ssl_error","status_checked_at":"2026-02-08T05:58:33.853Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","polls","redis","votes","websocket"],"created_at":"2024-10-17T10:01:52.795Z","updated_at":"2026-02-08T08:32:35.354Z","avatar_url":"https://github.com/poboisvert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## poll-redis-pubsub\n\nThis comprehensive tutorial guides you through building a real-time voting/polling system, complete with an interactive front-end, back-end logic, persistent data storage, and containerization. We will leverage the power of:\n\n- **Go (Golang)**: For robust back-end development with efficient concurrency and simplicity.\n- **WebSockets**: For real-time communication between the client and server, allowing live updates.\n- **Redis**: As an in-memory data store to handle fast updates and track real-time vote counts.\n- **PostgreSQL**: For reliable, persistent storage of polls and vote data.\n- **Docker**: For easy development, deployment, and scalability across environments.\n\n### Project Setup:\n\n- **Environment**: Ensure you have Go (GoLang) installed, along with the necessary dependencies like go-redis, pq, and gorilla/websocket packages.\n- **Project Structure**: Create a directory for your project (e.g., voting-app) and organize it as follows:\n\n  ![preview](preview.png)\n\n### Vote\n\n```\n{\n    \"poll_id\": 1,\n    \"option_index\": 0\n}\n```\n\n### Create Pool\n\n```\n{\n\"question\": \"What is your favorite programming language?\",\n\"options\": [\"Go\", \"Python\", \"JavaScript\", \"Java\"],\n\"total_votes\": 0,\n\"created_at\": \"2023-10-01T12:00:00Z\",\n\"updated_at\": \"2023-10-01T12:00:00Z\"\n}\n```\n\n### Preflight:\n\n- Run: docker compose up --build --wait\n\n- .env File\n\n```\nPOSTGRES_HOST=localhost\nPOSTGRES_PORT=5432\nPOSTGRES_USER=user\nPOSTGRES_PASSWORD=password\nPOSTGRES_DB=voting_app\n```\n\n### Run API\n\n- cd server \u0026\u0026 go run main.go\n\n### Run SQL UI Queries\n\n- Visit: http://localhost:3000/queries/new\n\n### Additional Considerations:\n\n- **Scalability**: Consider using a message queue (like Kafka or RabbitMQ) to handle high vote volumes, along with load balancing techniques.\n\n- **Security**: Implement appropriate authentication and authorization mechanisms to secure your system.\n\n- **Error Handling**: Properly handle errors to ensure graceful recovery.\n\n- **Testing**: Thoroughly test all components to ensure they function as expected.\n\n- **Monitoring and Logging**: Integrate monitoring tools to track application performance and logs.\n\n## Structure\n\n```\nvoting-app/\n├── client/\n│ ├── index.html\n│ ├── main.js\n│ ├── style.css\n├── server/\n│ ├── main.go\n│ ├── models/\n│ │ ├── poll.go\n│ │ └── vote.go\n│ ├── controllers/\n│ │ ├── poll.go\n│ │ └── vote.go\n│ ├── services/\n│ │ ├── poll.go\n│ │ └── redis.go\n│ ├── config/\n│ │ └── config.go\n│ ├── db/\n│ │ └── db.go\n│ ├── router/\n│ │ └── router.go\n│ └── utils/\n│ └── websocket.go\n├── Dockerfile\n├── docker-compose.yml\n├── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoboisvert%2Fpoll-redis-votes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoboisvert%2Fpoll-redis-votes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoboisvert%2Fpoll-redis-votes/lists"}