{"id":22360569,"url":"https://github.com/eric-souzams/node-polls-realtime","last_synced_at":"2026-04-10T15:02:00.140Z","repository":{"id":234744993,"uuid":"789446511","full_name":"eric-souzams/node-polls-realtime","owner":"eric-souzams","description":"A real-time voting system where users can create a poll and other users can cast their votes in real-time.","archived":false,"fork":false,"pushed_at":"2024-04-20T15:17:51.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T15:46:58.135Z","etag":null,"topics":["docker","fastify","nodejs","postgres","prisma-orm","redis","websocket","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/eric-souzams.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}},"created_at":"2024-04-20T15:17:16.000Z","updated_at":"2024-04-20T15:25:36.000Z","dependencies_parsed_at":"2024-04-20T17:11:57.085Z","dependency_job_id":null,"html_url":"https://github.com/eric-souzams/node-polls-realtime","commit_stats":null,"previous_names":["eric-souzams/node-polls-realtime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eric-souzams%2Fnode-polls-realtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eric-souzams%2Fnode-polls-realtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eric-souzams%2Fnode-polls-realtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eric-souzams%2Fnode-polls-realtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eric-souzams","download_url":"https://codeload.github.com/eric-souzams/node-polls-realtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245670170,"owners_count":20653309,"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","fastify","nodejs","postgres","prisma-orm","redis","websocket","zod"],"created_at":"2024-12-04T16:17:28.875Z","updated_at":"2025-12-30T20:12:21.521Z","avatar_url":"https://github.com/eric-souzams.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polls Realtime\n\nA real-time voting system where users can create a poll and other users can cast their votes in real-time.\n\n## Requisites\n\n- Docker;\n- Node.js v20;\n\n\n## HTTP\n\n### POST `/polls`\n\nCreate a new poll.\n\n#### Request body\n\n```json\n{\n  \"title\": \"Which programming language do you prefer?\",\n  \"options\": [\n    \"JavaScript\",\n    \"Java\",\n    \"PHP\",\n    \"C#\"\n  ]\n}\n```\n\n#### Response body\n\n```json\n{\n  \"pollId\": \"194cef63-2ccf-46a3-aad1-aa94b2bc89b0\"\n}\n```\n\n### GET `/polls/:pollId`\n\nReturn data from a single poll.\n\n#### Response body\n\n```json\n{\n\t\"poll\": {\n\t\t\"id\": \"e4365599-0205-4429-9808-ea1f94062a5f\",\n\t\t\"title\": \"Which programming language do you prefer?\",\n\t\t\"options\": [\n\t\t\t{\n\t\t\t\t\"id\": \"4af3fca1-91dc-4c2d-b6aa-897ad5042c84\",\n\t\t\t\t\"title\": \"JavaScript\",\n\t\t\t\t\"score\": 1\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": \"780b8e25-a40e-4301-ab32-77ebf8c79da8\",\n\t\t\t\t\"title\": \"Java\",\n\t\t\t\t\"score\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": \"539fa272-152b-478f-9f53-8472cddb7491\",\n\t\t\t\t\"title\": \"PHP\",\n\t\t\t\t\"score\": 0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"id\": \"ca1d4af3-347a-4d77-b08b-528b181fe80e\",\n\t\t\t\t\"title\": \"C#\",\n\t\t\t\t\"score\": 0\n\t\t\t}\n\t\t]\n\t}\n}\n```\n\n### POST `/polls/:pollId/votes`\n\nAdd a vote to specific poll.\n\n#### Request body\n\n```json\n{\n  \"pollOptionId\": \"31cca9dc-15da-44d4-ad7f-12b86610fe98\"\n}\n```\n\n## WebSockets\n\n### ws `/polls/:pollId/results`\n\n#### Message\n\n```json\n{\n  \"pollOptionId\": \"da9601cc-0b58-4395-8865-113cbdc42089\",\n  \"votes\": 2\n}\n```\n\n\n## Setup\n\n- Clone the repository;\n- Install dependencies (`npm install`);\n- Setup PostgreSQL and Redis (`docker compose up -d`);\n- Copy `.env.example` file (`cp .env.example .env`);\n- Run application (`npm run dev`);","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-souzams%2Fnode-polls-realtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feric-souzams%2Fnode-polls-realtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feric-souzams%2Fnode-polls-realtime/lists"}