A web-based D&D adventure game powered by Google's Gemini AI. Experience dynamic, AI-generated storytelling with persistent campaigns, randomized characters, and immersive settings.
This project was built at the Claude Builder Club @ TCD Hackathon (December 2025) and won:
- 🥇 Best Team Collaboration
- 🎨 Most Creative Use of Claude
It has since been moved from Claude to Google Gemini due to costs.
- AI-Powered Dungeon Master — Dynamic storytelling that adapts to your choices
- Randomized Adventures — Each reset generates new characters, settings, and themes
- Persistent Campaigns — Your progress is automatically saved
- Multiple Themes — Medieval Fantasy, Steampunk, Sci-Fi, Post-Apocalyptic, and more
- Character Variety — Random races (Human, Elf, Dwarf, Orc) and classes (Warrior, Mage, Rogue, Engineer, Cleric)
- Dark/Light Mode — Toggle between themes for comfortable play
- CLI & Web Modes — Play in your terminal or browser
- Python 3.12 or higher
- Node.js 18+ and npm
- Google Gemini API key
git clone https://github.com/Cillian-Cooke/hackathon.git
cd hackathonCreate a .env file in the project root:
touch .envAdd your Gemini API key to the .env file:
GEMINI_API_KEY=your_gemini_api_key_here📝 Getting a Gemini API Key:
- Go to Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key and paste it in your
.envfile
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On macOS/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtcd my-react-app
npm installStart both the backend server and frontend in separate terminals:
Terminal 1 — Backend:
source venv/bin/activate # If not already activated
uvicorn server:app --reloadTerminal 2 — Frontend:
cd my-react-app
npm run devOpen your browser to http://localhost:5173
For a terminal-based experience:
source venv/bin/activate
python cli.py- Start — The AI Dungeon Master sets the scene
- Type Actions — Enter what your character does (e.g., "I search the room", "Attack the goblin")
- Special Commands:
📖 Summary of Story— Get a recap of your adventure👤 Player Status— View your character's stats and abilities🔥 Reset Campaign— Start a completely new adventure
hackathon/
├── my-react-app/ # Node Modules and React Deps
│ └── src/
│ └── main.jsx # React application entry
├── cli.py # CLI game engine & DM logic
├── server.py # FastAPI backend server
├── style.css # Application styles
├── index.html # HTML entry point
├── .env # Environment variables (create this)
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
├── package.json # Node dependencies
└── README.md # This file
fastapi— Web framework for the APIuvicorn— ASGI servergoogle-genai— Gemini AI SDKpython-dotenv— Environment variable managementpydantic— Data validation
react— UI frameworkreact-icons— Icon componentsvite— Build tool and dev server
The game can be customized by modifying constants in cli.py:
| Setting | Description | Default |
|---|---|---|
GEMINI_MODEL |
AI model to use | gemini-2.5-flash |
TOTAL_STAT_POINTS |
Points for character stats | 30 |
max_output_tokens |
Response length limit | 2048 |
Contributions are welcome! Feel free to:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License — see the LICENSE file for details.
- Claude Builder Club @ TCD for hosting the hackathon
- Google Gemini for the AI capabilities
- FastAPI for the excellent Python web framework
- Vite for the blazing fast frontend tooling
Made with ❤️ at the Claude Builder Club @ TCD Hackathon