A browser-based RPG dungeon crawler built with Flask and WebSockets. Fight enemies, earn gold, buy equipment from the shop, and climb to the top of the leaderboard alongside other players! Don't forget to chat with the other players and let them know how you're going, or simply ask them about their day! All in real time.
Built for CITS3403 (Agile Web Development) at UWA.
If something breaks during setup, jump to the fix:
- Python not installed or wrong version
- Pip not found
- venv won't create on Linux/Mac
- ModuleNotFoundError after installing requirements
- Port already in use
- Backend: Python / Flask + Flask-SocketIO
- Database: SQLite via Flask-SQLAlchemy + Flask-Migrate
- Frontend: Vanilla JS, HTML, CSS
- Real-time: WebSockets (Socket.IO)
git clone https://github.com/robertmoa/catquest
cd catquestWindows:
python -m venv venv
venv\Scripts\activateMac/Linux:
python3 -m venv venv
source venv/bin/activateWindows:
pip install -r static\more\requirements.txtMac/Linux:
pip install -r static/more/requirements.txtCatQuest uses Flask sessions, so each local setup needs its own secret key.
Windows PowerShell:
$env:SECRET_KEY = python -c "import secrets; print(secrets.token_hex(32))"Mac/Linux:
export SECRET_KEY="$(python3 -c 'import secrets; print(secrets.token_hex(32))')"Windows:
python create_db.pyMac/Linux:
python3 create_db.pyWindows:
python app.pyMac/Linux:
python3 app.pyThen open on your default browser at: http://127.0.0.1:5000
Windows:
git clone https://github.com/robertmoa/catquest
cd catquest
python -m venv venv
venv\Scripts\activate
pip install -r static\more\requirements.txt
$env:SECRET_KEY = python -c "import secrets; print(secrets.token_hex(32))"
python create_db.py
python app.pyMac/Linux:
git clone https://github.com/robertmoa/catquest
cd catquest
python3 -m venv venv
source venv/bin/activate
pip install -r static/more/requirements.txt
export SECRET_KEY="$(python3 -c 'import secrets; print(secrets.token_hex(32))')"
python3 create_db.py
python3 app.pyIf you've already run create_db.py before, just do:
Windows:
venv\Scripts\activate
$env:SECRET_KEY = python -c "import secrets; print(secrets.token_hex(32))"
python app.pyMac/Linux:
source venv/bin/activate
export SECRET_KEY="$(python3 -c 'import secrets; print(secrets.token_hex(32))')"
python app.pycatquest/
├── app.py # Entry point — run this to start the server
├── create_db.py # Run once to create and seed the database
├── models.py # Database models (User, Monster, Item, etc.)
├── routes.py # Page routes (login, main, dungeon, shop)
├── serverstuff.py # Shared Flask/SocketIO/DB instances
├── sockets.py # General socket events (chat, connections)
├── dungeon_sockets.py # Dungeon-specific socket events (combat, gold, XP)
├── shop_sockets.py # Shop socket events + item seeding
├── loginmgmt.py # Login/logout socket logic
├── user_handling.py # User stat helpers
├── tests/ # unit and selenium test files
├── templates/ # HTML templates
└── static/ # CSS, JS, images, fonts
python -m unittest tests.test_unit
python -m unittest tests.test_seleniumCheck if Python is installed:
python --version # Windows
python3 --version # Mac/LinuxYou need Python 3.10+. Download from https://www.python.org/downloads/
Windows: During install, tick "Add Python to PATH" or the
pythoncommand won't work in terminal.
Linux/Ubuntu:
sudo apt install python3-pipMac:
brew install pythonpip comes bundled with Python on Windows — if it's missing, reinstall Python.
If you see ensurepip is not available:
sudo apt install python3.12-venvThen retry:
python3 -m venv venv
source venv/bin/activateIf you get No module named 'flask_socketio' or similar after installing requirements, run:
pip install flask-socketio flask-sqlalchemy flask-migrateThen retry python create_db.py.
If you see Address already in use on port 5000:
Mac — port 5000 is used by AirPlay by default. Disable it in System Settings → General → AirDrop & Handoff, or change the port in app.py:
socketio.run(app, debug=True, port=5001)| Name | Student ID | GitHub Username |
|---|---|---|
| Robert Smart | 24468811 | robertmoa |
| Lachlan Vaz | 24219564 | VazLM |
| Dennis Quek | 23879473 | dendenpixel |