A professional ultramarathon coaching platform built with Next.js 15, enabling sophisticated training programs, real-time coach-runner communication, and comprehensive performance tracking.
- Framework: Next.js 15.3.5 with App Router, React 19, TypeScript 5
- Package Manager: pnpm (optimized performance and disk efficiency)
- Database: Supabase PostgreSQL with Drizzle ORM
- Authentication: Better Auth with custom session management
- State Management: Jotai atomic state management with performance optimizations
- Component Library: HeroUI with Mountain Peak Enhanced design system
- Styling: Tailwind CSS v3 with custom alpine theme
- Icons: Lucide React for consistent iconography
- Animations: Framer Motion for smooth interactions
- Testing: Vitest for unit tests, Playwright for E2E tests
- CI/CD: GitHub Actions with automated testing
- Code Quality: ESLint, Prettier, Husky pre-commit hooks
- Type Safety: 100% TypeScript with strict mode
# Clone the repository
git clone https://github.com/your-username/ultracoach.git
cd ultracoach
# Install dependencies
pnpm install
# Set up environment
cp .env.local.example .env.local
# Start development environment
supabase start # Start database (requires Docker)
pnpm dev # Start Next.js dev server
# Open http://localhost:3001- Node.js 18+ (recommend 20+)
- pnpm package manager
- Docker Desktop for local database
- Git for version control
# Install pnpm globally
npm install -g pnpm
# Install Supabase CLI
npm install -g supabase
# Verify installations
node --version # Should be 18+
pnpm --version # Should be 8+
docker --version # Docker Desktop should be running# Clone the repository
git clone https://github.com/your-username/ultracoach.git
cd ultracoach
# Install dependencies
pnpm install
# Copy environment template
cp .env.local.example .env.localEdit .env.local with your configuration:
# Database (local Supabase)
DATABASE_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres
# Authentication
BETTER_AUTH_SECRET=your-secret-here # Generate with: openssl rand -hex 32
# Email (optional for local dev)
RESEND_API_KEY=your-resend-key
RESEND_FROM_EMAIL=noreply@yourdomain.com# Terminal 1: Start Supabase (database, auth, storage)
supabase start
# Terminal 2: Run database migrations
supabase db reset
# Terminal 3: Start Next.js development server
pnpm dev- Application: http://localhost:3001
- Supabase Studio: http://localhost:54323
- API Documentation: http://localhost:3001/api
Supabase local development commands:
# Core database operations
supabase start # Start all Supabase services
supabase stop # Stop all services
supabase status # Check service status
# Database operations
supabase db reset # Reset database with migrations and seed data
supabase db seed # Re-run seed data only
supabase db push # Push local migrations to remote
supabase db pull # Pull remote schema changes
# Development utilities
pnpm run db:backup # Backup user data (legacy script)
pnpm run dev:local # Start both Supabase and Next.js in parallelThe project includes comprehensive test data for development:
- Coach Account:
emma@ultracoach.dev - Runner Accounts:
alex.rivera@ultracoach.dev,riley.parker@ultracoach.dev
Test credentials are managed securely through environment variables and CI/CD configuration.
- Multiple Training Plans: Various ultra distances (50K, 50M, 100K, 100M)
- 19 Real Races: Western States, Leadville, UTMB, Hardrock, etc.
- Workout Templates: Base building, speed work, long runs, recovery
- Sample Messages: Coach-runner communication examples
# Create test users for local development
export $(grep -v '^#' .env.local | xargs) && pnpm tsx scripts/testing/create-playwright-test-users.ts
# Run comprehensive database seed
pnpm tsx scripts/database/comprehensive-seed.tsThe project uses modern code quality tools with automatic formatting:
- ES2023 (ES14) support with modern JavaScript features
- Next.js rules with TypeScript integration
- Prettier integration for consistent formatting
- Custom rules for better developer experience
- Semi-colons: Disabled (modern style)
- Quotes: Single quotes preferred
- Print width: 100 characters
- Tab width: 2 spaces
- Trailing commas: ES5 compatible
For optimal development experience, add these VS Code settings:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}pnpm dev # Start Next.js development server (port 3001)
pnpm dev:local # Start both Supabase and Next.js together
pnpm dev:db # Start only Supabase servicespnpm test # Run Vitest tests in watch mode
pnpm test:run # Run Vitest tests once
pnpm playwright test # Run Playwright E2E testspnpm lint # Run ESLint
pnpm lint:fix # Run ESLint with auto-fix
pnpm format # Format code with Prettier
pnpm format:check # Check code formatting
pnpm typecheck # Run TypeScript type checking# Local development
pnpm db:connect # Connect to database via psql
pnpm db:query # Run SQL queries
pnpm db:studio # Open Drizzle Studio
pnpm db:seed # Seed database with test data
# Schema changes workflow (Drizzle generates, Supabase applies)
pnpm db:generate # Generate Drizzle migration from schema.ts
pnpm db:migrate:local # Apply migrations locally (supabase migration up)
pnpm db:push # Push schema directly (prototyping only)
# Production
pnpm prod:db:migrate # Apply migrations to production (supabase db push)pnpm build # Build for production
pnpm start # Start production server- Advanced Authentication: Better Auth with role-based access and session management
- Real-time Communication: Coach-runner chat with typing indicators and message synchronization
- Comprehensive Training Plans: Race-centric planning with periodization and phase progression
- Strava Integration: OAuth flow, bi-directional sync, and performance metrics analysis
- Mountain Peak Design: Professional alpine-themed UI with HeroUI components
- Advanced State Management: Jotai atomic patterns with performance optimization
- Coach Dashboard: Athlete management, progress tracking, and performance analytics
- Runner Dashboard: Training plan overview, workout tracking, and progress visualization
- Relationship Management: Flexible coach-runner connections with invitation system
- Workout Management: Detailed workout logging, completion tracking, and progress analysis
- Race Targeting: Goal-oriented training plans built around specific ultramarathon events
- Zero TypeScript Errors: Full type safety with strict mode enforcement
- Zero ESLint Warnings: Clean, maintainable codebase with modern patterns
- Production Database: Comprehensive relationships and data integrity
- Mobile-Optimized: Responsive design with touch-friendly interactions
- Real-time Updates: Sub-second latency with error resilience and graceful fallbacks
- β Core Platform Complete: All essential features implemented
- β Type Safety: 100% TypeScript with zero errors
- β Test Coverage: Comprehensive unit and E2E tests
- β CI/CD Pipeline: Automated testing on all PRs
- π Active Development: Performance optimizations and feature enhancements
- Completed comprehensive codebase reorganization
- Implemented advanced Jotai state management patterns
- Integrated Strava OAuth with bi-directional sync
- Built real-time messaging with typing indicators
- Achieved zero ESLint warnings and TypeScript errors
ultracoach/
βββ src/
β βββ app/ # Next.js App Router pages
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities and configurations
β βββ providers/ # React context providers
β βββ types/ # TypeScript type definitions
βββ scripts/
β βββ auth/ # Authentication scripts
β βββ database/ # Database operations
β βββ debug/ # Debug utilities
β βββ migration/ # Database migrations
β βββ strava/ # Strava integration
β βββ testing/ # Test utilities
βββ supabase/
β βββ migrations/ # Database schema migrations
β βββ seed.sql # Database seed data
βββ tests/ # Playwright E2E tests
βββ public/ # Static assets
We welcome contributions! Please see CLAUDE.md for development guidelines and detailed setup instructions.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions or changeschore: Maintenance tasks
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js by Vercel
- UI components from HeroUI
- Database powered by Supabase
- Authentication by Better Auth
- State management with Jotai
Made with β€οΈ for the ultrarunning community