{"id":22433056,"url":"https://github.com/roerohan/passwordgame","last_synced_at":"2026-02-18T01:05:49.981Z","repository":{"id":41652070,"uuid":"260684360","full_name":"roerohan/PasswordGame","owner":"roerohan","description":"Backend for Password game.","archived":false,"fork":false,"pushed_at":"2022-12-12T16:03:42.000Z","size":371,"stargazers_count":3,"open_issues_count":13,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T13:01:45.921Z","etag":null,"topics":["backend","express","password-game","socket-io","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/roerohan.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}},"created_at":"2020-05-02T12:40:02.000Z","updated_at":"2021-10-27T22:35:30.000Z","dependencies_parsed_at":"2023-01-27T21:45:16.789Z","dependency_job_id":null,"html_url":"https://github.com/roerohan/PasswordGame","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roerohan/PasswordGame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roerohan%2FPasswordGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roerohan%2FPasswordGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roerohan%2FPasswordGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roerohan%2FPasswordGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roerohan","download_url":"https://codeload.github.com/roerohan/PasswordGame/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roerohan%2FPasswordGame/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29565018,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"ssl_error","status_checked_at":"2026-02-18T00:45:26.718Z","response_time":100,"last_error":"SSL_read: 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":["backend","express","password-game","socket-io","typescript"],"created_at":"2024-12-05T22:13:46.396Z","updated_at":"2026-02-18T01:05:49.965Z","avatar_url":"https://github.com/roerohan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PasswordGame\n\nBackend for Password game.\n\nFrontend Repo: https://github.com/roerohan/Password\n\n# API\n\n\u003e Note: `?param` implies `param` is optional.\n\u003cbr/\u003e\n\n\u003e Note: Format: \\\u003cREQUEST-TYPE\\\u003e \\\u003cROUTE\\\u003e - \\\u003cPARAMS\\\u003e\n\n- All routes return a JSON with the following format:\n\n```typescript\n{\n    success: boolean,\n    message: string | object,\n}\n```\n\n- `success` indicates if a request passed or failed.\n- `message` indicates why a request failed, or stores the response if the operation was successful.\n\n## /room\n\n- `POST /room/create - username, ?access, ?rounds`\n    * Create a room with creator as `username`.\n    * `access` determines the type of room, may be `private` or `public`.\n    * `rounds` implies the number of rounds in the game.\n    * Returns the `roomId` and `creator` in the response JSON.\n```typescript\n{\n    success: boolean,\n    message: {\n        roomId: string,\n        creator: string,\n        players: [\n            {\n                username: string,\n                points: number,\n            },\n        ],\n    },\n}\n```\n\n- `GET /room/join/:roomId - username`\n    * Add user `username` to the room.\n    * Returns a JSON of the following format:\n```typescript\n{\n    success: boolean,\n    message: {\n        roomId: string,\n        creator: string,\n        hasStarted: boolean,\n        player: {\n            username: string,\n            points: 0,\n        }\n        players: [\n            {\n                username: string,\n                points: number,\n            },\n            {\n                username: string,\n                points: number,\n            },\n        ],\n    },\n}\n```\n\n## /game\n\n- `POST /game/start - username, roomId, ?access, ?rounds`\n    * `username` must be the creator of the room.\n    * Modifies access and rounds according to `access` and `rounds`.\n    * Starts the game for room `roomId`.\n    * Returns a JSON of the following format:\n```typescript\n{\n    success: boolean,\n    message: {\n        hasStarted: boolean,\n        rounds: number,\n        currentRound: number,\n        players: [\n            {\n                username: string,\n                points: number,\n            },\n            {\n                username: string,\n                points: number,\n            },\n        ],\n    },\n}\n```\n\n- `POST /game/next - roomId, username`\n    * Generates a new password in the backend for the room, returns the new passwordHolder and the length of the new password.\n    * `currentPassword` is sent only when the `username` is the same as the `passwordHolder`.\n    * Returns a JSON of the following format:\n```typescript\n{\n    success: boolean,\n    message: {\n        currentRound: number,\n        rounds: number,\n        passwordHolder: string,\n        passwordLength: number,\n        previousPassword: string,\n        currentPassword: string,\n        roundEnd: number,\n        players: [\n            {\n                username: string,\n                points: number,\n            },\n            {\n                username: string,\n                points: number,\n            },\n        ],\n    },\n}\n```\n\n- `POST /game/hint - roomId, username, hint`\n    * Adds the hint to the `hints` array for the current round.\n    * Returns a JSON of the format:\n```typescript\n{\n    success: boolean,\n    message: {\n        hints: array,\n        passwordHolder: string,\n    },\n}\n``\n\n- `POST /game/end - roomId`\n    * Ends the game for `roomId`.\n    * Deletes data pertaining to `roomId`.\n    * Returns a JSON of the form:\n\n```typescript\n{\n    success: true,\n    message: {\n        players: [\n            {\n                username: string,\n                points: number,\n            },\n            {\n                username: string,\n                points: number,\n            },\n        ],\n    },\n}\n```\n\n# Socket Events\n\n- join\n- message\n- start\n- hint\n- disconnect\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froerohan%2Fpasswordgame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froerohan%2Fpasswordgame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froerohan%2Fpasswordgame/lists"}