Skip to content

JohnnieBarron/MergeConflict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

249 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Merge Conflict - A CAH Joint

Merge Conflict Logo

A Django-based multiplayer card game that brings the humor of Cards Against Humanity to the world of software development. Battle your fellow developers with programming jokes, git references, and all the tech humor that makes our daily lives both hilarious and painful.


๐Ÿ“ธ Screenshots

Home Page

Home Page

Home Page Rules

Home Page Rules

Sign Up

Sign Up

Account Verification

Account Verification

Dashboard

Dashboard

Lobby

Lobby

Room List

Room List

Game Player View

Room List

Game Judge (Czar) View

Room List

Player Profile with Stats

Player Profile with Stats

Change Password

Change Password

Sign Out

Sign Out

Delete Account

Delete Account


Links

GitHub Repo

Heroku Game Link

Branded Merge Conflict Game Link


๐ŸŽฏ Project Overview

Team: 4-person General Assembly Software Engineering Bootcamp project


๐Ÿš€ Installation & Setup

Prerequisites

  • Django 5.2.3+
  • Python 3.9+
  • PostgreSQL
  • Git

Services

  • REST Against Humanity API: Card content and game data
  • Against-Humanity GitHub Repo: More card content and game data
  • Neon PostgreSQL: Database hosting
  • Heroku: Application deployment

๐Ÿง‘๐Ÿปโ€๐Ÿ”ง Production Deployment

  • Platform: Heroku
  • Database: Neon PostgreSQL
  • Static Files: Heroku static file serving
  • Environment: Production settings with DEBUG=False

๐ŸŽฎ Game Features

MVP Features (v1.0)

  • User Authentication: Register, login, logout with Django auth
  • Room Management: Create permanent rooms with 6-digit codes
  • Room Browser: Search and filter active rooms, see recent rooms based on membership
  • Multiplayer Gameplay: 3-10 players per game
  • Card System: Integration with REST Against Humanity API and GitHub sources
  • Card Pack Selection: Organized categories (Default, REST API, GitHub) with multi-select
  • Judge Rotation: Fair turn-based judging system
  • Scoring System: Track wins and game progression
  • Room Creator Controls: Kick players, edit scores, end games early
  • Profile Management: Upload avatars, edit username and profile details
  • Responsive Design: Two-column layout with mobile-friendly interface

Icebox Features (Future Releases)

  • Game history and statistics
  • Team play (multiple players as one team)
  • Friend system and social features
  • Custom card deck creation
  • Spectator mode
  • Advanced game rules and variations

๐Ÿ›  Technical Architecture

Database Design

9 Core Entities (MVP):
โ”œโ”€โ”€ User (Django built-in + custom fields)
โ”œโ”€โ”€ Room (permanent rooms with settings)
โ”œโ”€โ”€ RoomMembership (M:M join table)
โ”œโ”€โ”€ Game (1:1 with Room)
โ”œโ”€โ”€ GamePlayer (player scores and hands)
โ”œโ”€โ”€ Round (individual game rounds)
โ”œโ”€โ”€ CardSubmission (player responses)
โ”œโ”€โ”€ CardPack (card pack metadata)
โ””โ”€โ”€ Card (individual cards with pack relationship)

8 Additional Entities (Icebox):
โ”œโ”€โ”€ GameSummary (game history)
โ”œโ”€โ”€ Team & TeamMembership (collaborative play)
โ”œโ”€โ”€ Friendship (social connections)
โ”œโ”€โ”€ CustomDeck & CustomCard (user content)
โ”œโ”€โ”€ Spectator (view-only access)
โ””โ”€โ”€ Notification (social alerts)

Key Relationships

  • 1:1: Room โ†’ Game (one game per room)
  • 1:M: User โ†’ Room (creator), Game โ†’ Round, Round โ†’ CardSubmission
  • M:M: User โ†” Room (through RoomMembership)

Local Development Setup

# Clone the repository
git clone https://github.com/JohnnieBarron/MergeConflict.git
cd MergeConflict

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your database credentials

# Run migrations
python manage.py makemigrations
python manage.py migrate

# Create superuser
python manage.py createsuperuser

# Start development server
python manage.py runserver

# Optional: Import card data from additional sources
# Import cards from Against Humanity GitHub repository
python manage.py import_github_cards

Environment Variables

SECRET_KEY=your-secret-key-here
DEBUG=True
DB_USER=your-database-username
DB_PW=your-database-password
DB_HOST=your-database-host
EMAIL_HOST_USER=your-email@example.com
EMAIL_HOST_PASSWORD=your-email-password

๐ŸŽฏ MVP User Stories

Authentication & Information (4 stories)

  1. As a guest, I want to see the rules and a description of the app on the home page, so I can understand how the game works before registering. [NEW]
  2. As a guest, I want to register for an account with username and password, because I need to track my game history and join rooms.
  3. As a guest, I want to log in with my credentials, because I need to access my account and join games.
  4. As a player, I want to log out of my account, because I need to secure my session when done playing.

