A comprehensive multiplayer party game platform featuring Discord authentication, AI-generated content, and real-time gameplay across multiple game types.
Looking for deployment requirements?
- โก Requirements Summary - Quick reference guide (start here!)
- ๐ Website Deployment Requirements - Complete guide for deploying on a website (Vercel, Railway, VPS, etc.)
- ๐ท Vercel Deployment Guide - Step-by-step Vercel deployment with environment variables
- ๐ Railway Deployment Guide - Deploy to Railway (recommended for WebSocket support)
- ๐จ Render Deployment Guide - Deploy to Render (great free tier)
- ๐ฎ Discord Activity Requirements - Guide for Discord Activity implementation (future enhancement)
Other Documentation:
- ๐ค Vercel AI Gateway Guide - Multi-provider AI integration with automatic failover
- ๐ AI Gateway Examples - Ready-to-use configurations for different scenarios
- ๐ Integration Guide - TiltCheck and JustTheTip integration details
- ๐ Deployment with Integrations - Deploy with optional integrations
- ๐ฑ Discord Activities Analysis - Why Discord Activities aren't currently implemented
- Secure login via Discord
- User session management
- Avatar and username integration
- Development mode for testing (bypass authentication)
- Create and join games directly from Discord
- Slash commands for game management
- Real-time game notifications via DM
- Bridge between Discord and web interface
- Cards Against Humanity-style gameplay
- AI-generated question and answer cards
- Card Czar rotation system
- Real-time card submission and judging
- Configurable rounds and scoring
- Classic deception game with modern twist
- AI-generated prompts and categories
- Scoring system based on successful deception
- Multiplayer voting and revelation phases
- Traditional poker gameplay
- Betting rounds and pot management
- Hand evaluation and winner determination
- Fold/Call/Raise mechanics
- Multi-Provider Support: Unified interface to OpenAI, Anthropic, Google, and xAI models
- Automatic Failover: Seamless provider switching if one is unavailable
- Cost Tracking: Real-time monitoring and configurable spending limits
- Dynamic Card Generation: AI-powered card creation via multiple providers
- Context-Aware Content: Theme-based generation for personalized experiences
- Intelligent Fallback: Curated content available if all AI providers are down
- See Vercel AI Gateway Integration for details
- WebSocket-based real-time communication
- Game state synchronization
- Live chat during games
- Player presence and status updates
- Responsive design for desktop and mobile
- Dark theme with neon accents
- Smooth animations and transitions
- Intuitive game controls and feedback
- TiltCheck - Player behavior monitoring for responsible gaming
- JustTheTip - Cryptocurrency tipping with Solana smart contracts
- Non-custodial wallet support
- Real-time balance queries and transaction tracking
- See INTEGRATIONS.md for full details
๐ For comprehensive deployment requirements, see WEBSITE_REQUIREMENTS.md
This section provides a quick start guide. For detailed requirements, configuration options, and troubleshooting, refer to the complete requirements documentation.
- Node.js 16+
- Discord Developer Application (for OAuth and Bot)
- OpenAI API Key (optional, fallback content available)
- Clone the repository:
git clone <repository-url>
cd DegensAgainstDecencyCardBot- Install dependencies:
npm install- Configure environment variables:
cp .env.example .envEdit .env with your configuration:
# Discord OAuth Configuration
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_CLIENT_SECRET=your_discord_client_secret
DISCORD_CALLBACK_URL=http://localhost:3000/auth/discord/callback
# Discord Bot Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token
# Session Configuration
SESSION_SECRET=your_super_secret_session_key
# Server Configuration
PORT=3000
NODE_ENV=development
# AI Card Generation (optional - defaults to degenscardbot.vercel.app)
CARD_GENERATOR_URL=https://degenscardbot.vercel.app/api/generate
OPENAI_API_KEY=your_openai_api_key- Start the server:
npm start- Visit
http://localhost:3000to begin!
- Go to Discord Developer Portal
- Create a New Application
- OAuth2 Setup:
- Go to OAuth2 โ General
- Add redirect URI:
http://localhost:3000/auth/discord/callback - Copy Client ID and Client Secret to your
.envfile
- Bot Setup:
- Go to Bot section
- Create a Bot
- Copy Bot Token to your
.envfile asDISCORD_BOT_TOKEN - Enable necessary bot permissions (Send Messages, Use Slash Commands)
- Install Bot to Server:
- Go to OAuth2 โ URL Generator
- Select scopes:
bot,applications.commands - Select permissions: Send Messages, Use Slash Commands
- Use generated URL to add bot to your Discord server
- Login: Use Discord OAuth to authenticate
- Arena: Browse available games or create a new one
- Configure: Choose game type, max players, and privacy settings
- Play: Join games and enjoy real-time multiplayer action!
Use these slash commands in any Discord server where the bot is installed:
-
/create-game- Create a new Discord game- type: Choose game type (Degens Against Decency, 2 Truths and a Lie, Poker)
- max-players: Set maximum players (3-7, optional)
- private: Make game private (optional)
-
/list-games- View all available public Discord games -
/join-game- Join a game by ID- game-id: The game ID to join
-
/start-game- Start a game (creator only)- game-id: The game ID to start
-
/game-status- Check your current game status
Note: All games are played directly in Discord for a seamless experience!
- Players: 3-8 recommended
- Rounds: 10 rounds (configurable)
- Gameplay: Submit funniest answer card to match the question
- Scoring: Card Czar picks winning submission
- AI: Generates fresh question and answer cards
- Players: 3+ (more is better)
- Rounds: Based on number of players
- Gameplay: Create believable lies, guess others' lies
- Scoring: Points for correct guesses and successful deception
- AI: Provides creative prompts and categories
- Players: 2-8
- Rounds: Single hand completion
- Gameplay: Traditional poker betting and hand evaluation
- Scoring: Winner takes the pot
- Features: Blinds, betting rounds, fold/call/raise
- Framework: Express.js with Socket.IO
- Authentication: Passport.js with Discord strategy
- Session Management: Express-session
- Real-time: WebSocket connections
- AI Integration: OpenAI API for content generation
- Vanilla JavaScript: No framework dependencies
- CSS3: Modern styling with CSS Grid and Flexbox
- WebSocket Client: Real-time game state updates
- Responsive Design: Works on desktop and mobile
- Modular Architecture: Base game class with specialized implementations
- State Management: Centralized game state with real-time sync
- Player Management: Session-based player tracking
- AI Content: Dynamic content generation with fallbacks
DegensAgainstDecencyCardBot/
โโโ server.js # Main server file
โโโ package.json # Dependencies and scripts
โโโ .env.example # Environment template
โโโ src/
โ โโโ GameManager.js # Central game management
โ โโโ AICardGenerator.js # AI content generation
โ โโโ games/
โ โโโ BaseGame.js # Base game class
โ โโโ DegensAgainstDecencyGame.js
โ โโโ TwoTruthsAndALieGame.js
โ โโโ PokerGame.js
โโโ public/
โโโ index.html # Landing page
โโโ arena.html # Game lobby
โโโ game.html # Game interface
โโโ styles/
โ โโโ main.css # Global styles
โ โโโ game.css # Game-specific styles
โโโ scripts/
โโโ auth.js # Authentication handling
โโโ arena.js # Lobby functionality
โโโ game.js # Game client logic
Set NODE_ENV=development to enable:
- Bypass Discord authentication
- Demo user for testing
- Enhanced error logging
- Create game class extending
BaseGame - Implement required methods:
initializeGame(),handleAction(),getGameState() - Add game renderer in
game.js - Register in
GameManager.js
GET /- Landing pageGET /arena- Game lobby (auth required)GET /game/:gameId- Game interface (auth required)GET /api/user- Current user infoGET /api/games- List public gamesPOST /api/games- Create new gameGET /auth/discord- Discord OAuth initiationGET /auth/discord/callback- OAuth callbackGET /auth/logout- Logout
join-lobby- Join game lobbyjoin-game- Join specific gameleave-game- Leave current gamegame-action- Send game-specific actionchat-message- Send chat messagegame-update- Receive game state updateslobby-games- Receive lobby game list
- Modify
/public/styles/main.cssfor global styling - Game-specific styles in
/public/styles/game.css - CSS custom properties for easy color scheme changes
- Adjust prompts in
AICardGenerator.js - Configure content generation parameters
- Add fallback content collections
- Modify scoring systems in individual game classes
- Adjust round limits and player counts
- Customize game flow and phases
Choose your preferred deployment platform - all support WebSockets and real-time multiplayer:
Fly.io provides excellent always-on hosting with great WebSocket support, perfect for running the Discord bot.
Quick start:
- Install Fly CLI:
curl -L https://fly.io/install.sh | sh - Login:
flyctl auth login - Deploy:
flyctl launch(follow prompts) - Set Discord Bot Token (REQUIRED for bot to come online):
flyctl secrets set DISCORD_BOT_TOKEN=your_bot_token_here flyctl secrets set SESSION_SECRET=$(openssl rand -hex 32) flyctl secrets set NODE_ENV=production
- For Supabase integration (optional):
flyctl secrets set SUPABASE_URL=your_supabase_url flyctl secrets set SUPABASE_ANON_KEY=your_anon_key flyctl secrets set SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
- Redeploy:
flyctl deploy
Important: The Discord bot will only come online if DISCORD_BOT_TOKEN is set. Get your token from the Discord Developer Portal โ Your Application โ Bot โ Token.
Railway offers the best free tier with always-on instances and full WebSocket support.
๐ See detailed Railway deployment guide
Quick start:
- Visit railway.app and sign in with GitHub
- Click "New Project" โ "Deploy from GitHub repo"
- Select this repository
- Add environment variables (at minimum:
NODE_ENV=production,SESSION_SECRET) - Deploy! Your app will be live at
https://your-app.railway.app
Render provides a generous free tier (with cold starts after 15min inactivity).
๐ See detailed Render deployment guide
Quick start:
- Visit render.com and sign up with GitHub
- Click "New +" โ "Web Service"
- Connect repository:
jmenichole/DegensAgainstDecency - Configure: Build
npm install, Startnpm start - Add environment variables and deploy!
Vercel works great but note that WebSocket support has some limitations.
๐ See detailed Vercel deployment guide
Quick start:
- Fork/clone this repository to your GitHub account
- Visit Vercel and sign in with GitHub
- Click "New Project" and import this repository
- Add environment variables in Vercel Dashboard โ Settings โ Environment Variables
- Required:
NODE_ENV=production,SESSION_SECRET(generate with:node -e "console.log(require('crypto').randomBytes(32).toString('hex'))") - Optional: Discord OAuth credentials, OpenAI API key, etc.
- Required:
- Deploy!
- Update Discord OAuth redirect URI to match your Vercel domain
Important: Environment variables must be configured in Vercel Dashboard after initial deployment. See DEPLOYMENT_VERCEL.md for complete setup instructions.
The app also works on:
- Heroku: Add Procfile with
web: node server.js - DigitalOcean App Platform: Configure as Node.js app
- Traditional VPS: Use PM2 process manager with nginx reverse proxy
Required:
NODE_ENV=production
SESSION_SECRET=<generate-with-crypto-randomBytes>Optional (Discord features):
DISCORD_CLIENT_ID=your_discord_client_id
DISCORD_CLIENT_SECRET=your_discord_client_secret
DISCORD_CALLBACK_URL=https://yourdomain.com/auth/discord/callback
DISCORD_BOT_TOKEN=your_discord_bot_tokenOptional (AI features):
OPENAI_API_KEY=your_openai_api_keyGenerate SESSION_SECRET with: npm run generate-secret
Problem: Can't login or signup
Solutions:
-
Check if Discord OAuth is configured
- The app works in guest mode without Discord OAuth
- Visit
/arenadirectly to use guest mode - If Discord OAuth fails, check your environment variables
-
Verify Discord Application Setup
- Ensure
DISCORD_CLIENT_IDandDISCORD_CLIENT_SECRETare set - Confirm redirect URI matches your deployment URL
- Check that your Discord app has the correct OAuth scopes
- Ensure
-
Session Secret
- Make sure
SESSION_SECRETis set in environment variables - Generate a secure secret for production
- Make sure
Problem: "Failed to create game" or "Failed to retrieve games"
Solutions:
- Check browser console for specific error messages
- Verify the server is running (check Vercel logs or server logs)
- Ensure all required environment variables are set
- Try refreshing the page and clearing browser cache
Problem: "Unable to connect to server" or WebSocket failures
Solutions:
- On Vercel: WebSocket support is limited, consider alternative hosting
- Check CORS: Ensure your deployment allows WebSocket connections
- Firewall: Check if WebSocket ports are blocked
- Browser Console: Look for specific connection errors
Problem: Build fails or app doesn't start
Solutions:
- Run
npm installto ensure dependencies are installed - Run
npm run buildlocally to test - Check Node.js version (requires 16+)
- Review Vercel build logs for specific errors
- Ensure
vercel.jsonis present in repository root
Problem: Can't access app without Discord login
Solutions:
- Navigate directly to
/arenainstead of home page - Check that
NODE_ENVis properly set - Clear browser cookies and try again
- Check server logs for authentication errors
We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes: Ensure code follows the existing style
- Test locally: Run
npm startand test your changes - Update documentation: If you add features, update the README
- Submit a pull request: Describe your changes clearly
Please read our Contributing Guide for detailed guidelines and Code of Conduct for community standards.
For security issues, see our Security Policy.
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright (c) 2024 Degens Against Decency. All rights reserved.
Made by degens for degens โค๏ธ Special thanks to:
- Discord for OAuth integration
- OpenAI for AI content generation
- Socket.IO for real-time communication
- The original Cards Against Humanity creators
- WebSocket support on Vercel is limited (use Railway/Heroku for better real-time features)
- Mobile UI could be optimized further
- AI content rate limiting not implemented
- In-memory session storage (use Redis for production scale)
passport-discordpackage is deprecated (still functional, but consider migrating to maintained alternatives likediscord-strategyorpassport-discord-authin future updates)
- User statistics and game history
- Tournament mode and brackets
- Custom card creation and sharing
- More game types (Charades, Pictionary, etc.)
- Voice chat integration
- Advanced AI personality modes
- Mobile app development
Ready to party? Start your Degens Against Decency arena now! ๐ฎ๐