{"id":19691585,"url":"https://github.com/99x/walk2win","last_synced_at":"2025-07-15T11:41:57.550Z","repository":{"id":38727740,"uuid":"196726941","full_name":"99x/walk2win","owner":"99x","description":"Online Walking challenge for workplaces","archived":false,"fork":false,"pushed_at":"2023-09-10T07:32:11.000Z","size":4102,"stargazers_count":12,"open_issues_count":28,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-29T09:43:01.466Z","etag":null,"topics":["fitness","game","google-fit","hacktoberfest","steps","walk2win","walking-game"],"latest_commit_sha":null,"homepage":"","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/99x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-13T13:50:05.000Z","updated_at":"2024-09-30T11:00:18.000Z","dependencies_parsed_at":"2022-09-17T02:10:28.905Z","dependency_job_id":"0efbfe40-7d83-4ea0-a0b8-80ffb322afc0","html_url":"https://github.com/99x/walk2win","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/99x/walk2win","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fwalk2win","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fwalk2win/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fwalk2win/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fwalk2win/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/99x","download_url":"https://codeload.github.com/99x/walk2win/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/99x%2Fwalk2win/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265432907,"owners_count":23764183,"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":["fitness","game","google-fit","hacktoberfest","steps","walk2win","walking-game"],"created_at":"2024-11-11T19:09:57.088Z","updated_at":"2025-07-15T11:41:57.514Z","avatar_url":"https://github.com/99x.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n   \u003cimg src=\"w2w-logo.png\"\u003e\n\u003c/div\u003e\n\u003cbr/\u003e\n\n[![GitHub license](https://img.shields.io/github/license/99xt/walk2win)](https://github.com/99xt/walk2win/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/99xt/walk2win)](https://github.com/99xt/walk2win/issues)\n[![GitHub stars](https://img.shields.io/github/stars/99xt/walk2win)](https://github.com/99xt/walk2win/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/99xt/walk2win)](https://github.com/99xt/walk2win/network)\n[![GitHub last commit](https://img.shields.io/github/last-commit/99xt/walk2win)](https://img.shields.io/github/last-commit/99xt/walk2win)\n[![Twitter](https://img.shields.io/twitter/url/https/github.com/99xt/walk2win?style=social)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2F99xt%2Fwalk2win)\n\n### What is walk2win\n\nWalk to win(also known as walk2win) is an online walking challenge for workplaces. Employees are able to register with this challenge as individual participants or they are able to register as teams. Daily steps count can be recorded by signing into the Google account(via Google Fit platform) or by manual entry. Game leaderboard will show a list of players and teams ranked by the total score and steps.\n\n#### Some highlighted features\n\n- Easy setup with Docker\n- Fully customizable scoring system with advanced features like bonus scores\n- Mobile friendly dashboard\n- Multiple leaderboard views (male, female and teams)\n\n### Milestones\n\n- [x] Create initial project files\n- [x] Add html template to the client folder\n- [x] Create mongo models (Team, Player, SyncRecord)\n- [x] Create required controllers \n- [x] Add method to accept date + steps and update accordingly \n- [x] Google Auth and extract daily steps \n- [x] API integration testing\n- [x] Implement frontend according to the design\n- [x] Create Dockerfile and docker-compose.yml\n- [x] Deploy into a AWS vm\n- [x] User testing\n\n### REST API\n\n- `GET /api/v1/leaderboard/topteams`\n- `GET /api/v1/leaderboard/topteams/{teamId}`\n- `GET /api/v1/leaderboard/topplayers`\n- `GET /api/v1/leaderboard/topplayers/{playerId}`\n- `GET /api/v1/leaderboard/topmaleplayers`\n- `GET /api/v1/leaderboard/topfemaleplayers`\n- `POST /api/v1/sync` - Replaces steps data, recalculates team/solo scores\n\n```json\n{\n    \"stepCounts\": [\n        {\n            \"date\": \"2018-10-12\",\n            \"steps\": 7500\n        },\n    {\n            \"date\": \"2018-12-12\",\n            \"steps\": 8500\n        }    \n    ]\n}\n```\n\n- `POST /api/v1/syncmanual` - Update/Add single data point, recalculates team/solo scores\n\n```json\n{\n    \"stepCounts\": \n        {\n            \"date\": \"2018-10-12\",\n            \"steps\": 7500\n        }\n}\n```\n- `GET /api/v1/playersync` - Retrive scores/steps for a specific player\n\n```json\n//Sample output\n{\n    \"total_steps\": [\n        {\n            \"_id\": \"5d31f96c936e5360eaa83c94\",\n            \"steps\": 5500,\n            \"points\": 25,\n            \"date\": \"2018-11-12T00:00:00.000Z\"\n        },\n        {\n            \"_id\": \"5d31ec3d41f5763bf038d9ae\",\n            \"date\": \"2018-10-12T00:00:00.000Z\",\n            \"steps\": 5500,\n            \"points\": 25\n        }\n    ],\n    \"steps\": 11000,\n    \"points\": 50\n}\n```\n\n### Developer Setup\n\nFork and clone `https://github.com/99xt/walk2win.git`\n\nInstall dependencies \n\n```bash\n$ cd client\n$ npm i\n$ cd ../server\n$ npm i\n```\n### Setup enviroment configuration\n\n#### Prerequisites \n\n- A Docker-installed virtual machine. (Eg: AWS EC2) \n- A MongoDb instance\n- OAuth 2.0 client ID and API key for Google Fit API\n\n#### server\n\n- Setup mongo connection string and the server port from `./server/.env`\n\n```\nMONGO_STR=\u003cdatabase_string\u003e\nPORT=3003\n```\n\n- Add your contest rules into `./server/constants.js`\n\n#### client\n\n- Follow steps mentioned [here](https://developers.google.com/fit/rest/v1/get-started) to request an OAuth 2.0 client ID and API key.\n\n- Add the keys to the relevant `environment.ts` file in location `client/src/environments`. You can select either prod or dev.\n\n```\nexport const environment = {\n\tproduction: true,\n\tbaseApi: '\u003cadd_base_api_here\u003e',\n\tclient_id: '\u003cadd_client_id_here\u003e',\n\tapiKey: '\u003cadd_apiKey_here\u003e'\n};\n```\n\nInstall mongodb and then import sample data\n\n```bash\n$ cd server\n// Enter some rows into data/data.csv\n$ npm run initdb\n```\n\nStart the REST API\n\n```\n$ cd server\n$ npm run dev\n```\n\nStart the Angular app\n\n```\n$ cd client\n$ ng serve -o\n```\n\nSubmit a pull request with the new feature\n\n\n### Deployment guidelines\n\nLogin to your vm or machine via `ssh`\n\n```\n$ ssh -i \u003ckey-file\u003e.pem \u003cusername\u003e@\u003cdomain\u003e\n```\n\nRemove existing directory and get a clone from deployment repository\n\n```\n$ sudo rm -rf \u003crepo-name\u003e\n$ git clone \u003crepo-url\u003e\n```\n\nCreate containers \n\n```\n$ cd \u003crepo-name\u003e\n$ sudo docker-compose up --build -d\n```\n\n### Initialize db from data.csv\nif you are using external mongodb service directly execute `intialize.sh` from the host. Otherwise(If you are using dockerized mongo instance), Log in to the container and execute `initialize.sh` \n\n```\n$ sudo docker exec -it --user=root \u003ccontainer_id\u003e /bin/bash -d\n$ cd data\n$ ./initialize.sh\n```\n\n## License\n\nDistributed under the MIT [License](https://github.com/99xt/walk2win/blob/master/LICENSE)\n\n\u003ca href=\"https://github.com/99xt/walk2win/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contributors-img.firebaseapp.com/image?repo=99xt/walk2win\" /\u003e\n\u003c/a\u003e\n\nMade with [contributors-img](https://contributors-img.firebaseapp.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99x%2Fwalk2win","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F99x%2Fwalk2win","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F99x%2Fwalk2win/lists"}