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.
- 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.
- 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.
Backend: Python, Django, PostgreSQL, OpenAI API Frontend: HTML, CSS, JavaScript, Particles.js
- Clone the repository:
git clone https://github.com/Ghosts6/DjangoGameHub.git cd DjangoGameHub - Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate - Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.envfile in thegame/game/directory. - Add your PostgreSQL database configuration.
- Add your OpenAI API key:
OPENAI_API_KEY='your_openai_api_key_here'
- Create a
- Run database migrations:
python game/manage.py migrate
- Create a superuser (optional):
python game/manage.py createsuperuser
- Run the development server:
The application will be available at
python game/manage.py runserver
http://127.0.0.1:8000/.
