TourVault - Golf Performance OS
An AI-native data environment and performance operating system for elite golfers and their teams.
Features
- Quick Round Logging - Log rounds in under 3 minutes via voice or text
- AI-Powered Analysis - Automatic extraction of moment cards, insights, and patterns
- Vault Storage - Upload and organize videos, scorecards, documents, and data files
- Tournament Packs - Generate personalized PDF preparation guides
- Practice Plans - AI-generated practice schedules based on your performance
- Team Collaboration - Share with coaches and caddies, comments and approvals
- AI Assistant - Ask questions about your golf data with citations
Tech Stack
- Framework: Next.js 16 (App Router) + TypeScript
- Styling: Tailwind CSS
- Database: PostgreSQL + Prisma 7 ORM
- Auth: NextAuth.js (Auth.js)
- Storage: S3-compatible (AWS S3, Cloudflare R2, MinIO)
- Job Queue: BullMQ + Redis
- AI: OpenAI-compatible API (GPT-4, Claude, etc.)
Getting Started
Prerequisites
- Node.js 20+
- PostgreSQL database
- Redis (for job queue)
- S3-compatible storage (or use local adapter for development)
Installation
- Clone the repository:
git clone <repository-url>
cd tourvault
- Install dependencies:
npm install
- Set up environment variables:
cp .env.example .env
Configure your
.envfile with:DATABASE_URL- PostgreSQL connection stringNEXTAUTH_SECRET- Generate withopenssl rand -base64 32REDIS_URL- Redis connection stringOPENAI_API_KEY- For AI features (optional for stub mode)- S3 credentials (optional for local development)
Set up the database:
npx prisma migrate dev
- Run the development server:
npm run dev
- (Optional) Run the job worker in a separate terminal:
npm run worker
Open http://localhost:3000 to see the app.
Environment Variables
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/tourvault"
# Auth
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# Redis (for job queue)
REDIS_URL="redis://localhost:6379"
# AI Provider
OPENAI_API_KEY="sk-..." # Optional - uses stub without it
# Storage (S3-compatible) - Optional for local dev
S3_ENDPOINT="http://localhost:9000"
S3_REGION="us-east-1"
S3_BUCKET="tourvault"
S3_ACCESS_KEY_ID="minioadmin"
S3_SECRET_ACCESS_KEY="minioadmin"
# OCR Provider (stub, google-vision, aws-textract)
OCR_PROVIDER="stub"
# Speech-to-Text Provider (stub, openai-whisper)
STT_PROVIDER="stub"
Project Structure
src/
├── app/ # Next.js App Router pages
│ ├── (auth)/ # Auth pages (login, signup)
│ ├── (dashboard)/ # Authenticated pages
│ └── api/ # API routes
├── components/ # React components
│ ├── ui/ # Base UI components
│ ├── layout/ # Layout components
│ └── [feature]/ # Feature-specific components
├── lib/ # Core libraries
│ ├── auth/ # Authentication
│ ├── db/ # Prisma client
│ ├── storage/ # S3 storage adapter
│ ├── jobs/ # BullMQ job queue
│ ├── ai/ # AI provider and prompts
│ └── parsers/ # OCR, transcription, documents
├── domain/ # Domain services
└── types/ # TypeScript types and Zod schemas
Key Pages
/- Landing page (redirects to dashboard if logged in)/login- Sign in/signup- Create account/dashboard- Main dashboard with recent rounds/rounds/new- Log a new round/rounds/[id]- Round detail with moment cards/vault- File vault and asset management/tournaments- Tournament workspaces/plans- Practice plans/assistant- AI chat assistant/team- Team management and invitations/settings- User settings
Development
Running the worker
The job worker processes background tasks like transcription, OCR, and AI analysis:
npm run worker
# or
npx ts-node src/lib/jobs/worker.ts
Database migrations
# Create a new migration
npx prisma migrate dev --name your_migration_name
# Apply migrations in production
npx prisma migrate deploy
# Reset database (development only)
npx prisma migrate reset
Prisma Studio
View and edit your database:
npx prisma studio
Architecture
Multi-tenancy
All data is scoped to teams. Every query includes teamId filtering, and RBAC checks are performed server-side.
Asset Pipeline
- Upload - File uploaded to S3, Asset record created
- Parse - OCR/text extraction via background job
- Link - Asset linked to domain objects (Round, Tournament, etc.)
AI Processing
- Transcription - Voice recordings transcribed via Whisper
- Round Parsing - Transcript parsed into structured data
- Moment Cards - Key moments extracted from transcript
- Insights - Patterns and recommendations generated
All AI outputs are validated with Zod schemas and retried on failure.
User Roles
- PLAYER - Creates rounds, uploads assets, completes plans
- COACH - Reviews, comments, approves plans
- CADDIE - Views tournament packs, comments on strategy
- STAFF - Team admin for college programs
License
Private - All rights reserved
