{"id":28219901,"url":"https://github.com/phoffer/hockey","last_synced_at":"2025-06-11T09:30:44.411Z","repository":{"id":185366713,"uuid":"636461016","full_name":"phoffer/hockey","owner":"phoffer","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-09T03:14:03.000Z","size":226,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T03:12:11.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/phoffer.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}},"created_at":"2023-05-04T22:43:30.000Z","updated_at":"2023-05-09T02:14:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"a85ece4b-da19-46a6-bbc8-cbcb7b5d1766","html_url":"https://github.com/phoffer/hockey","commit_stats":null,"previous_names":["phoffer/hockey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoffer%2Fhockey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoffer%2Fhockey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoffer%2Fhockey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoffer%2Fhockey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phoffer","download_url":"https://codeload.github.com/phoffer/hockey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phoffer%2Fhockey/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259238574,"owners_count":22826779,"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":[],"created_at":"2025-05-18T03:11:45.390Z","updated_at":"2025-06-11T09:30:44.401Z","avatar_url":"https://github.com/phoffer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n## How to run\n\nAssuming you've already set everything up, everything can be run with the following command:\n\n```\nbin/dev\n```\n\nThis will boot the server on port 3000 and also run the clockwork process to sync schedule and live games.\n\nVisit http://localhost:3000 and have fun!\n\n## Local setup\n\nLocal setup will import the current hockey season, but not sync any game data. Games for the current league date (ie. date for NHL) will automatically sync when running server. Other games can be manually synced from the schedule page.\n\nTo import additional season, open a Rails console and run `SyncService::Seasons.import('SEASON_ID')`, where season ID follows the pattern of combining start and end years. IE. for 2021-2022, the ID is `20212022`.\n\n### Requirements\n\n* Postgres\n* Redis\n* Some kind of version manager to provide:\n  - Ruby 3.2.0\n  - Yarn\n  - Node\n\n### Setup\n\n```\ngit clone\n\n# if ruby/nodejs/yarn aren't available via asdf\nasdf plugin add ruby\nasdf plugin add nodejs\nasdf plugin add yarn\n# \n\nasdf install\nbundle\nyarn\nbundle exec rails db:setup\nbin/dev\n```\n\n## Considerations for a larger system but not handled for this app\n\n* Building for different sports\n  - Add a models for sports and for leagues\n  - seasons, teams belong_to(:league)\n  - configure which leagues utilize which API wrappers\n* Proper team/player sync\n  - There is a decent amount of complexity around team/player syncing in sports\n  - For example, players have a not-null constraint on team_id. This isn't accurate in real life (free agents, retired)\n  - Teams can move, change names, etc, so need extra data to associate that to seasons\n  - Teams are treated as static entities here\n  - We will use lazy evaluation to set up team/players for this\n  - Teams loaded from schedule, players loaded from game stats\n\n## Bugs\n\n* Some temporary condition that allows stats to be created for players not playing in game. Suspect it's pregame data\n* Manual game update is handled in http request cycle. This is to avoid adding more requirements (redis/sidekiq) to this for now.\n\n## TODO\n\n* display goalie stats\n* smarter logic to select which games to update, instead of all for current date\n* Update controller/views for players to have game log\n* Update controller/views for teams to have game schedule\n* Auto update games live! Add some hotwire/stimulus fun\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoffer%2Fhockey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphoffer%2Fhockey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphoffer%2Fhockey/lists"}