Skip to content

feat: setup Next.js 15 project structure for Killerpool app#1

Open
AlexIDUJFNJ wants to merge 64 commits intomainfrom
claude/review-project-docs-01RTgrgz35doTh9NkLiZdCKo
Open

feat: setup Next.js 15 project structure for Killerpool app#1
AlexIDUJFNJ wants to merge 64 commits intomainfrom
claude/review-project-docs-01RTgrgz35doTh9NkLiZdCKo

Conversation

@AlexIDUJFNJ
Copy link
Owner

  • Initialized Next.js 15 with App Router and React 19
  • Configured TypeScript, TailwindCSS 4, and PostCSS
  • Created basic app structure (app/, components/, lib/)
  • Added Vercel deployment configuration
  • Setup PWA manifest for mobile installation
  • Configured dark mode as default theme
  • Added environment variables template
  • Updated README with setup instructions

Dependencies added:

  • Next.js 15, React 19, TypeScript
  • Supabase (auth & database)
  • Framer Motion (animations)
  • shadcn/ui components (CVA, clsx, tailwind-merge)
  • Lucide React icons

- Initialized Next.js 15 with App Router and React 19
- Configured TypeScript, TailwindCSS 4, and PostCSS
- Created basic app structure (app/, components/, lib/)
- Added Vercel deployment configuration
- Setup PWA manifest for mobile installation
- Configured dark mode as default theme
- Added environment variables template
- Updated README with setup instructions

Dependencies added:
- Next.js 15, React 19, TypeScript
- Supabase (auth & database)
- Framer Motion (animations)
- shadcn/ui components (CVA, clsx, tailwind-merge)
- Lucide React icons
@vercel
Copy link

vercel bot commented Nov 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
killerpool Ready Ready Preview, Comment Jan 13, 2026 10:34am

- Updated lucide-react to v0.460.0 (supports React 19)
- Set Node.js version to 20.x to avoid auto-upgrade warnings
- Added .npmrc with legacy-peer-deps for flexible dependency resolution
- Changed tailwindcss from ^4.0.0 to ^3.4.0
- Tailwind 4 requires @tailwindcss/postcss plugin which isn't production-ready
- Tailwind 3.4 is stable and works with existing PostCSS configuration
- Created detailed 3-week roadmap
- Defined all project phases and milestones
- Added technical stack documentation
- Included task checklist for tracking
- Documented best practices and architecture decisions
Setup complete Supabase integration:

Backend Infrastructure:
- Install @supabase/supabase-js and @supabase/ssr
- Remove deprecated @supabase/auth-helpers-nextjs
- Create Supabase client utilities (browser, server, middleware)
- Setup Next.js middleware for auth session management

Database Schema:
- Create initial migration (00001_initial_schema.sql)
- Define tables: player_profiles, games, rulesets
- Implement Row Level Security (RLS) policies
- Add triggers for auto-updating timestamps
- Insert default "Classic Killer Pool" ruleset

Type Safety:
- Create database.types.ts with TypeScript types
- Define interfaces for all tables and JSONB fields

Configuration:
- Update .env.local.example with detailed instructions
- Create comprehensive Supabase setup guide (supabase/README.md)
- Update main README with installation and setup steps

Files changed:
- lib/supabase/client.ts - Browser client
- lib/supabase/server.ts - Server client
- lib/supabase/middleware.ts - Middleware helper
- lib/types/database.types.ts - Database types
- middleware.ts - Next.js middleware
- supabase/migrations/00001_initial_schema.sql - Database schema
- supabase/README.md - Supabase setup guide
- .env.local.example - Environment variables template
- README.md - Updated with Supabase instructions
- package.json - Updated dependencies
- Added shadcn/ui components (Button, Card, Avatar, Badge)
- Created game components: PlayerCard, LifeBar, ActionButtons
- Implemented core game logic and types
- Added localStorage persistence for offline support
- Created Game Context for state management
- Built all main screens:
  - Home screen with resume game feature
  - New Game screen with player setup and avatar selection
  - Game screen with turn-based actions and winner celebration
  - History screen to view past games
- Fixed Next.js 15 compatibility (params as Promise, system fonts)
- Successfully built production bundle

All core MVP features working:
- 2-8 players support
- 3 starting lives
- MISS (-1), POT (0), POT BLACK (+1) actions
- Automatic winner detection
- Game history tracking
- Framer Motion animations
- Responsive mobile-first UI
- Prevent MIDDLEWARE_INVOCATION_FAILED errors when env vars are not set
- Add graceful fallback that allows app to run without crashing
- Add helpful console error messages for missing configuration
- Wrap supabase.auth.getUser() in try-catch for additional safety

