A real-time multiplayer Bridge card game built with Next.js 15, Socket.io, and PostgreSQL.
- ♠ ♥ Real-time multiplayer Bridge gameplay ♦ ♣
- ACBL-compliant rules and scoring
- Private game rooms with invite codes
- User authentication and profiles
- Responsive design for all devices
- Frontend: Next.js 15 (App Router), React 19, Tailwind CSS
- Backend: Next.js API Routes, Socket.io for real-time
- Database: PostgreSQL with Prisma ORM
- Authentication: NextAuth.js v5
- Node.js 18+ installed
- PostgreSQL database
- Clone the repository:
git clone <your-repo-url>
cd BridgeOnline- Install dependencies:
npm install- Set up environment variables:
cp .env.example .envEdit .env and add your database connection string and other required values.
- Set up the database:
npx prisma db push
npx prisma generate- Run the development server:
npm run devOpen http://localhost:3000 to see the application.
BridgeOnline/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ ├── dashboard/ # Dashboard page
│ ├── login/ # Login page
│ ├── register/ # Registration page
│ └── globals.css # Global styles
├── components/ # React components
├── lib/ # Utilities and configuration
│ ├── game/ # Game logic (deck, bidding, scoring, playing)
│ ├── auth.ts # NextAuth configuration
│ └── db.ts # Prisma client
├── prisma/ # Database schema
├── server/ # Socket.io server
├── types/ # TypeScript type definitions
└── docs/ # Project documentation
├── design-document.md # Architecture and system design
└── testing-guide.md # Testing layers and setup
All project documentation lives in docs/:
- Design Document — architecture, data model, real-time design
- Testing Guide — unit, integration, E2E, and WebRTC test setup
- Register/Login: Create an account or log in
- Create Room: Start a new game room and get an invite code
- Invite Friends: Share the invite code with 3 friends
- Bidding: Players bid to establish the contract
- Playing: Try to win tricks to fulfill your contract
- Scoring: Points awarded based on ACBL rules
- Run development server:
npm run dev - Build for production:
npm run build - Start production server:
npm start - Database migrations:
npx prisma db push - View database:
npx prisma studio
ISC