{"id":47669341,"url":"https://github.com/usr-wwelsh/dominion-tracker","last_synced_at":"2026-04-02T12:25:29.013Z","repository":{"id":339267734,"uuid":"1161156280","full_name":"usr-wwelsh/dominion-tracker","owner":"usr-wwelsh","description":"Tracks our dominion games... ","archived":false,"fork":false,"pushed_at":"2026-03-30T10:17:59.000Z","size":1239,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T12:16:35.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/usr-wwelsh.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-18T19:50:08.000Z","updated_at":"2026-03-18T04:31:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/usr-wwelsh/dominion-tracker","commit_stats":null,"previous_names":["usr-wwelsh/dominion-tracker"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/usr-wwelsh/dominion-tracker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usr-wwelsh%2Fdominion-tracker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usr-wwelsh%2Fdominion-tracker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usr-wwelsh%2Fdominion-tracker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usr-wwelsh%2Fdominion-tracker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usr-wwelsh","download_url":"https://codeload.github.com/usr-wwelsh/dominion-tracker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usr-wwelsh%2Fdominion-tracker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31306024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T09:48:21.550Z","status":"ssl_error","status_checked_at":"2026-04-02T09:48:19.196Z","response_time":89,"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":[],"created_at":"2026-04-02T12:25:28.311Z","updated_at":"2026-04-02T12:25:29.000Z","avatar_url":"https://github.com/usr-wwelsh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dominion Game Tracker\n\nA full-stack web application to track Dominion card game sessions, player statistics, and leaderboards.\n\n## Features\n\n- **Live Scoreboard**: Track scores in real-time during games\n- **Player Leaderboard**: View player rankings based on league points\n- **Game History**: Browse past games with score progression charts\n- **Build Management**: Create and manage card builds with statistics\n\n## Technical Stack\n\n- **Frontend**: Vanilla HTML5, CSS3, JavaScript (ES6+)\n- **Backend**: Node.js with Express.js\n- **Database**: PostgreSQL\n\n## Setup Instructions\n\n### Option A — Docker (recommended, works locally and on any VPS)\n\nThe easiest way to run the full stack. Requires [Docker](https://docs.docker.com/get-docker/) with Compose.\n\n1. Clone the repo and enter the directory:\n```bash\ngit clone https://github.com/usr-wwelsh/dominion-tracker.git\ncd dominion-tracker\n```\n\n2. Set your database password (or skip to use the default `changeme`):\n```bash\ncp .env.example .env\n# edit .env and set DB_PASSWORD\n```\n\n3. Start all services (images will be pulled if not present):\n```bash\ndocker compose up -d\n```\n\n4. Open `http://localhost` in your browser.\n\nTo stop: `docker compose down`\nTo wipe the database and start fresh: `docker compose down -v`\n\n---\n\n### Option B — Manual (local development)\n\n#### Prerequisites\n\n- Node.js (v18 or higher)\n- PostgreSQL (v14 or higher)\n\n#### Database Setup\n\n1. Create a PostgreSQL database:\n```bash\ncreatedb dominion_tracker\n```\n\n2. Initialize the schema:\n```bash\npsql -U postgres -d dominion_tracker -f backend/schema.sql\n```\n\n#### Backend Setup\n\n1. Install dependencies:\n```bash\ncd backend \u0026\u0026 npm install\n```\n\n2. Create `backend/.env`:\n```\nDB_HOST=localhost\nDB_PORT=5432\nDB_NAME=dominion_tracker\nDB_USER=postgres\nDB_PASSWORD=your_password\nPORT=3000\n```\n\n3. Start the server:\n```bash\nnpm start\n```\n\nThe API will be available at `http://localhost:3000`.\n\n#### Frontend Setup\n\nServe the `frontend/` directory with any static file server:\n```bash\npython3 -m http.server 8000 --directory frontend\n```\n\nNavigate to `http://localhost:8000`.\n\n---\n\n### Deploying to a VPS (Hostinger, etc.)\n\n1. Install Docker on the server\n2. Copy the project folder to the server (e.g. via `scp` or `git clone`)\n3. Set `DB_PASSWORD` in `.env`\n4. Pull and run the Docker services:\n```bash\ndocker compose pull\ndocker compose up -d\n```\n5. The app is live on port 80 (assuming default Docker Compose port mapping)\n\n## Usage\n\n1. **Create Players**: Players are created automatically when added to a game\n2. **Create a Build**: Go to the Builds page and select cards for your game\n3. **Start a Game**: Use the Scoreboard page to set up a game with players\n4. **Track Scores**: Update scores during the game using +/- buttons\n5. **End Game**: Finish the game to record final scores and calculate league points\n6. **View Stats**: Check the Leaderboard and Games pages for statistics\n\n## League Points System\n\nPoints scale with the number of players using the formula:\n\n`LP = 100 × (n − p) / (n − 1)`\n\nWhere `n` = total players and `p` = placement. First place always gets 100, last place always gets 0, and everyone else is evenly distributed in between.\n\nExample (4 players): 1st = 100, 2nd = 66.67, 3rd = 33.33, 4th = 0\n\nTies: tied players receive the average of the points slots they occupy.\n\n## API Endpoints\n\n### Players\n- `GET /api/players` - List all players\n- `POST /api/players` - Create a player\n- `GET /api/players/:id` - Get player details\n- `DELETE /api/players/:id` - Delete a player\n- `GET /api/players/:id/stats` - Get player statistics\n- `GET /api/players/:id/h2h` - Get head-to-head stats\n- `PATCH /api/players/:id/color` - Update player color\n\n### Builds\n- `GET /api/builds` - List all builds\n- `POST /api/builds` - Create a build\n- `GET /api/builds/:id` - Get build details\n- `PUT /api/builds/:id` - Update a build\n- `DELETE /api/builds/:id` - Delete a build\n- `GET /api/builds/:id/comments` - List comments on a build\n- `POST /api/builds/:id/comments` - Add a comment to a build\n- `DELETE /api/builds/:buildId/comments/:commentId` - Delete a comment\n\n### Games\n- `GET /api/games` - List all games\n- `POST /api/games` - Create a game\n- `GET /api/games/:id` - Get game details\n- `PUT /api/games/:id/start` - Start a game\n- `PUT /api/games/:id/end` - End a game\n- `DELETE /api/games/:id/cancel` - Cancel an in-progress game\n- `DELETE /api/games/:id` - Delete a game\n- `POST /api/games/:id/scores` - Update a player score\n- `GET /api/games/:id/scores` - Get score history\n\n### Statistics\n- `GET /api/leaderboard` - Get player leaderboard\n- `GET /api/stats/extras` - Get extra stats\n\n### Other\n- `GET /api/auth/check` - Check auth status\n- `GET /health` - Health check\n\n## License\n\n[MIT](LICENSE) © usr-wwelsh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusr-wwelsh%2Fdominion-tracker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusr-wwelsh%2Fdominion-tracker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusr-wwelsh%2Fdominion-tracker/lists"}