This fixes the 500 error when deploying to Vercel without env vars configured.
- Add min-w-0 to prevent flex item overflow on mobile
- Use responsive padding and font sizes for input fields
- Remove 8 player limit restriction
- Update Add Player button to show current count only
Add complete authentication flow with Supabase Auth:

Features:
- Auth page with email/password and magic link options
- Profile page for user settings and management
- Protected routes via middleware
- Sign in, sign up, and guest mode support
- Session management with automatic refresh

Components:
- Input and Label UI components for forms
- Auth callback route for email confirmations
- User profile with display name editing

Technical:
- Fixed SSR/build issues with Supabase client initialization
- Added route protection in middleware
- Integrated auth state management on home page
- Automatic redirect for authenticated users

Dependencies:
- Added @radix-ui/react-label for form components

This completes Week 2, Days 10-11 of the development plan.
- Fix Sign In button mobile spacing issue (button overlapped with Killerpool title)
- Add Google OAuth authentication alongside Magic Link
- Add detailed Google OAuth setup instructions in Supabase README

Changes:
- app/page.tsx: Changed Sign In button margin from -mt-4 to mt-4 md:-mt-4 for better mobile spacing
- app/auth/page.tsx: Added handleGoogleSignIn function and "Continue with Google" button with official Google logo
- supabase/README.md: Added comprehensive Google OAuth configuration guide
- Changed auth button positioning from `mt-4 md:-mt-4` to `-mt-4`
- This prevents the button from overlapping with "Killerpool" text on mobile devices
- Button now consistently positioned above the text on all screen sizes
- Move auth button higher on home page to avoid overlapping Killerpool title
- Simplify auth page to use only modern sign-in methods (Google OAuth + Magic Link)
- Remove traditional email/password authentication
- Add placeholder for future Apple Sign In integration
Major improvements:
- Add error handling (error.tsx, loading.tsx, not-found.tsx)
- Enhance SEO with Open Graph, Twitter Cards, robots.txt, sitemap
- Create comprehensive CONTRIBUTING.md guide
- Update README.md with current project status
- Update DEVELOPMENT_PLAN.md marking Week 1 and Week 2 (Days 8-11) as complete

SEO improvements:
- Enhanced metadata with Open Graph and Twitter Card support
- Dynamic robots.txt and sitemap.xml generation
- Better keywords and structured data

Developer experience:
- Clear contributing guidelines
- Updated documentation reflecting actual state
- Better error boundaries for improved UX
Fixes the issue where syncing games with rulesetId='classic' to Supabase
would fail with error: invalid input syntax for type uuid: "classic"

The ruleset_id column in the database expects a UUID, but the game object
may contain a string identifier like "classic". Now we check if rulesetId
is a valid UUID format before syncing - if not, we set it to null in the
database while preserving all other game data.
Modified Variant A:
- First player pre-filled with current user's display name (changeable)
- Guests now have stable guest_id stored in localStorage

New Game Improvements:
- Added autocomplete for player names based on game history
- Suggestions appear while typing, showing up to 5 previous players
- Added yellow "Shuffle Players" button before Start Game
- Shuffle randomizes player order for fair starting positions

Post-Game Rematch:
- "New Game" button after game completion now reuses same players
- Previous players stored in sessionStorage for instant rematch setup
- Enables multiple rounds with same group without re-entering names

Technical Changes:
- Added getGuestId() for stable guest user identification
- Added getPlayerNamesSuggestions() to extract unique player names
- Added saveRematchPlayers()/loadRematchPlayers() for session management
- Updated game creation to use guest_id for anonymous users
- Enhanced new game page with autocomplete dropdown UI
The handleNewGame function was calling endGame() which set game to null,
triggering a useEffect redirect to home page before the navigation to
/game/new could complete. Removed the endGame() call as the new game
will replace the current one through startGame() anyway.
- Fix getGuestId() to return valid UUID instead of "guest_xxx" format
- Add validation to regenerate invalid UUIDs from old format
- Update get_leaderboard SQL function to GROUP BY user_id
- Use COALESCE(user_id, player_id) as stable identifier for grouping
- This fixes issue where one player appeared multiple times in leaderboard
- Stop overwriting display_name on every game sync - only create profile if it doesn't exist
- Assign userId only to the first player (creator), other players tracked by unique player_id
- Fixes profile name resetting to email and missing players in leaderboard
- Home page: use icon-only buttons on small screens, reduce text/padding sizes
- New Game: reduce avatar grid from 8 to 6 columns on mobile, smaller avatars
- Game page: scale down winner screen text/icons, reduce card container height
- SwipeablePlayerCard: make avatar, text, life indicators responsive
- History/Stats/Leaderboard: add responsive padding and text sizes
- All pages now use p-4 sm:p-6 padding pattern for better mobile fit
- Add Supabase fetch fallback when game not found in localStorage
- Create public RLS policy allowing anyone to view games by ID
- Enable guest users to sync completed games to Supabase
- Show proper "not found" page instead of silent redirect
…abase

