A battle log and tournament tracking application for Pokemon TCG and Pokemon Pocket players.
- Battle Log Tracking: Record and analyze your Pokemon TCG Live matches
- Tournament Management: Track tournament results, rounds, and placements
- Pokemon Pocket Support: Log Pokemon Pocket matches and tournaments
- Statistics & Analytics: View win rates, matchup data, and performance trends
- Dark Mode: Full dark mode support
- Mobile Responsive: Works on all devices
- Framework: Next.js 14 (App Router)
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth with SSR cookies
- UI: Radix UI + Tailwind CSS
- State Management: Recoil + SWR
- Deployment: Vercel
- Node.js 18+
- npm or yarn
- Supabase project
-
Clone the repository:
git clone https://github.com/jlgrimes/training-court.git cd training-court -
Install dependencies:
npm install
-
Set up environment variables:
cp .env.local.example .env.local
Update
.env.localwith your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your-supabase-url NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key SUPABASE_SERVICE_ROLE_KEY=your-supabase-service-role-key NEXT_PUBLIC_SITE_URL=http://localhost:3000 -
Run the development server:
npm run dev
Password recovery uses a Supabase email token confirmation route at /auth/confirm. To exercise the flow while running the app locally:
- Keep
.env.localpointed at the Supabase project you want to test, and set:NEXT_PUBLIC_SITE_URL=http://localhost:3000
- In that Supabase project's Auth URL configuration, allow
http://localhost:3000/auth/callback. - Start the app with
npm run dev, request a reset from/forgot-password, and open the delivered email. - Enter and confirm a new password. The app signs out the recovery session and returns to login so the new password can be verified immediately.
For cross-device reset links, set the Supabase recovery email template link to {{ .SiteURL }}/auth/confirm?token_hash={{ .TokenHash }}&type=recovery&next=/reset-password. For production, set NEXT_PUBLIC_SITE_URL=https://trainingcourt.app in the deployed app and configure the matching Supabase site URL and redirect URLs.
├── app/ # Next.js App Router pages
│ ├── home/ # Main dashboard
│ ├── ptcg/ # Pokemon TCG routes
│ ├── pocket/ # Pokemon Pocket routes
│ └── api/ # API routes
├── components/ # React components
├── hooks/ # Custom React hooks
├── lib/ # Utilities
│ └── server/ # Server-side utilities
└── docs/ # Documentation
See docs/ARCHITECTURE.md for detailed architecture documentation.
- Server-Side Data Fetching: The home page fetches all data server-side for instant loading
- Parallel Queries: Multiple database queries run in parallel for performance
- Hybrid Client/Server: Components can receive server-fetched data while supporting client-side updates
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run test # Run testsContributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.