A full-stack workout generator application built with React, TypeScript, Express, and PostgreSQL. Displays a personalized weekly workout schedule with detailed exercise information.
- 📅 Weekly workout schedule (Monday - Sunday)
- 🏋️ Detailed exercise breakdowns with sets, reps, and rest times
- 💪 Mix of strength training, HIIT, cardio, and recovery days
- 🎨 Modern, responsive UI with smooth animations
- 📱 Mobile-friendly design optimized for phone browsers
- 🔄 Toggle between daily and weekly views
- 🚀 Auto-seeding database on deployment (no manual setup needed)
- 🔐 User Authentication with Auth0
- ⏱️ Live Workout Timer - track your entire workout duration
- ✅ Exercise Tracking - tap exercises to log completed sets
- 📊 Progress Tracking - save your workout history per user
- 🎯 Smart Alternatives - only complete one option from alternative exercises
- 🎉 Completion Screen - celebrate when you finish your workout
- 💾 User-Specific Data - each user's progress is saved separately
- React 18
- TypeScript
- Vite
- CSS3 with custom properties
- Auth0 React SDK (
@auth0/auth0-react) - React Hot Toast for notifications
- Deployed on Vercel
- Node.js
- Express
- TypeScript
- PostgreSQL
- Auth0 JWT Middleware (
express-oauth2-jwt-bearer) - Deployed on Render
- Monday: Lower Body Strength + 20min HIIT
- Tuesday: Upper Body Strength + Core
- Wednesday: Steady State Cardio (Walking/Peloton)
- Thursday: Lower Body Strength + Glute Focus
- Friday: Upper Body Strength + 20min HIIT
- Saturday: Long Run (4-5 miles)
- Sunday: Rest Day / Yoga
- Node.js (v20.11.0 or higher recommended)
- PostgreSQL (v14 or higher)
- npm or yarn
- Auth0 account (free tier available)
Important: See AUTH0_SETUP.md for detailed Auth0 configuration instructions.
Quick summary:
- Create an Auth0 account at auth0.com
- Create a Single Page Application
- Create an API
- Configure callback URLs and environment variables
-
Install PostgreSQL if you haven't already
-
Create a new database:
createdb workout_generator
-
Create a
.envfile in theserverdirectory:DATABASE_URL=postgresql://username:password@localhost:5432/workout_generator PORT=3000 AUTH0_DOMAIN=your-domain.auth0.com AUTH0_AUDIENCE=https://workout-generator-api
-
Create a
.envfile in theclientdirectory:VITE_AUTH0_DOMAIN=your-domain.auth0.com VITE_AUTH0_CLIENT_ID=your-client-id VITE_AUTH0_AUDIENCE=https://workout-generator-api VITE_API_URL=http://localhost:3000
-
Install server dependencies:
cd server npm install -
Install client dependencies:
cd ../client npm install
Note: The database will automatically seed with workout data when the server starts for the first time. No manual seeding required!
-
Start the server (from
serverdirectory):npm run dev
-
Start the client (from
clientdirectory, in a new terminal):npm run dev
-
Open your browser to
http://localhost:5173
cd client
npm run buildcd server
npm run build
npm startThis app is currently deployed at:
- Frontend (Vercel): [Your Vercel URL]
- Backend (Render): [Your Render URL]
Frontend (Vercel)
- Deployed from the
clientdirectory - Automatically rebuilds on push to main branch
- CORS configured to accept requests from Vercel preview URLs
Backend (Render)
- Deployed from the
serverdirectory - PostgreSQL database included
- Auto-seeds database on first startup
- No manual database setup required!
Backend on Render:
- Go to Render
- Create a new PostgreSQL database
- Create a Web Service:
- Connect your GitHub repository
- Root directory:
server - Build command:
npm install && npm run build - Start command:
npm start - Add environment variable:
DATABASE_URL(auto-populated from PostgreSQL)
- Database will auto-seed on first deployment ✨
Frontend on Vercel:
- Go to Vercel
- Import your repository
- Configure:
- Root directory:
client - Framework preset: Vite
- Build command:
npm run build - Output directory:
dist
- Root directory:
- Add environment variable:
VITE_API_URL=your-render-backend-url - Deploy!
- Deploy PostgreSQL and server to Railway
- Deploy client to Vercel
- Update API endpoints accordingly
- Use the provided
docker-compose.yml - Deploy to any Docker-compatible hosting
GET /api/workouts- Get all workouts (one random per day)GET /api/workouts/:day- Get workout by day name (random)GET /api/workouts/today/current- Get today's workout (random)
POST /api/users/me- Create or update current userGET /api/users/me- Get current user infoPOST /api/workout-progress- Save workout progressGET /api/workout-progress/today- Get today's workout progressGET /api/workout-progress/history- Get workout history (optional limit parameter)
To customize the workouts:
- Edit the workout data in
server/src/index.ts(lines 38-173) - Clear your database:
DELETE FROM workouts; - Restart the server - it will auto-seed with your new workout data
Alternatively, you can still use the seed script:
npm run seed- Full user authentication with Auth0
- User-specific workout progress tracking
- Protected API endpoints for user data
- Automatic user profile sync with database
- Workout history saved per user
- Live workout timer - track your total workout time
- Tap-to-complete exercise tracking
- Progress bar showing workout completion
- Smart alternative exercise handling
- Celebration screen when workout is complete
- Beautiful toast notifications
- Touch-optimized UI for phone browsers
- Mobile-friendly button sizes (44px+ touch targets)
- Sticky timer that follows you while scrolling
- Responsive design that works perfectly on phones
- Users table for Auth0 user storage
- Workout progress table for tracking completed exercises
- Indexes for optimal query performance
- Foreign key relationships for data integrity
- Database automatically seeds with workout data on first server startup
- No manual database setup required for deployment
- Checks if database is empty before seeding to prevent duplicates
- CORS configured to support Vercel preview and production URLs
- Simplified deployment process with auto-initialization
- Works seamlessly with Render's PostgreSQL database
MIT
Built with 💪 for fitness enthusiasts