{"id":49879736,"url":"https://github.com/spongycode/song-quest-backend","last_synced_at":"2026-05-15T13:40:03.480Z","repository":{"id":217260897,"uuid":"740996941","full_name":"spongycode/song-quest-backend","owner":"spongycode","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-05T09:38:45.000Z","size":143,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-05T10:29:32.306Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://songquest.vercel.app","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/spongycode.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}},"created_at":"2024-01-09T13:46:24.000Z","updated_at":"2024-12-05T09:38:49.000Z","dependencies_parsed_at":"2024-01-17T15:38:05.590Z","dependency_job_id":"8e98f7f6-3413-4579-9f1b-6051eeca855a","html_url":"https://github.com/spongycode/song-quest-backend","commit_stats":null,"previous_names":["spongycode/song-quest-backend"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/spongycode/song-quest-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spongycode%2Fsong-quest-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spongycode%2Fsong-quest-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spongycode%2Fsong-quest-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spongycode%2Fsong-quest-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spongycode","download_url":"https://codeload.github.com/spongycode/song-quest-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spongycode%2Fsong-quest-backend/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33068889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-05-15T13:40:02.481Z","updated_at":"2026-05-15T13:40:03.472Z","avatar_url":"https://github.com/spongycode.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## [Song Quest](https://github.com/spongycode/song-quest) Backend details\n\n### Routes `api/mobile`\n- \u003cb\u003e`/gameplay`\u003c/b\u003e\n  - `/create`: Create a new game.\n  - `/question`: Upload new questions and fetch questions category-wise.\n  - `/check`: Check the correct answer for the question.\n  - `/highscore`: Fetch the leaderboard category-wise.\n  - `/history`: Fetch the user's game history.\n  - `/save`: Save the game.\n- \u003cb\u003e`/users`\u003c/b\u003e\n  - `/register`: Register new users.\n  - `/login`: Login users.\n  - `/profile`: Get and update profile details.\n  - `/resetPassword`: Reset password and send OTP via email.\n\n\n### Data Models\n\n- \u003cb\u003e Game Model\u003c/b\u003e\n\n```json\n{\n  \"game\": {\n    \"player\": \"String (required)\",\n    \"score\": \"Number (default: 0.0)\",\n    \"accurate\": \"Number (default: 0)\",\n    \"questionsId\": \"Array of ObjectId (ref: 'Question')\",\n    \"category\": \"String (required)\",\n    \"isGameSaved\": \"Boolean (default: false)\",\n    \"createdAt\": \"Date (default: Current timestamp)\",\n    \"expireAt\": \"Date (default: Current timestamp)\"\n  }\n}\n```\n**Note:** This project utilizes a \u003cb\u003e[TTL (Time-to-Live) index](https://www.mongodb.com/docs/manual/core/index-ttl/)\u003c/b\u003e to \u003cb\u003eautomatically delete unsaved games\u003c/b\u003e after `300 seconds`. The index is based on the `expireAt` field and is configured to delete games where `isGameSaved` is false. This ensures efficient cleanup of temporary data.\n- \u003cb\u003eQuestion Model\u003c/b\u003e\n\n```json\n{\n  \"question\": {\n    \"title\": \"String (required)\",\n    \"songUrl\": \"String\",\n    \"options\": [\n      {\n        \"optionid\": \"Number (required)\",\n        \"value\": \"String (required)\"\n      }\n    ],\n    \"correctOptionId\": \"Number (required)\",\n    \"category\": \"String (required)\",\n    \"totalAttempts\": \"Number (default: 0)\",\n    \"difficulty\": \"Number (default: 0.5)\",\n    \"altText\": \"String (default: '')\",\n    \"createdAt\": \"Date (default: Current timestamp)\"\n  }\n}\n```\n- \u003cb\u003eUser Model\u003c/b\u003e\n```json\n{\n  \"user\": {\n    \"username\": \"String (required, unique, trim)\",\n    \"email\": \"String (required, unique, trim)\",\n    \"imageUrl\": \"String\",\n    \"password\": \"String (required, 'Password is required')\",\n    \"gamesPlayed\": \"Number (default: 0)\",\n    \"forgotPasswordToken\": \"String\",\n    \"forgotPasswordTokenExpiry\": \"Date\",\n    \"refreshToken\": \"String\",\n    \"createdAt\": \"Date (default: Current timestamp)\"\n  }\n}\n```\n\n### Scoring\nThe score for each question is determined using the formula below.\n\n\u003cdiv align=\"center\"\u003e  \n  \n```math\nscore = max(0, -0.00057 \\times timeTaken^3 + 0.037 \\times timeTaken^2 - 0.96 \\times timeTaken + 10)\n```\n\n\u003cimg src=\"https://github.com/spongycode/song-quest/assets/65273165/182fd4cb-f3ea-4a4f-a3f8-f14f93097664\" alt=\"drawing\" width=\"400\"/\u003e\n\u003c/div\u003e\n\n\n## Getting Started 🚀\nTo begin using Song Quest, clone the repository from [here](https://github.com/spongycode/song-quest) and open the project in Android Studio. Clone the backend server from [here](https://github.com/spongycode/song-quest-backend) and fill up the required environment variables mentioned in the `sample.env` file to set up your own server.\n\n\n## Contributing 🤝\nFeel free to contribute to this project by submitting issues, pull requests, or providing valuable feedback. Your contributions are always welcome! 🙌\n\n## License 📄\nSong Quest is released under the [MIT License](https://opensource.org/licenses/MIT). Feel free to modify or add to this list based on the specific features of your app.\n\n## Happy coding! 🎉👩‍💻👨‍💻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspongycode%2Fsong-quest-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspongycode%2Fsong-quest-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspongycode%2Fsong-quest-backend/lists"}