guezzit - (Demo)
A real-time, multiplayer drawing game.
- Overview
- Features
- Tech Stack
- Installation
- Configuration
- Usage
- Deployment
- Contributing
- License
- Contact
" guezzit is a real-time, multiplayer drawing game built with Django, Django Channels, and WebSockets. Players can join public or private game rooms, take turns drawing, and guess what is being drawn. The application supports live chat, dynamic game state updates, and a responsive canvas for a smooth drawing experience."
- Real-time Multiplayer Drawing: Players can draw and see each other's drawings in real time.
- Game Room Management: Create and join public or private rooms.
- Turn-based Gameplay: One player draws while others guess.
- Live Chat: Communicate with other players during the game.
- Scoreboard and Leaderboard: Track scores and display rankings.
- Responsive UI: Works on desktop and mobile devices.
- WebSocket Communication: Efficient real-time updates using Django Channels.
- Backend: Django, Django REST Framework, Django Channels
- Database: PostgreSQL
- Real-time Communication: WebSockets (using Daphne/Uvicorn and Redis as the channel layer)
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Deployment: Railway, Docker
- Other Tools: dj-database-url, python-decouple/django-environ, WhiteNoise for static files
- Python 3.8+
- PostgreSQL
- Redis (for channel layer)
- Pipenv
-
Clone the Repository:
git clone https://github.com/Nahi-shady/Online-Multiplayer-Drawing-Game.git cd Online-Multiplayer-Drawing-Game -
Set Up the Virtual Environment:
pipenv install --dev pipenv shell -
Apply Migrations:
python manage.py migrate
-
Create a Superuser (Optional):
python manage.py createsuperuser
Create a .env file in the project root (make sure it's in your .gitignore) with the following variables:
DJANGO_SECRET_KEY=your_secret_key_here
DJANGO_DEBUG=False
DATABASE_URL=postgres://username:password@your_db_host:your_db_port/your_db_name?sslmode=require
REDIS_URL=redis://your_redis_host:your_redis_portAlternatively, set these environment variables using your hosting platform's configuration settings.
The project supports separate settings for development and production. Ensure you set the DJANGO_SETTINGS_MODULE environment variable appropriately:
export DJANGO_SETTINGS_MODULE=illustra_backend.settings.prod # for productionTo run the project locally using Django’s development server:
python manage.py runserverFor Channels (WebSocket) support, you can use Daphne:
daphne -b 0.0.0.0 -p 8000 illustra_backend.asgi:applicationOpen your browser and navigate to the homepage (e.g., http://127.0.0.1:8000/) to join or create a game room. Follow on-screen instructions to play.
For deploying on Railway (or another hosting provider):
-
Configure Environment Variables: Set DATABASE_URL, REDIS_URL, DJANGO_SECRET_KEY, etc., using the provider’s dashboard.
-
Configure the ASGI Server:
Use Daphne or Uvicorn as your ASGI server:
daphne -b 0.0.0.0 -p 8000 illustra_backend. asgi:application
-
Static Files:
Ensure static files are collected:
python manage.py collectstatic --noinput
I welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new branch (git checkout -b feature/your-feature).
- Make your changes and commit them (git commit -am 'Add new feature').
- Push your branch (git push origin feature/your-feature).
- Create a Pull Request with a clear description of your changes.
- Please ensure that your contributions adhere to my code style guidelines and that tests pass before submitting.
This project is licensed under the MIT License.
For questions or support, please contact Me or open an issue in the repository.