{"id":27624429,"url":"https://github.com/kobowood1/aichallengegame","last_synced_at":"2026-05-05T12:31:23.574Z","repository":{"id":288859119,"uuid":"968989099","full_name":"kobowood1/AIChallengeGame","owner":"kobowood1","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-20T03:16:49.000Z","size":30965,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-20T03:23:31.288Z","etag":null,"topics":["flask-application","html-css-javascript","jinga","python3","tailwindcss","typescript","webapp"],"latest_commit_sha":null,"homepage":"https://bit.ly/theChallengeGameRefugeeEdition","language":"HTML","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/kobowood1.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-04-19T06:09:42.000Z","updated_at":"2025-04-20T03:16:52.000Z","dependencies_parsed_at":"2025-04-21T09:32:20.853Z","dependency_job_id":null,"html_url":"https://github.com/kobowood1/AIChallengeGame","commit_stats":null,"previous_names":["kobowood1/aichallengegame"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kobowood1%2FAIChallengeGame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kobowood1%2FAIChallengeGame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kobowood1%2FAIChallengeGame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kobowood1%2FAIChallengeGame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kobowood1","download_url":"https://codeload.github.com/kobowood1/AIChallengeGame/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250430576,"owners_count":21429323,"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":["flask-application","html-css-javascript","jinga","python3","tailwindcss","typescript","webapp"],"created_at":"2025-04-23T11:43:59.052Z","updated_at":"2026-05-05T12:31:23.559Z","avatar_url":"https://github.com/kobowood1.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The CHALLENGE: Policy Jam - Refugee Edition\n\nA dynamic, AI-powered collaborative policy-making simulation platform designed to transform complex decision-making into an engaging, interactive learning experience through advanced technological integrations.\n\n## 📋 Project Overview\n\nThis web application simulates the policy-making process for refugee education in the fictional \"Republic of Bean.\" It allows users to:\n\n1. Make education policy decisions within budget constraints\n2. Interact with AI agents representing diverse ideological perspectives\n3. Engage in collaborative deliberation and voting processes\n4. Reflect on their decision-making experience\n5. Receive AI-generated policy profile analysis based on their choices\n6. Get detailed reports emailed to research teams\n\nThe simulation unfolds over three distinct phases:\n- **Phase 1:** Individual policy selection within budget constraints\n- **Phase 2:** Group deliberation with AI agents and voting\n- **Phase 3:** Reflection and reporting\n\n## 🚀 Features\n\n- **Multi-phase Interactive Experience**: Progressive gameplay that mimics real policy deliberation\n- **AI-Powered Agents**: Four ideologically diverse AI agents that provide realistic perspectives and debate policy options\n- **Dynamic Deliberation**: Live conversation interface for debating policies with AI agents\n- **Budget Constraints**: Limited resources force strategic trade-offs between competing worthy goals\n- **Gamified Interface**:\n  - Animated budget depletion notifications\n  - Color-coded policy options with intuitive icons\n  - Visual budget tracking with dynamic color changes\n  - Interactive UI elements with micro-animations\n- **Voting System**: Democratic majority-rule process with random tiebreaker\n- **Policy Profiling**: AI-generated analysis of user policy choices and reasoning\n- **Reflection Framework**: Guided questions for deep reflection on the simulation experience\n- **Report Generation**: Comprehensive reports in Markdown format\n- **Email Integration**: Automated email delivery of reports to research teams\n- **Database Storage**: Persistent data capture of participant information and choices\n\n## 💻 Technical Stack\n\n### Backend\n- **Flask**: Web framework for the application core\n- **Flask-SocketIO**: Real-time communication for interactive deliberation\n- **Flask-SQLAlchemy**: ORM for database operations\n- **Flask-WTF**: Form validation and CSRF protection\n- **Gunicorn/Eventlet**: WSGI server with async support\n\n### Frontend\n- **HTML/CSS/JavaScript**: Core web technologies\n- **Tailwind CSS**: Responsive, modern design framework\n- **Font Awesome**: Comprehensive icon library for enhanced UI\n- **Socket.IO (client)**: Real-time communication\n- **CSS Animations**: Micro-interactions and visual feedback\n\n### AI Integration\n- **OpenAI API**: Powers the AI agents and policy profile generation\n  - GPT-4o: Used for dynamic agent responses and content generation\n  - Contextual processing: Agents respond to specific deliberation topics\n\n### Data Processing \u0026 Delivery\n- **SendGrid API**: Email service for report distribution\n- **Markdown**: Used for report formatting\n- **WeasyPrint**: PDF generation (optional)\n\n### Database\n- **PostgreSQL**: Relational database for participant information\n\n## 🏛️ Architecture\n\nThe application follows a modular architecture with clear separation of concerns:\n\n- **app.py**: Application factory and core configuration\n- **routes.py**: HTTP routes for page rendering and form handling\n- **models.py**: Database models for participant information\n- **game.py**: Game mechanics and session management\n- **events.py**: Socket.IO event handlers for real-time communication\n- **game_data.py**: Policy information and budget validation\n- **ai_agents.py**: AI agent generation and response handling\n- **challenge_content.py**: Scenario content and policy areas\n- **email_utils.py**: Email functionality via SendGrid\n- **openai_utils.py**: OpenAI API integration and policy profile generation\n\n## 🔧 Setup \u0026 Configuration\n\n### Prerequisites\n- Python 3.11+\n- PostgreSQL database\n- SendGrid API key\n- OpenAI API key\n\n### Environment Variables\n- `DATABASE_URL`: PostgreSQL connection string\n- `SENDGRID_API_KEY`: SendGrid API key for email sending\n- `OPENAI_API_KEY`: OpenAI API key for AI feature functionality\n\n### Installation \u0026 Running\n1. Install Python dependencies: `pip install -r requirements.txt`\n2. Set up environment variables (see above)\n3. Start the application: `gunicorn --bind 0.0.0.0:5000 --worker-class eventlet main:app`\n\n## 🎮 Simulation Flow\n\n1. **Registration**: Participants provide demographic information\n2. **Scenario Introduction**: Background on the Republic of Bean's refugee situation\n3. **Phase 1 - Selection**: \n   - Choose policy options within budget constraints\n   - Interactive visual feedback for budget utilization\n   - Budget depletion notifications\n   - Color-coded options with clear cost indicators\n4. **Phase 2 - Deliberation**: \n   - Real-time discussion with AI agents\n   - Spontaneous debates between AI agents\n   - Voting mechanism with visual results\n5. **Phase 3 - Reflection**: \n   - Answer reflection questions\n   - Receive AI-generated policy profile\n6. **Thank You Page**: Download report and confirmation of email delivery\n\n## 🎲 Gamification Elements\n\nThe application incorporates several gamification elements to enhance user engagement:\n- **Budget Management**: Resource allocation with dynamic visual feedback\n- **Interactive UI**: Animations, micro-interactions, and visual transitions\n- **Color Psychology**: Semantic colors for different option levels (blue for basic, purple for moderate, red for comprehensive)\n- **Feedback Mechanisms**: Pop-up notifications for important events like budget depletion\n- **Strategic Choices**: Decisions with meaningful trade-offs and clear visual representation\n- **Progress Indicators**: Visual feedback showing advancement through the simulation\n\n## 🤖 AI Agent Design\n\nThe simulation includes four AI agents with diverse ideological perspectives:\n- Each agent has specific demographic and ideological attributes\n- Agents provide contextual responses based on their characteristics\n- Agents can spontaneously debate with each other after user messages\n- Agent names are prefixed with \"AI-\" to distinguish them from human players\n\n## 📧 Email Functionality\n\n- Uses SendGrid API for email delivery\n- Requires a verified sender email in production mode\n- Sends reports to designated recipients\n- Reports include participant info, policy selections, and reflection responses\n- Reports are formatted in Markdown with policy profile analysis\n\n## 🔍 Data Collection\n\nThe platform collects:\n- Participant demographics (age, nationality, occupation, education level, location)\n- Policy selections and budget allocation\n- Deliberation outcomes and voting results\n- Reflection responses to prompted questions\n\n## 📈 Future Enhancements\n\nPotential areas for future development:\n- Voice to text and text to Voice features\n- Multiple scenario support for different policy domains\n- Enhanced visualization of policy impacts\n- Advanced analytics dashboard for researchers\n- Integration with learning management systems\n- Support for larger deliberation groups\n- Integration with real-world policy databases\n\n## 📝 License\n\nThis project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).\n\n- **Personal Use**: Freely permitted\n- **Commercial Use**: Prohibited without explicit permission\n- **Attribution**: Required\n- **Modifications**: Permitted for non-commercial purposes\n\nCopyright © 2025 Kofi Wood. All rights reserved.\n\nSee the [LICENSE](./LICENSE) file for complete terms and conditions.\n\nCopyright © 2025 The CHALLENGE: Policy Jam - Refugee Edition\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkobowood1%2Faichallengegame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkobowood1%2Faichallengegame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkobowood1%2Faichallengegame/lists"}