https://github.com/ghosts6/djangogamehub
web project to host some game like snake game ,flappy bird ,chrome dino game and tic tac toe with help of django and frontend
https://github.com/ghosts6/djangogamehub
css django django-orm django-rest-framework html5 js json python3
Last synced: about 2 months ago
JSON representation
web project to host some game like snake game ,flappy bird ,chrome dino game and tic tac toe with help of django and frontend
- Host: GitHub
- URL: https://github.com/ghosts6/djangogamehub
- Owner: Ghosts6
- Created: 2024-02-02T23:08:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-27T17:28:31.000Z (over 1 year ago)
- Last Synced: 2025-01-16T01:49:21.575Z (over 1 year ago)
- Topics: css, django, django-orm, django-rest-framework, html5, js, json, python3
- Language: JavaScript
- Homepage:
- Size: 797 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# 🌐DjangoGameHub :
This is the source code for a web platform hosting a collection of classic and AI-powered games. Built with Django and PostgreSQL for robust backend performance, and a dynamic frontend using HTML, CSS, and JavaScript. Players can enjoy classic arcade games like Snake, Flappy Bird, Tic-Tac-Toe, and Chrome's Dinosaur Game, compete on leaderboards, and challenge an AI in the new Akinator game.
## 🎮 Games Included:
* **Snake Game:** Navigate the snake, eat food, and grow without hitting walls or yourself. Compete for high scores.
* **Flappy Bird:** Test your reflexes by guiding a bird through a series of pipes.
* **Tic-Tac-Toe:** A classic two-player game.
* **Chrome's Dinosaur Game:** Jump over obstacles in an endless runner.
* **Akinator (AI-Powered):** Think of a character, and the Akinator (powered by OpenAI) will try to guess it by asking a series of questions.
## ✨ Features:
* **User Authentication:** Login/Register system for personalized experience.
* **Guest Play:** Play games without needing to register.
* **Leaderboards:** Track and compare high scores across different games.
* **Modern UI/UX:** Engaging and responsive design for a smooth gaming experience.
* **AI Integration:** Akinator game leverages OpenAI for intelligent guessing.
## 🚀 Technologies Used:
Backend: Python, Django, PostgreSQL, OpenAI API
Frontend: HTML, CSS, JavaScript, Particles.js
      
## ⚙️ Setup and Installation:
1. **Clone the repository:**
```bash
git clone https://github.com/Ghosts6/DjangoGameHub.git
cd DjangoGameHub
```
2. **Create a virtual environment and activate it:**
```bash
python -m venv venv
source venv/bin/activate
```
3. **Install dependencies:**
```bash
pip install -r requirements.txt
```
4. **Set up environment variables:**
* Create a `.env` file in the `game/game/` directory.
* Add your PostgreSQL database configuration.
* Add your OpenAI API key: `OPENAI_API_KEY='your_openai_api_key_here'`
5. **Run database migrations:**
```bash
python game/manage.py migrate
```
6. **Create a superuser (optional):**
```bash
python game/manage.py createsuperuser
```
7. **Run the development server:**
```bash
python game/manage.py runserver
```
The application will be available at `http://127.0.0.1:8000/`.
## 🎬 Demo:
[Demo.webm](https://github.com/user-attachments/assets/01c084d7-cb3e-46f3-a35e-2e648e665d18)