A mobile-first web application for tracking wins and losses in competitive matches between friends. Built entirely as a vibe-coded project.
Wintracker allows users to maintain records of their competitive match results against various opponents. Users can create accounts, add opponents, and track their win/loss statistics over time. The application supports editing match history, managing opponent lists, and provides a clean interface for viewing performance data.
- User Registration/Login: Enter name to create new account or access existing account
- Opponent Management: Add new opponents to track matches against
- Match Tracking: Record wins and losses for each opponent
- Data Management: Edit match results, update opponent names, delete records
- History Viewing: Review complete match history and statistics
- Component Structure: React functional components with TypeScript interfaces
- State Management:
- Global user state managed by Zustand store
- Server state managed by TanStack Query for caching and synchronization
- Data Flow: Unidirectional data flow with custom hooks for database operations
- UI Components: Mantine component library with custom styling
- Internationalization: i18next for multi-language support
- Routing: URL-based user persistence without traditional routing
- Database: PostgreSQL hosted on Neon (serverless)
- Tables:
users: User accounts with unique namesmatches: Win/loss records linked to users and opponents
- Relationships: Foreign key constraints between users and matches
- Indexes: Optimized queries with indexes on user_id and opponent names
- Data Integrity: Unique constraints and check constraints for data validation
- Connection Management: Singleton pattern for database initialization
- Query Abstraction: Dedicated query modules for users and matches
- Type Safety: TypeScript interfaces for all data structures
- Error Handling: Comprehensive error management with user feedback
- Validation: Input sanitization and validation utilities
- Clone the repository
- Install dependencies:
npm install - Set up environment variables in
.env.local(see.env.templatefor reference) - Run development server:
npm run dev