A Next.js application for managing your BoardGameGeek collection with collaborative game picking features.
- Syncs your BGG collection using the official XML API v2
- Displays game covers, titles, year, player count, and playtime
- Responsive grid layout (6 columns on desktop, 2 on mobile)
- Print-optimized CSS with proper page breaks
- Real-time collaborative game sessions with Socket.IO
- Multiple collection support
- BGG_TOKEN: A BoardGameGeek API token is required. Register an application at BoardGameGeek to obtain one.
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env.local # Edit .env.local and add your BGG_TOKEN -
Set up the database:
npx prisma migrate dev
Run the development server:
npm run devOpen http://localhost:3000 to view your collection.
Build for production:
npm run build
npm startdocker pull ghcr.io/blackjid/board-game-collection:latestdocker run -d \
--name board-game-geek \
-p 3000:3000 \
-v bgg-data:/data \
-e BGG_TOKEN=your-token-here \
ghcr.io/blackjid/board-game-collection:latestThis will:
- Start the app on port 3000
- Persist the SQLite database in a Docker volume called
bgg-data - Automatically run database migrations on startup
| Variable | Default | Description |
|---|---|---|
BGG_TOKEN |
required | BoardGameGeek XML API v2 bearer token |
DATA_PATH |
/data |
Directory for the SQLite database |
DATABASE_URL |
file:/data/games.db |
SQLite database connection string |
PORT |
3000 |
Port the server listens on |
NEXT_PUBLIC_BASE_URL |
(auto-detected) | Base URL for share links and QR codes (e.g., https://games.example.com). Required for collaborative sessions when testing on other devices. |
SESSION_EXPIRY_DAYS |
30 |
Auth session lifetime in days. Uses sliding expiration — sessions renew automatically on activity. |
When building the Docker image, you can set the base URL:
docker build --build-arg NEXT_PUBLIC_BASE_URL=https://games.example.com -t my-bgg-app .For local network testing (e.g., testing on your phone):
NEXT_PUBLIC_BASE_URL=http://192.168.1.100:3000 npm run devMount a host directory instead of a Docker volume:
docker run -d \
--name board-game-geek \
-p 3000:3000 \
-v /path/to/your/data:/data \
-e BGG_TOKEN=your-token-here \
ghcr.io/blackjid/board-game-collection:latestdocker logs -f board-game-geekdocker stop board-game-geek
docker rm board-game-geek- Open the site in your browser
- Click "Print Collection" or press
Ctrl+P/Cmd+P - The print styles will hide navigation and optimize the grid for paper
The BGG username is configured via the Settings page in the app. Navigate to /settings to set your BoardGameGeek username and other options.
├── app/
│ ├── page.tsx # Main collection grid page
│ ├── layout.tsx # Root layout with metadata
│ └── globals.css # Styles including print CSS
├── components/
│ └── GameCard.tsx # Individual game card component
├── lib/
│ ├── bgg/ # BGG API client (XML API v2)
│ ├── games.ts # Game data access layer
│ ├── sync.ts # BGG collection sync logic
│ └── prisma.ts # Database client
├── prisma/
│ └── schema.prisma # Database schema
└── types/
└── game.ts # TypeScript interfaces
- Next.js 16 - React framework
- Tailwind CSS v4 - Styling
- Prisma - Database ORM (SQLite)
- Socket.IO - Real-time communication
- TypeScript - Type safety