Allows users to sync old games from localStorage to the cloud
so they can be shared via public links. Accessible at /sync.
- Changed default maxLives from 10 to 6 in life-bar.tsx
- Changed default maxLives from 3 to 6 in swipeable-player-card.tsx
- Changed last life color from orange to red when lives === 1
- Added red color styling for life indicators when only 1 life remains
More realistic for killer pool - typically max 5-6 lives in actual games.
Updated in:
- lib/types.ts (DEFAULT_RULESET)
- lib/game-logic.ts (fallback value)
- lib/sync.ts (default ruleset for converted games)
- app/history/[id]/page.tsx (default ruleset for loaded games)
- API.md and supabase/README.md (documentation)
- Load game from Supabase when not in localStorage
- Subscribe to realtime updates for spectators
- Show spectator banner and hide control buttons (Undo, QR, End Game)
- Display PlayerCard instead of SwipeablePlayerCard for view-only mode
- Add loading and error states for game loading
- Add spectator mode, sync page, shared links to features list
- Update default lives from 3 to 6 in rules documentation
- Add November 23 updates section with all recent changes
- Update project progress to 98% completion
- Add achievement types and definitions (10 badges with rarities)
- Create Supabase migration for user_achievements table
- Implement achievement checking logic and API functions
- Add UI components: AchievementCard, AchievementsList, AchievementToast
- Integrate achievements section into profile page
- Support progress tracking and rarity-based styling

Achievements include: First Blood, Rising Star, Veteran, Legend,
Hot Streak, Unstoppable, Survivor, Flawless Victory, Black Magic,
Party Animal
- Add achievements/badges system to completed features
- Document 7 achievement types: first_win, wins_10/25/50, survivor, pot_black_master, social_player
- Update progress to 99% completed
- Mark all Nice to Have features as completed (except Apple Sign In)
Critical security update to address CVE-2025-66478, a CVSS 10.0
remote code execution vulnerability in Next.js applications using
React Server Components.

Changes:
- Updated Next.js from 15.5.6 to 16.0.7 (patched version)
- Fixed glob dependency vulnerability (GHSA-5j98-mcp5-4vw2)
- Added turbopack config for Next.js 16 compatibility
- Verified build passes successfully

CVE Details:
- CVSS Score: 10.0 (Critical)
- Impact: Remote Code Execution (RCE)
- Affected: Next.js 13.x, 14.x, 15.x (< 15.5.7), 16.x (< 16.0.7)
- Fix: Upgrade to patched versions with hardened RSC implementation

References:
- https://nextjs.org/blog/CVE-2025-66478
- CVE-2025-55182 (upstream React vulnerability)
Merged remote branch changes while preserving critical security update
to Next.js 16.0.7 to address CVE-2025-66478 (CVSS 10.0 RCE vulnerability).

Conflict resolution:
- Kept Next.js 16.0.7 for security (was 15.0.0 in remote)
- Kept turbopack configuration for Next.js 16 compatibility
- Updated package-lock.json with secure dependencies
- Applied Next.js 16 tsconfig.json changes (jsx: react-jsx)
- Add full Next.js application code (app/, components/, lib/, hooks/)
- Include comprehensive documentation (API, Architecture, Security, etc.)
- Add configuration files for ESLint, Prettier, TypeScript, Tailwind
- Include Supabase configuration and migrations
- Add PWA setup and service worker
- Include troubleshooting guides and development plans

This commit includes the analysis of CPU consumption caused by:
- Supabase real-time WebSocket subscriptions
- Background sync manager with event listeners
- Service Worker with Workbox caching strategies
- Auth state monitoring
- Online/offline event listeners
- Updated Next.js version to 16.0.7
- Added Turbopack configuration
- Updated TypeScript JSX to react-jsx
- Merged README.md changes
- Resolved package-lock.json conflicts
Allow spectators to share game links and QR codes when viewing games
from other devices. The QR/share button is now always visible in the
game header, while the undo button remains exclusive to active players.

This enables the following workflow:
- Device A creates a game and shares QR code
- Device B scans QR code and watches the game
- Device B can now also share the game with others
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants