{"id":28391491,"url":"https://github.com/logaka/choosergame","last_synced_at":"2025-06-25T21:31:02.358Z","repository":{"id":291589797,"uuid":"978101545","full_name":"Logaka/ChooserGame","owner":"Logaka","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-25T18:00:27.000Z","size":1913,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T09:38:28.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Logaka.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-05-05T13:25:06.000Z","updated_at":"2025-05-25T18:00:57.000Z","dependencies_parsed_at":"2025-05-05T14:59:40.388Z","dependency_job_id":null,"html_url":"https://github.com/Logaka/ChooserGame","commit_stats":null,"previous_names":["logaka/choosergame_17-p"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Logaka/ChooserGame","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logaka%2FChooserGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logaka%2FChooserGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logaka%2FChooserGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logaka%2FChooserGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Logaka","download_url":"https://codeload.github.com/Logaka/ChooserGame/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logaka%2FChooserGame/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261955834,"owners_count":23235962,"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-31T09:39:18.524Z","updated_at":"2025-06-25T21:31:02.352Z","avatar_url":"https://github.com/Logaka.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Chooser - Interactive Random Player Selector\n\n## Introduction\nChooser is an interactive solution designed for randomly selecting participants in group activities. It provides a digital and fair alternative to traditional methods such as drawing straws or rolling dice. This project offers a responsive web and backend solution for random player selection and task assignments for group activities.\n\n## Problem Statement\nGroup decision-making often involves random selection to ensure fairness, but traditional methods like drawing straws or rolling dice are cumbersome. Chooser solves this problem by offering a digital, interactive, and fun approach. The solution works on touchscreen devices and integrates additional features like task assignment and elimination modes, which make group activities more engaging and efficient.\n\n## Objectives\n- Provide a fair and unbiased mechanism for random selection\n- Offer task assignment capabilities with varying difficulty levels\n- Enable custom task creation using AI prompts\n- Deliver a responsive and reliable API for frontend integration\n- Support integration with touch-enabled devices for interactive selection\n- Enhance group activities by randomly selecting participants and assigning tasks\n\n## Technology Stack\n- **Frontend**: Vanilla JavaScript, HTML5 Canvas, Bootstrap 5\n- **Backend**: Java 21, Spring Boot 3.4.5 (for API integration)\n- **Database**: PostgreSQL (for persistent storage)\n- **Build Tool**: Maven\n- **Deployment**: Docker, Docker Compose, AWS EC2\n- **API Documentation**: Swagger/OpenAPI\n- **Additional**: Pointer Events API, Web Audio API, Cohere API for custom AI tasks\n- **Testing**: JUnit, Spring Test (for backend), manual multi-touch testing (for frontend)\n\n## Installation Instructions\n\n### Local Setup (Backend)\n```bash\n# 1. Clone the repository\ngit clone https://github.com/Logaka/ChooserGame_17-P/tree/main/Chooser-Back\n\n# 2. Navigate to the project directory\ncd Chooser-Back\n\n# 3. Set up environment variables\n# Create a .env file with the following variables:\n# POSTGRES_URL=jdbc:postgresql://localhost:5432/chooser\n# POSTGRES_USER=postgres\n# POSTGRES_PASSWORD=postgres\n# token=your_cohere_api_token\n\n# 4. Build the application\n./mvnw clean package -DskipTests\n\n# 5. Run the application\n./mvnw spring-boot:run\n```\n\n### Docker Setup (Backend)\n```bash\n# 1. Clone the repository\ngit clone https://github.com/Logaka/ChooserGame_17-P/tree/main/Chooser-Back\n\n# 2. Navigate to the project directory\ncd Chooser-Back\n\n# 3. Set up environment variables\n# Create a .env file with the necessary variables\n\n# 4. Start the application using Docker Compose\ndocker-compose up -d\n```\n\n### Local Setup (Frontend)\n```bash\n# 1. Clone the repository\ngit clone https://github.com/Logaka/ChooserGame_17-P/tree/main/Chooser-Front\n# 2. Navigate into the project directory\ncd Chooser-Front\n\n# 3. Install dependencies\nnpm install -g live-server\n\n# 4. Start the application\nlive-server --host=0.0.0.0 --port=8000\n```\n\nAlternatively, you can simply open `index.html` in a web browser if you're not using a build process.\n\n## Usage Guide\n### API Endpoints\n\n#### Start a Game Session\n```\nPOST /api/v1/start\n```\n\n**Random Mode Example:**\n```json\n{\n    \"playerIds\": [1, 2, 3, 4],\n    \"gameOption\": {\n        \"mode\": \"RANDOM\"\n    }\n}\n```\n\n**Response:**\n```json\n{\n    \"sessionId\": null,\n    \"choosenPlayerId\": 3,\n    \"task\": null\n}\n```\n\n**Task Mode Example:**\n```json\n{\n    \"playerIds\": [1, 2, 3, 4],\n    \"gameOption\": {\n        \"mode\": \"TASK\",\n        \"taskLevel\": \"EASY\"\n    }\n}\n```\n\n**Response:**\n```json\n{\n    \"sessionId\": \"some-session-id\",\n    \"choosenPlayerId\": 2,\n    \"task\": {\n        \"text\": \"Спой куплет детской песни\",\n        \"level\": \"EASY\"\n    }\n}\n```\n\n**Custom AI Task Example:**\n```json\n{\n    \"playerIds\": [1, 2, 3, 4],\n    \"gameOption\": {\n        \"mode\": \"TASK\",\n        \"taskLevel\": \"MEDIUM\",\n        \"prompt\": \"что-то связанное с танцами\"\n    }\n}\n```\n\n### Frontend Usage\n1. Open the application on a touchscreen device.\n2. Configure settings:\n   - Select mode: Random or Task\n   - Choose task difficulty: Easy, Medium, Hard\n   - Set timer duration\n   - Toggle background music\n3. For AI-generated tasks, click the robot icon and enter a prompt.\n4. Participants place their fingers on the screen, and the app randomly selects one participant.\n5. If in Task mode, the selected participant will receive a task.\n\n## Testing\n- Run unit tests using:\n  ```bash\n  ./mvnw test\n  ```\n\n- For integration tests, use:\n  ```bash\n  ./mvnw verify\n  ```\n\n- Frontend testing relies on manual multi-touch testing or simulation of touch events using compatible devices.\n\n## Known Issues / Limitations\n- Sessions are lost when the app restarts (for in-memory storage).\n- Task caching may cause newly added tasks to not be immediately available.\n- Requires backend server integration for task functionality.\n- Limited to the number of touch points your device supports (especially on older devices).\n\n## References\n- [Spring Boot Documentation](https://docs.spring.io/spring-boot/docs/current/reference/html/)\n- [PostgreSQL Documentation](https://www.postgresql.org/docs/)\n- [Docker Documentation](https://docs.docker.com/)\n- [Cohere API Documentation](https://docs.cohere.com/)\n- [HTML5 Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)\n- [Pointer Events API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events)\n- [Bootstrap 5 Documentation](https://getbootstrap.com/docs/5.3/getting-started/introduction/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogaka%2Fchoosergame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogaka%2Fchoosergame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogaka%2Fchoosergame/lists"}