{"id":46456483,"url":"https://github.com/nikosalonen/moelkky","last_synced_at":"2026-03-06T01:59:13.555Z","repository":{"id":306466404,"uuid":"1026296223","full_name":"nikosalonen/moelkky","owner":"nikosalonen","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-25T19:49:30.000Z","size":233,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T23:23:02.767Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nikosalonen.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,"zenodo":null}},"created_at":"2025-07-25T16:31:06.000Z","updated_at":"2025-07-25T19:49:34.000Z","dependencies_parsed_at":"2025-07-25T23:24:01.034Z","dependency_job_id":null,"html_url":"https://github.com/nikosalonen/moelkky","commit_stats":null,"previous_names":["nikosalonen/moelkky"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nikosalonen/moelkky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikosalonen%2Fmoelkky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikosalonen%2Fmoelkky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikosalonen%2Fmoelkky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikosalonen%2Fmoelkky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikosalonen","download_url":"https://codeload.github.com/nikosalonen/moelkky/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikosalonen%2Fmoelkky/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30158632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"ssl_error","status_checked_at":"2026-03-05T22:39:24.771Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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-03-06T01:59:12.828Z","updated_at":"2026-03-06T01:59:13.544Z","avatar_url":"https://github.com/nikosalonen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mölkky Score Counter\n\nA modern, mobile-first web application for tracking scores and managing Mölkky games. Built with Preact, TypeScript, and Tailwind CSS.\n\n## 🎯 About Mölkky\n\nMölkky is a Finnish throwing game where players throw a wooden pin (the \"mölkky\") to knock down numbered wooden pins. The goal is to score exactly 50 points. If a player exceeds 50 points, their score is reset to 25.\n\n## ✨ Features\n\n- **Game Modes**: Support for both individual and team-based games\n- **Player Management**: Add, remove, and manage players for your game\n- **Team Management**: Create and manage teams with up to 4 players per team\n- **Team Player Reordering**: Mobile-friendly reordering of players within teams\n- **Score Tracking**: Record scores with automatic turn advancement\n- **Penalty System**: Apply penalties that reset player scores to 25\n- **Game History**: View and manage previous games\n- **End Game Functionality**: End current game and return to start screen at any time\n- **Mobile-First Design**: Optimized for mobile devices with touch-friendly interface\n- **PWA Support**: Install as a mobile app with offline capabilities\n- **Real-time Updates**: Live score updates and game state management\n- **Toast Notifications**: User-friendly feedback for all game actions\n- **Error Handling**: Robust error boundaries and validation\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Node.js (version 18 or higher)\n- npm or yarn package manager\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/nikosalonen/moelkky.git\ncd moelkky\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Start the development server:\n```bash\nnpm run dev\n```\n\n4. Open your browser and navigate to `http://localhost:5173`\n\n### Building for Production\n\n```bash\nnpm run build\n```\n\nThe built files will be in the `dist` directory.\n\n## 🎮 How to Use\n\n### Starting a Game\n\n1. **Choose Game Mode**: Select between Individual or Team mode\n2. **Add Players**: Enter player names and click \"Add Player\" (minimum 2 players required)\n3. **Create Teams** (Team Mode): Create teams and assign players (2-4 players per team, minimum 2 teams)\n4. **Reorder Team Players** (Team Mode): Use the \"Reorder\" button to arrange players in throwing order (mobile-optimized)\n5. **Start Game**: Click \"Start Game\" to begin\n6. **Track Scores**: Use the score input to record points for each player/team\n7. **Apply Penalties**: Use the penalty button if a player/team violates rules\n8. **End Game**: Click the \"End Game\" button to return to the start screen and reset all scores\n\n### Team Game Flow\n\nIn team mode, the throwing order follows this pattern:\n- **Round 1**: Team 1 Player 1 → Team 2 Player 1 → Team 3 Player 1 → ...\n- **Round 2**: Team 1 Player 2 → Team 2 Player 2 → Team 3 Player 2 → ...\n- **Round 3**: Team 1 Player 3 → Team 2 Player 3 → Team 3 Player 3 → ...\n- And so on...\n\nThis ensures each team gets one throw per round, and all players within each team throw in the order you've set.\n\n### Scoring Rules\n\n- **Single Pin**: Score the number on the pin\n- **Multiple Pins**: Score the number of pins knocked down\n- **Exceeding 50**: Score resets to 25\n- **Winning**: First player/team to reach exactly 50 points wins\n- **Consecutive Misses**: \n  - **Individual Mode**: Players are eliminated after 3 consecutive zero-point turns\n  - **Team Mode**: Teams are eliminated after 3 consecutive zero-point turns\n\n### Game History\n\n- Click \"View Game History\" to see previous games\n- View detailed statistics including penalties and game duration\n\n## 🛠️ Development\n\n### Project Structure\n\n```\nsrc/\n├── components/          # Preact components\n│   ├── ErrorBoundary/   # Error handling\n│   ├── GameBoard/       # Main game interface\n│   ├── GameHistory/     # Game history modal\n│   ├── GameModeSelector/ # Game mode selection\n│   ├── MobileNav/       # Mobile navigation\n│   ├── PlayerManager/   # Player management\n│   ├── ScoreInput/      # Score input component\n│   ├── TeamManager/     # Team management\n│   ├── Toast/           # Notification system\n│   └── WinnerDisplay/   # Winner announcement\n├── context/             # Preact context providers\n├── hooks/               # Custom Preact hooks\n├── utils/               # Utility functions\n│   ├── gameLogic/       # Game logic\n│   ├── storage/         # Data persistence\n│   └── types/           # TypeScript type definitions\n└── main.tsx            # Application entry point\n```\n\n### Available Scripts\n\n- `npm run dev` - Start development server\n- `npm run build` - Build for production\n- `npm run preview` - Preview production build\n- `npm test` - Run tests\n- `npm run test:watch` - Run tests in watch mode\n- `npm run test:ui` - Run tests with UI\n\n### Testing\n\nThe project includes comprehensive tests using Vitest and Testing Library:\n\n```bash\nnpm test\n```\n\nTests cover:\n- Component functionality\n- Game logic and state management\n- User interactions\n- Error handling\n\n#### E2E Testing\n\nThe project also includes end-to-end tests using Playwright:\n\n```bash\n# Run e2e tests (recommended - automatically manages dev server)\nnpm run test:e2e\n\n# Run e2e tests with headed browser\nnpm run test:e2e:headed\n\n# Run e2e tests in debug mode\nnpm run test:e2e:debug\n\n# Run e2e tests with UI\nnpm run test:e2e:ui\n\n# Run e2e tests with built-in server (may hang)\nnpm run test:e2e:with-server\n\n# View e2e test reports\nnpm run test:e2e:report\n```\n\n**Note**: The default `test:e2e` command uses a custom script that automatically starts and stops the development server, preventing the hanging issue that can occur with the built-in webServer option.\n\n## 🎨 Technology Stack\n\n- **Frontend Framework**: [Preact](https://preactjs.com/) - Fast 3kB alternative to React\n- **Language**: [TypeScript](https://www.typescriptlang.org/) - Type-safe JavaScript\n- **Styling**: [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework\n- **Build Tool**: [Vite](https://vitejs.dev/) - Fast build tool and dev server\n- **Testing**: [Vitest](https://vitest.dev/) - Fast unit testing framework\n- **Testing Library**: [@testing-library/preact](https://testing-library.com/docs/preact-testing-library/intro/) - Testing utilities\n- **E2E Testing**: [Playwright](https://playwright.dev/) - End-to-end testing framework\n- **PWA**: Progressive Web App with offline capabilities\n\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Commit Convention\n\nThis project follows [Conventional Commits](https://www.conventionalcommits.org/):\n\n- `feat:` - New features\n- `fix:` - Bug fixes\n- `docs:` - Documentation changes\n- `style:` - Code style changes\n- `refactor:` - Code refactoring\n- `test:` - Test additions or changes\n- `chore:` - Build process or auxiliary tool changes\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Inspired by the traditional Finnish game Mölkky\n- Built with modern web technologies for the best user experience\n- Special thanks to the Preact and Tailwind CSS communities\n\n## 📞 Support\n\nIf you encounter any issues or have questions, please:\n\n1. Check the [Issues](https://github.com/nikosalonen/moelkky/issues) page\n2. Create a new issue with detailed information\n3. Include steps to reproduce the problem\n\n---\n\n**Happy Mölkky playing! 🎯** \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikosalonen%2Fmoelkky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikosalonen%2Fmoelkky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikosalonen%2Fmoelkky/lists"}