Room Management with Creator Permissions (10 stories)

  1. As a player, I want to create a new room with a permanent room code, because I want to host games for my friends.

  2. As a room creator, I want to set a user-selectable number of rounds for the game, because different groups prefer different game lengths. [NEW]

  3. As a room creator, I want to set a time limit (2-5 minutes) for player turns with a skip option, because games need to keep moving and handle inactive players. [NEW]

  4. As a room creator, I want to select one or more card packs from available options, because different packs provide variety and I want to customize the game content for my group.

  5. As a room creator, I want to kick disruptive players from my room, because I need to maintain a positive game environment**

  6. As a room creator, I want to delete my room when no longer needed, because permanent room codes should be cleaned up when done.

  7. As a player, I want to join a room using a room code, because I need to play with specific friends.

  8. As a player, I want to see all players currently in a room and who has joined, because I need to know who I'm playing with and ensure everyone is present. [UPDATED]

  9. As a room creator, I want to ensure all invited players are present before starting the game, because the game works best with the intended group. [NEW]

  10. As a room creator, I want to prevent new players from joining once a game is in progress, because adding players mid-game would disrupt gameplay. [NEW]

  11. As a room creator, I want to start a new game when enough players have joined, because only I should control when gameplay begins.

Core Gameplay (7 stories)

  1. As a judge, I want to see a random black card for the round, because I need to present the prompt to other players.
  2. As a player (non-judge), I want to select a white card from my hand to play, because I need to participate in the round.
  3. As a judge, I want to see all submitted white cards anonymously and pick a winner, because I need to choose the funniest response.
  4. As a player, I want to see my score update when I win a round, because I want to track my performance in the current game.
  5. As a player, I want the judge role to rotate each round, because everyone should get equal chances to judge.
  6. As a room creator, I want to edit scores if a mistake is made, because manual correction should be possible for errors. [NEW]
  7. As a room creator, I want to end the game early with a summary of results, because sometimes games need to finish before completion. [NEW]

Profile Management Features (6 stories)

  1. As a player, I want to upload an avatar/profile picture, because I want to personalize my account.
  2. As a player, I want to edit my username, because I might want to change my display name.
  3. As a player, I want to update my email address, because my contact info might change.
  4. As a player, I want to edit my first and last name, because I want to update my profile info.
  5. As a player, I want to change my password, because I need to maintain account security.
  6. As a player, I want to view my complete profile, because I want to see all my account information.

๐ŸŽจ Design & UI

Styling Framework

  • Base: Custom CSS adapted from and inspired by kay-who-codes Cards Against Humanity
  • Cards: Authentic black/white card styling
  • Layout: Responsive grid system
  • Features: Dark mode support, smooth animations

Page Structure

  1. Homepage: Guest welcome with rules and registration
  2. Dashboard: Room creation and joining interface
  3. Game Lobby: Player waiting area with settings
  4. Active Game: Real-time gameplay interface

# REST API Base URL
REST_API_URL = "https://restagainsthumanity.com/api/v2/"

# GraphQL API URL
GRAPHQL_API_URL = "https://www.restagainsthumanity.com/api/graphql"

# Available REST Endpoints
GET /packs - List available card packs
GET /cards?packs=pack1,pack2 - Get cards from specific packs
# Repository with JSON card data
# https://github.com/nodanaonlyzuul/against-humanity
# Contains cards.json with original CAH cards organized by expansion

๐Ÿ”’ Security Considerations

  • Authentication: Django's built-in secure authentication
  • Input Validation: Form validation and CSRF protection
  • Database: Parameterized queries prevent SQL injection
  • API Keys: Environment variables for sensitive data
  • Production: HTTPS, secure headers, debug disabled

๐Ÿ“ˆ Performance Optimizations

  • Card Storage: Cards stored locally in PostgreSQL database for fast access
  • Query Optimization: Database queries optimized with select_related/prefetch_related
  • Game Status Caching: 30-second cache for game state to reduce database hits
  • Bulk Operations: Card imports use bulk_create for efficiency
  • Database Indexing: Optimized queries for game operations
  • Static Files: Efficient CSS/JS delivery
  • Session Management: Lightweight game state storage

๐Ÿค Contributing

Development Workflow

  1. Branch: Create feature branch from main
  2. Develop: Write code following Django best practices
  3. Test: Ensure all functionality works correctly
  4. Review: Team code review before merging
  5. Deploy: Merge to main triggers production deployment

Code Standards

  • Python: PEP 8 compliance
  • Django: Follow Django best practices
  • Templates: Semantic HTML with accessible design
  • CSS: Organized, commented stylesheets

๐Ÿ“„ License

This project is created for educational purposes as part of the General Assembly Software Engineering Bootcamp.


๐Ÿ™๐Ÿผ Acknowledgments

๐Ÿ“ž Contact

Project Team: General Assembly Software Engineering Cohort Repository: https://github.com/JohnnieBarron/MergeConflict Live Demo: https://merge-conflict-game.herokuapp.com


Built with โค๏ธ and lots of merge conflicts by developers who understand the struggle.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors