A modern, AI-powered CrossFit workout generator built with Next.js, TypeScript, and PostgreSQL. Create personalized workouts based on your fitness level, equipment availability, and training goals.
- 🤖 AI-Powered Workouts: Generate personalized CrossFit WODs using OpenAI
- 🔐 User Authentication: Secure login and registration system
- 📊 Progress Tracking: Monitor your fitness journey and workout history
- 🏋️ Equipment Flexible: Workouts adapt to gym, home, or bodyweight-only training
- 📱 Responsive Design: Works perfectly on desktop and mobile devices
- 🎯 Preset WODs: Access to classic CrossFit benchmark workouts
- ⚙️ Profile Management: Customize your experience based on fitness level and preferences
- Frontend: Next.js 15, React 18, TypeScript
- Styling: Tailwind CSS with custom components
- Authentication: NextAuth.js with credentials provider
- Database: PostgreSQL with Prisma ORM
- AI Integration: OpenAI API for workout generation
- Deployment: Optimized for Vercel
- Node.js 18+ and npm
- PostgreSQL database
- OpenAI API key
git clone <repository-url>
cd wodify-app
npm installCreate a .env.local file in the root directory:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/wodify_db?schema=public"
# NextAuth.js
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="your-nextauth-secret-key-here"
# OpenAI API
OPENAI_API_KEY="your-openai-api-key-here"
# Email (for password reset, optional)
EMAIL_SERVER_HOST="smtp.gmail.com"
EMAIL_SERVER_PORT=587
EMAIL_SERVER_USER="your-email@gmail.com"
EMAIL_SERVER_PASSWORD="your-app-password"
EMAIL_FROM="your-email@gmail.com"-
Install PostgreSQL and create a database named
wodify_db -
Run Prisma migrations:
npx prisma migrate dev --name init- Seed the database with preset WODs:
npx tsx prisma/seed.tsnpx prisma generatenpm run devOpen http://localhost:3000 in your browser.
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpx prisma studio- Open Prisma Studio to view databasenpx prisma migrate dev- Create and apply database migrationsnpx tsx prisma/seed.ts- Seed database with preset WODs
wodify-app/
├── src/
│ ├── app/ # Next.js App Router
│ │ ├── api/ # API routes
│ │ ├── auth/ # Authentication pages
│ │ ├── dashboard/ # User dashboard
│ │ └── ...
│ ├── components/ # React components
│ │ ├── ui/ # Reusable UI components
│ │ └── providers/ # Context providers
│ ├── lib/ # Utility libraries
│ └── types/ # TypeScript type definitions
├── prisma/ # Database schema and migrations
└── public/ # Static assets
- Email/password authentication with NextAuth.js
- Secure password hashing with bcrypt
- Session management with JWT tokens
- Integration with OpenAI GPT-3.5-turbo
- Context-aware workout generation based on user profile
- Equipment and location-specific modifications
- Users: User profiles and authentication data
- PresetWods: Pre-defined CrossFit workouts (Fran, Cindy, Murph, etc.)
- GeneratedWods: AI-generated workouts for users
- UserProgress: Workout completion tracking
- WodSections: Structured workout components
- Fran: Classic thruster and pull-up benchmark
- Cindy: Bodyweight AMRAP workout
- Murph: Hero WOD with running and bodyweight movements
- Home Bodyweight Blast: Equipment-free home workout
- Garage Gym Power: Limited equipment strength workout
- Add the WOD data to
prisma/seed.ts - Run
npx tsx prisma/seed.tsto populate the database
Edit the prompt in src/app/api/wod/generate/route.ts to customize workout generation logic.
The app uses Tailwind CSS with custom components. Modify styles in:
src/app/globals.cssfor global stylessrc/components/ui/for component-specific styles
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
npm run build
npm run start- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support, please create an issue in the GitHub repository or contact the development team.
Built with ❤️ for the CrossFit community