Skip to content

carsonxdd/gamenight

Repository files navigation

Caplan's Game Night

A web app for organizing gaming communities. Sign up with Discord, pick your games, set your availability, RSVP to game nights, build teams, and run tournament brackets.

Live at pvpers.us

Features

  • Scheduling — Friday-to-Thursday calendar, event creation with mod approval, recurring events, RSVP (confirmed/maybe/declined), post-event attendance tracking
  • Tournaments — 6 bracket types (single elim, double elim, round robin, Swiss, constellation, FFA), solo or team, live snake draft, pick'ems, templates
  • Teams — persistent rosters with tags, roles (captain/co-captain/member/sub), invite system, tournament registration
  • Polls — single/multi-select voting, comments, pinning
  • Badges & Streaks — 18 achievement badges, attendance streaks, weekly activity streaks, showcased badges on member cards
  • Discord Notifications — auto-posts for events/tournaments/polls/new members, manual announcement templates with live preview
  • Profiles — games, competitive ranks, availability grid, social links, timezone-aware display
  • Admin Panel — game popularity, availability heatmap, player roster, 8 analytics queries, audit log, badge management, site settings
  • Site Settings — accent color theming, feature toggles, branding, join modes (open/invite-only/approval), event/poll/tournament/team controls
  • Roles — Owner, Admin, Moderator, Member with role-appropriate permissions throughout

Tech Stack

  • Next.js 16 (App Router, Server Components, Server Actions)
  • TypeScript (strict mode)
  • Tailwind CSS v4 (dark neon theme with configurable accent color)
  • Prisma (SQLite)
  • NextAuth.js (Discord OAuth, JWT sessions)
  • Framer Motion (animations)
  • Vitest (testing)

Getting Started

Prerequisites

Setup

# Install dependencies
npm install

# Create .env file
cp .env.example .env

Fill in your .env:

DATABASE_URL="file:./dev.db"
DISCORD_CLIENT_ID="your-client-id"
DISCORD_CLIENT_SECRET="your-client-secret"
NEXTAUTH_SECRET="your-secret"
NEXTAUTH_URL="http://localhost:3000"

Discord OAuth redirect URL should be http://localhost:3000/api/auth/callback/discord.

# Set up the database
npx prisma db push

# Start dev server
npm run dev

Open http://localhost:3000.

First Admin

Open Prisma Studio and set isAdmin and isOwner to true on your user:

npx prisma studio

After that, use the Admin Panel's Roster tab to manage roles.

Seed Data (optional)

npx tsx prisma/seed-test-users.ts    # 15 users, 20 events, 6 teams, 8 polls, 7 tournaments
npx tsx prisma/seed-badges.ts        # 18 badge definitions
npx tsx prisma/backfill-badges.ts    # Award badges + compute streaks for existing users

The test users script uses upsert on seeded users and scoped cleanup (only deletes records tagged [Seed]) — re-running refreshes event dates without wiping your real data. Dev only; never run on production.

Dev-only: Fast User Switching

Visit http://localhost:3000/dev-login to sign in as any seeded user without Discord OAuth. Useful for testing role-specific views (admin, mod, captain, member). The page returns 404 and the credentials provider is physically absent when NODE_ENV === "production".

Tests

npm test

Deployment

Hosted on a Raspberry Pi with a Cloudflare Tunnel. The database (SQLite) is not in git — deploys don't touch user data.

# On the Pi
git pull
npm run build
# Restart the process

Community

Join the Discord: discord.gg/3fyMmcSf4C

Version History

v1.0.4 — 2026-04-23

  • Navbar: Admin link hidden by default; reveals via 2-second hover on your profile name (desktop only), with all nav items sliding to make room
  • Tournament drafts: skip route revalidation on mid-draft picks — near-instant picks in dev instead of 1-2 minute recompiles
  • Dev utility: /dev-login page for quick user switching without Discord OAuth (dev-only, gated on NODE_ENV)

v1.0.3 — 2026-04-05

  • Fix attendance streak: use history-based calculation so streaks correctly break on no-shows

v1.0.2 — 2026-03-22

  • Fix roster availability timezone display (was showing raw UTC days)

v1.0.1 — 2026-03-13

  • Admin rank management (lock, override, unlock with audit trail)

v1.0 — 2026-03-12

  • Badges & Streaks (18 badges, attendance/weekly streaks, admin management)
  • Discord Notifications (dual-channel webhooks, auto-posts, announcement templates)
  • Tabbed profile layout, expandable changelog, last seen on roster
  • Bugfixes (11:30 PM heatmap slot, stale cache after profile save, 2 AM time window)

v0.9.0 — 2026-03-12

  • Audit log, activity feed, last seen tracking, mobile responsiveness pass

v0.8.x — 2026-03-12

  • Feedback system (suggestions + bug reports), mute system, FAQ, privacy tightening

v0.7.x — 2026-03-12

  • Site settings expansion (branding, feature toggles, join modes, accent colors)
  • Conditional save buttons, accent color SSR fix

v0.6.0 — 2026-03-11

  • Admin settings panel, prime/extended time windows, timezone-aware legends, seed data, Vitest

v0.5.0 — 2026-03-09

  • Persistent teams, team tags, timezone normalization

v0.4.0 — 2026-03-07

  • Tournament system (6 bracket types, drafts, pick'ems), calendar redesign, event detail modal

v0.3.0 — 2026-03-06

  • Members page, polls, roles, user-created events, invite-only events, admin insights, about page

v0.2.0 — 2026-03-05

  • Discord auth, profiles, scheduling, admin panel, landing page

v0.1.0 — 2026-03-04

  • Initial scaffold

Credits

Built by Carson Caplan — see carsoncaplan.com for more projects.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages