A multiplayer social deduction game built with React, TypeScript, and Socket.io. Experience real-time gameplay with stunning 3D graphics powered by Three.js and React Three Fiber. (Yes, it's as cool as it sounds!)
- Features
- Tech Stack
- Project Structure
- Getting Started
- Development
- Electron.js Desktop Application
- Environment Variables
- Roadmap & Planned Features
- Contributing
- License
- 🎯 Real-time Multiplayer - Powered by Socket.io for seamless multiplayer experience (lag optional, based on your WiFi)
- 🎨 3D Graphics - Immersive gameplay with Three.js and React Three Fiber (fancy words for "it looks pretty")
- 🔐 Authentication System - Secure user authentication (no password = no entry, sorry hackers)
- 🏠 Lobby System - Create, join, and manage game lobbies (like a virtual waiting room, but fun)
- 💬 Real-time Chat - In-lobby chat functionality (trash talk responsibly)
- 🎮 Multiple Games - Support for various game types (currently just one, but I'm optimistic!)
- 📱 Responsive Design - Works across different screen sizes (yes, even on your ancient tablet)
- ⚡ Fast Development - Built with Vite for lightning-fast HMR (Hot Module Replacement, not some new sandwich)
- 🖥️ Desktop Application - Native desktop app built with Electron (because browsers are so 2020)
- 📦 Cross-Platform - Available as web app or native desktop application for Windows, macOS, and Linux (I don't discriminate against operating systems)
- Framework: React 18.2 with TypeScript
- Build Tool: Vite 7.3
- Desktop Framework: Electron.js (Electron Vite integration)
- 3D Graphics: Three.js, React Three Fiber, React Three Drei
- Physics: React Three Rapier
- Routing: React Router DOM 7.11
- State Management: Zustand, React Context API
- Real-time Communication: Socket.io Client
- Styling: Tailwind CSS (via utilities), Custom CSS
- UI Components: Radix UI, Lucide React
- Runtime: Node.js (>=20.x)
- Language: TypeScript
- Framework: Express.js
- Real-time: Socket.io 4.8
- Development: tsx (TypeScript executor)
Dream-Game/
├── Dream-Game/ # Client application
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── assets/ # Game assets (models, textures, styles)
│ │ ├── components/ # React components
│ │ │ ├── auth/ # Authentication components
│ │ │ ├── loading/ # Loading screens
│ │ │ ├── pages/ # Page components
│ │ │ └── ui/ # UI components
│ │ ├── contexts/ # React contexts
│ │ ├── core/ # Core game logic
│ │ ├── features/ # Game features
│ │ │ └── games/ # Individual game implementations
│ │ ├── types/ # TypeScript type definitions
│ │ └── utils/ # Utility functions
│ ├── electron/ # Electron main process files
│ │ ├── main.ts # Electron main process entry
│ │ └── preload.ts # Preload script
│ ├── build/ # Build resources
│ │ └── icons/ # Application icons for desktop
│ ├── .env.example # Environment variables template
│ ├── package.json
│ ├── tsconfig.json
│ ├── vite.config.ts # Web app Vite config
│ └── electron.vite.config.ts # Electron Vite config
│
├── Dream-Server/ # Server application
│ ├── src/
│ │ ├── index.ts # Main server file
│ │ ├── lobbies.ts # Lobby management
│ │ └── rooms.ts # Room management
│ ├── .env.example # Environment variables template
│ ├── package.json
│ └── tsconfig.json
│
├── .gitignore
├── .gitattributes
├── LICENSE
└── README.md
Before you dive in, make sure you have:
- Node.js (>= 20.x) - The latest and greatest, not that dusty v14 you installed in 2021
- npm or yarn - Pick your poison
- Git - For pretending you know how to use version control
- A sense of adventure - Things might break, but that's half the fun!
-
Clone the repository
git clone https://github.com/Jerald-Golden/Dream-Game.git cd Dream-Game -
Install Client Dependencies
cd Dream-Game npm install -
Install Server Dependencies
cd ../Dream-Server npm install -
Set up Environment Variables
Copy the
.env.examplefiles and configure them:# In Dream-Game directory cp .env.example .env # In Dream-Server directory cd ../Dream-Server cp .env.example .env
Edit the
.envfiles with your configuration. -
Start the Development Servers
Time to fire up this bad boy! You'll need TWO terminals (I know, multitasking is hard).
Terminal 1 - Start the Server:
cd Dream-Server npm startTerminal 2 - Start the Client:
cd Dream-Game npm run dev -
Open your browser
Navigate to
http://localhost:3000and pray everything works! 🤞
cd Dream-Game
# Start web development server (browser-based)
npm run dev
# Build web app for production
npm run build
# Preview production build
npm run preview
# Format code
npm run formatcd Dream-Game
# Start Electron app in development mode
npm run electron:dev
# Build Electron app for current platform
npm run electron:build
# Build for Windows
npm run electron:build:win
# Build for macOS
npm run electron:build:mac
# Build for Linux
npm run electron:build:linux
# Preview Electron production build
npm run electron:previewNote: The project supports both web and desktop modes. Use npm run dev for web development (boring old browser) and npm run electron:dev for desktop application development (fancy native app). Choose your fighter! ⚔️
cd Dream-Server
# Start development server with watch mode
npm start
# Build TypeScript
npm run build
# Format code
npm run formatThe Dream Game client has been built as a hybrid application using Electron Vite, supporting both web browser and native desktop platforms.
The application uses a unified codebase that can run in two modes:
- Web Mode (
npm run dev) - Runs in browser with Vite dev server - Desktop Mode (
npm run electron:dev) - Runs as native Electron application
- Native Desktop Experience - Full native window controls and OS integration
- Offline Capable - Desktop app can work with cached resources
- Enhanced Performance - Direct access to system resources
- Auto-Updates - Built-in support for application updates (when configured)
- Custom Icons - Platform-specific application icons in
build/icons/
electron/
├── main.ts # Main process (Node.js environment)
└── preload.ts # Preload script (bridge between main and renderer)
- Main Process: Manages application lifecycle, windows, and system integration
- Renderer Process: The React application running in Chromium
- Preload Script: Securely exposes APIs from main to renderer process
When you build the Electron app, it creates platform-specific installers:
- Windows:
.exeinstaller and portable executable - macOS:
.dmgdisk image and.appbundle - Linux:
.AppImage,.deb, or.rpmpackages
Build artifacts are located in Dream-Game/dist-electron/ and Dream-Game/out/.
electron.vite.config.ts- Electron-specific Vite configurationpackage.json- Containsbuildsection for electron-builder settingsbuild/icons/- Application icons for different platforms
VITE_DREAMSERVER_URL=https://dream-game.onrender.comPORT=2567
NODE_ENV=production
ALLOWED_ORIGINS=https://dream-games.netlify.app
VITE_SUPABASE_URL=your-supabase-project-url
VITE_SUPABASE_ANON_KEY=your-supabase-anon-keySee .env.example files in each directory for complete configuration options.
Here's what's cooking in the Dream Game kitchen (send help):
-
Visual Map Builder Tool 🛠️
- Create a new project that spits out R3F
.tsxfiles for maps - Why? Because I don't know and don't wanna know how to use Blender
- Life's too short for 3D modeling software with 47 keyboard shortcuts
- Just drag, drop, and pray it works
- Create a new project that spits out R3F
-
Game Overhaul: "The Floor is Lava" 🔥
- Yeeting the entire "Among Us" clone out the window
- Replacing it with something way cooler: The Floor is Lava
- Because who doesn't love pretending the floor is lava?
- Nostalgia meets 3D gaming chaos
-
Stick Figure Character 🏃
- Creating a character that looks like a stick man
- Simple, elegant, definitely not because I can't model realistic humans
- It's a design choice, okay?
- Plus they're adorable
- Stay Focused 🎯
- DO NOT GET DISTRACTED while doing the above things
- No "just one more feature" energy
- No opening 17 YouTube tutorials at once
- Seriously... FOCUS.
- (This is the hardest task on this entire list)
This roadmap is 100% real and definitely not just organized procrastination. Check back for updates... if I don't get distracted!
Contributions are welcome! Please feel free to submit a Pull Request. (Yes, even if you think your code is "not good enough" - we've all been there!)
- Fork the project (that button up there
↗️ ) - Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request (and cross your fingers 🤞)
This project is licensed under the MIT License - see the LICENSE file for details. (TL;DR: Do whatever you want, but don't blame me if it breaks! 😅)
- Socket.io for real-time communication (because WebSockets are magic 🪄)
- Stack Overflow for saving my life at 3 AM
- Coffee ☕ - The true MVP
- Me, Myself and I (solo dev life hits different 💪)
Want to roast my code or suggest features? Hit me up!
Email: jeraldgolden00@gmail.com
Project Link: https://github.com/Jerald-Golden/Dream-Game
Made with ❤️ (and lots of debugging 🐛) by the Dream Game Team (population: 1)