{"id":28271193,"url":"https://github.com/rouic/pyramid.ninja","last_synced_at":"2026-02-26T00:48:05.998Z","repository":{"id":38761153,"uuid":"88264938","full_name":"Rouic/pyramid.ninja","owner":"Rouic","description":"A digital version of the popular drinking game \"pyramid\" built with Firebase. Live version can be found at https://pyramid.ninja.","archived":false,"fork":false,"pushed_at":"2025-04-06T20:23:33.000Z","size":33748,"stargazers_count":2,"open_issues_count":23,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T18:23:43.513Z","etag":null,"topics":["drinking-game","firebase","firestore","game","ninja","pyramid"],"latest_commit_sha":null,"homepage":"https://pyramid.ninja","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rouic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-14T12:15:08.000Z","updated_at":"2025-04-04T15:50:53.000Z","dependencies_parsed_at":"2023-02-08T17:01:10.409Z","dependency_job_id":null,"html_url":"https://github.com/Rouic/pyramid.ninja","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Rouic/pyramid.ninja","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rouic%2Fpyramid.ninja","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rouic%2Fpyramid.ninja/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rouic%2Fpyramid.ninja/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rouic%2Fpyramid.ninja/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rouic","download_url":"https://codeload.github.com/Rouic/pyramid.ninja/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rouic%2Fpyramid.ninja/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29846209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drinking-game","firebase","firestore","game","ninja","pyramid"],"created_at":"2025-05-20T18:20:16.542Z","updated_at":"2026-02-26T00:48:05.992Z","avatar_url":"https://github.com/Rouic.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎮 Pyramid.Ninja\n\nAn engaging multiplayer card game leveraging realtime Firebase and Next.js for a fluid gaming experience.\n\n## 🚀 Tech Stack\n\n- **Frontend**: Next.js (React) with TypeScript\n- **Styling**: TailwindCSS with custom game-themed extensions\n- **Database**: Firebase Firestore (realtime)\n- **Authentication**: Firebase Auth\n- **Deployment**: Vercel\n\n## 🎯 Game Overview\n\nPyramid.Ninja is a digital implementation of the classic drinking card game \"Pyramid\" (also known as \"Ride the Bus\"). It's designed for social gameplay where players gather around a virtual table and take turns.\n\n### 📋 Game Rules\n\n1. **Setup**: \n   - The game builds a pyramid of cards (typically 5 rows)\n   - Each player receives 4 cards that only they can see\n   - Players memorize their cards before the game starts\n\n2. **Gameplay**:\n   - The host reveals cards from the pyramid one at a time\n   - If a player has a matching card in their hand, they can assign drinks\n   - Other players can challenge if they think someone is bluffing\n   - The number of drinks assigned depends on the row of the pyramid (higher rows = more drinks)\n\n3. **Challenges**:\n   - If a challenge is successful, the challenged player drinks\n   - If a challenge fails, the challenger drinks\n   - When challenged or after assigning drinks, players must replace the card they used\n\n## 🗂️ Project Structure\n\n```\npyramid.ninja/\n├── public/          # Static assets, images, sounds\n├── src/\n│   ├── components/  # React components\n│   │   ├── layout/  # Layout components (Header, Footer, etc)\n│   │   └── ...      # Game-specific components\n│   ├── contexts/    # React context providers\n│   ├── hooks/       # Custom React hooks\n│   ├── lib/         # Utilities and Firebase interactions\n│   │   └── firebase/ # Firebase setup and database functions\n│   ├── pages/       # Next.js pages\n│   │   └── game/    # Game-related pages\n│   ├── styles/      # Global CSS and styling\n│   └── types/       # TypeScript type definitions\n├── legacy/          # Old codebase (reference only)\n```\n\n## 🛣️ Common Code Paths\n\n### Game Creation \u0026 Joining\n\n1. `/src/pages/host.tsx` - Host creates a new game\n2. `/src/pages/join.tsx` - Players join with game code\n3. `/src/pages/game/[id].tsx` - Main game screen (dynamic route with game ID)\n\n### Game Logic\n\n1. `/src/lib/firebase/gameState.ts` - Game state management\n2. `/src/lib/firebase/gameCards.ts` - Card-related operations\n3. `/src/contexts/GameContext.tsx` - Game context provider for sharing state\n\n### UI Components\n\n1. `/src/components/GamePyramid.tsx` - Renders the pyramid of cards\n2. `/src/components/PlayerHand.tsx` - Manages player's hand of cards\n3. `/src/components/GameControls.tsx` - Game control buttons\n4. `/src/components/DrinkAssignmentPanel.tsx` - Handles assigning drinks\n\n## 🚦 State Management\n\nThe game uses a combination of:\n\n- **Firebase Firestore**: For persistent, realtime game state shared between players\n- **React Context**: For local state management and component communication\n- **React Hooks**: For component-level state and Firebase subscription management\n\nKey state includes:\n- Game phase (waiting, memorizing, playing, ended)\n- Player information and readiness status\n- Card positions and visibility\n- Drink assignments and challenges\n\n## 🔄 Data Flow\n\n1. **Host Creates Game**: \n   - Generates unique game ID\n   - Configures game settings\n   - Creates initial Firestore document\n\n2. **Player Joins Game**:\n   - Adds player to the game's player list\n   - Subscribes to realtime updates\n\n3. **Game Flow**:\n   - Host deals cards to players\n   - Players memorize their cards\n   - Host reveals pyramid cards\n   - Players assign/receive drinks and challenge\n   - Cards are replaced until pyramid is complete\n\n## 🔧 Development Commands\n\n```bash\n# Install dependencies\nnpm install\n\n# Run development server\nnpm run dev\n\n# Build for production\nnpm run build\n\n# Run production server\nnpm run start\n\n# Run ESLint\nnpm run lint\n```\n\n## 📱 Responsive Design\n\nThe game is designed for multiple devices:\n- **Desktop**: Full layout with card dragging and standard sizing\n- **Tablet**: Adjusted layout with optimized card positioning\n- **Mobile**: Compact view with 2x2 grid for cards in portrait mode\n\nSpecific mobile optimizations include:\n- Reduced control panel sizes\n- Optimized spacing for smaller screens\n- Touch-friendly card interactions\n- Responsive typography with smaller sizes on mobile\n\n## 🧩 Key Components\n\n### GameCard\n\nThe base card component with:\n- Flip animations\n- Drag functionality\n- Visual indicators for new/revealed cards\n- Challenge and selection states\n\n### GamePyramid\n\nRenders the pyramid structure with:\n- Row-based organization\n- Card reveal animations\n- Visual indicators for current row/card\n\n### PlayerHand\n\nManages the player's cards with:\n- Draggable positioning\n- Responsive grid layout on mobile\n- Card memorization and reveal capabilities\n\n## 🔒 Security Model\n\n- Game access is controlled by game IDs\n- Player actions are validated server-side\n- Firebase security rules prevent unauthorized access\n- Client-side validation complements server-side rules\n\n## 🎨 Styling Approach\n\n- Custom TailwindCSS configuration with game-specific colors\n- Card-themed design system inspired by Balatro\n- CSS variables for consistent theming\n- Responsive design with Tailwind's responsive prefixes (xs:, sm:, md:, etc.)\n- Animation system for cards and UI elements\n\n## 🌐 Deployment\n\nThe project is configured for deployment on Vercel with:\n- Automatic preview deployments for PRs\n- Production branch deployment\n- Environment variable configuration\n\n## 🚀 Future Enhancements\n\n- Additional game modes\n- More customization options\n- Enhanced mobile experience\n- Persistent user profiles","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frouic%2Fpyramid.ninja","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frouic%2Fpyramid.ninja","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frouic%2Fpyramid.ninja/lists"}