Experience the next generation of browser gaming. High-performance, low-latency, and stunning cosmic aesthetics.
About โข Technical Docs โข Quick Start โข API โข Contribute โข Request Feature
The Cosmic Neon Library Interface
Important
- Star the Repo: Your contribution only counts if you've starred the repository. โญ
- Documentation: Proper docs are required for every new feature. Share them via mail.
- Meaningful Issues: Only high-impact issues will be considered.
- Leaderboard Priority: Priority is given to contributors with lower ranks.
- ๐ก About GameHub
- โจ Features
- ๐ ๏ธ Tech Stack
- ๐ Project Structure
- ๐ Quick Start
- ๐ Environment Variables
- ๐ก API Reference
- ๐ฎ Adding New Games
- ๐ Contributing
- โจ Contributors
- ๐ License
GameHub is an elite, open-source collection of classic and modern browser games. Re-imagined with a Cosmic Blue Neon aesthetic, it combines the nostalgia of retro gaming with the performance of industry-standard web tech.
Originally a Vanilla JS project, GameHub has been upgraded to a React + Django REST Framework hybrid architecture supporting massive scalability, premium animations, a global leaderboard system, full JWT authentication, Google OAuth 2.0, PWA installability, and a password reset flow.
| Feature | Description |
|---|---|
| ๐ Modern Engine | Built with React 19 + Vite 7 for sub-millisecond responsiveness. |
| ๐จ Cosmic UI | High-end Glassmorphism and Neon design system with Framer Motion animations. |
| ๐น๏ธ 50+ Titles | Instant play library including retro classics and modern games. |
| ๐ Leaderboards | Global competition powered by a Django REST backend. |
| ๏ฟฝ Full Auth | JWT login/register + Google OAuth 2.0 (id_token flow). |
| ๐ Password Reset | Secure email-based forgot/reset password flow. |
| ๐ฑ PWA Ready | Installable as a native app on any device. Dismiss-once prompt. |
| ๐ ๏ธ Modular Code | Clean architecture designed for easy open-source contribution. |
| Tier | Technology | Notes |
|---|---|---|
| Frontend | React 19, Framer Motion | SPA with file-based routing |
| Styling | Tailwind CSS 4, Lucide Icons | Cosmic Neon design tokens |
| Backend | Django 4+ REST Framework | JWT via djangorestframework-simplejwt |
| Auth | JWT + Google OAuth 2.0 | google-auth library for id_token verification |
| State | Zustand | Persistent auth store |
| Build | Vite 7 (Ultra-fast HMR) | PWA via vite-plugin-pwa |
| API Docs | drf-spectacular | OpenAPI 3.0 + Swagger UI at /api/schema/swagger-ui/ |
GameHub/
โโโ frontend/ # React Application (Vite)
โ โโโ src/
โ โ โโโ api/ # Axios instance + JWT interceptor
โ โ โโโ components/
โ โ โ โโโ GoogleAuth/ # GoogleAuthButton (id_token flow)
โ โ โ โโโ Navbar/
โ โ โ โโโ Footer/
โ โ โ โโโ SEO/
โ โ โ โโโ PWAInstallPrompt.jsx # Smart one-time install banner
โ โ โโโ pages/ # Login, Register, Profile, Gamesโฆ
โ โ โโโ data/ # games.js registry
โ โ โโโ store/ # Zustand auth store
โ โโโ public/ # Static assets & game files
โ โโโ .env # VITE_GOOGLE_CLIENT_ID
โ โโโ vite.config.js # PWA + proxy + COOP headers
โ
โโโ backend/ # Django REST API
โ โโโ accounts/
โ โ โโโ views.py # All API endpoints incl. Google OAuth
โ โ โโโ models.py # Profile, GameScore, UserMessage
โ โ โโโ urls.py # API route definitions
โ โโโ gamehub_project/
โ โ โโโ settings.py # CORS, JWT, Google Client ID, COOP
โ โโโ .env # GOOGLE_CLIENT_ID + SECRET_KEY
โ โโโ requirements.txt
โ
โโโ DOCS.md # Technical Deep-Dive
โโโ README.md # This file
git clone https://github.com/kaifansariw/GameHub.git
cd GameHubcd frontend
npm install
# Create your .env (copy values from .env.example if present)
npm run dev
# Runs on http://localhost:5173cd backend
python -m venv venv
# Windows:
.\venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
# Runs on http://localhost:8000VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id.apps.googleusercontent.comSECRET_KEY=your_django_secret_key
DEBUG=True
GOOGLE_CLIENT_ID=your_google_oauth_client_id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your_google_oauth_client_secretTip
Get your Google OAuth credentials from console.cloud.google.com/apis/credentials.
Add http://localhost:5173 and http://localhost:8000 as an Authorized JavaScript Origin.
Full interactive docs at
http://localhost:8000/api/schema/swagger-ui/
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/auth/login/ |
โ | Login with username/email + password |
POST |
/api/auth/register/ |
โ | Create a new account |
POST |
/api/auth/google/ |
โ | Login/register via Google id_token |
POST |
/api/auth/token/refresh/ |
โ | Refresh JWT access token |
POST |
/api/auth/password-reset/ |
โ | Send reset email |
POST |
/api/auth/password-reset-confirm/ |
โ | Confirm password reset |
GET |
/api/profile/ |
โ | Get authenticated user profile |
GET |
/api/leaderboard/ |
โ | Global ranked leaderboard |
POST |
/api/add-visit/ |
โ | Record a game page visit |
POST |
/api/add-play/ |
โ | Record a game play |
POST |
/api/save-score/ |
โ | Save/update a game high score |
POST |
/api/send-feedback/ |
โ | Submit feedback |
Registering a new title in the Cosmic Library:
- Upload Assets: Place files in
frontend/public/games/<game-id>/ - Register Metadata: Edit
frontend/src/data/games.js:
{
id: "quantum-racer",
title: "Quantum Racer",
description: "Multi-dimensional racing experience.",
image: "/assets/thumbs/quantum.png",
file: "/games/quantum/index.html",
category: "racing"
}We โค๏ธ our contributors! Whether it's a bug fix or UI polish:
- Fork โ Branch (
git checkout -b feat/CoolFeature) โ Commit โ Push โ PR.
Note
Every new feature should include a brief description in DOCS.md and follow the existing code style.
The heroes behind the Cosmic Engine:
This project is licensed under the MIT License.
Maintained by Kaif Ansari & the Open Source Community