Installation
This guide will help you set up BodyWorks on your local machine for development and customization.Prerequisites
Before installing BodyWorks, ensure you have the following installed:Node.js
BodyWorks requires Node.js 18 or higher.We recommend using Node.js 20 LTS for the best compatibility and performance.
Bun (recommended)
BodyWorks uses Bun as the preferred package manager for faster installs and better performance.Clone the repository
Get the BodyWorks source code from GitHub:Install dependencies
Install all required packages using your preferred package manager:- Next.js 15 - React framework with server components
- React 19 - UI library
- TypeScript - Type safety
- @tanstack/react-query - Data fetching and caching
- Shadcn UI components - Pre-built accessible components
- Tailwind CSS 4 - Utility-first CSS framework
- Motion (Framer Motion) - Animation library
- Axios - HTTP client for API calls
- Lucide React - Icon library
Installation with Bun is significantly faster than npm, typically completing in under 30 seconds.
Environment setup
BodyWorks connects to the Body Works API to fetch exercise and routine data. The API endpoint is already configured in the codebase.API configuration
The application uses axios for API calls. The base configuration is located in the hooks directory:hooks/useExercises.tsx- Fetches exercise datahooks/useBodyParts.tsx- Fetches body part categorieshooks/useEquipments.tsx- Fetches equipment typeshooks/useTargetMuscles.tsx- Fetches target muscle groups
Optional environment variables
If you want to customize the application, you can create a.env.local file in the root directory:
.env.local
Run the development server
Start the local development server:“Push yourself harder to become better”
The first load may take a few seconds while Next.js compiles the pages. Subsequent changes will be reflected instantly thanks to Turbopack.
Build for production
To create an optimized production build:Project structure
Understanding the codebase organization:Verify installation
Confirm everything is working correctly:Check the homepage
Navigate to
http://localhost:3000 and verify the hero section loads with the headline and call-to-action button.Test exercises page
Click “Explore for free” or navigate to
/exercises. You should see exercise cards loading from the API.Test filtering
Navigate to
/body-parts, /equipments, or /target-muscle and verify that categories load correctly.Troubleshooting
Port already in use
If port 3000 is already in use, Next.js will automatically try port 3001. You can also specify a custom port:Module not found errors
If you encounter module errors, try cleaning the installation:TypeScript errors
If you see TypeScript errors, ensure you’re using TypeScript 5+:API connection issues
If exercises aren’t loading:- Check your internet connection
- Verify the Body Works API is accessible
- Check the browser console for error messages
- Ensure React Query is properly configured in
app/providor.tsx
Next steps
Now that you have BodyWorks running locally:Component architecture
Learn about the application architecture and component structure.
Customize the UI
Modify styles, themes, and components to match your brand.
API integration
Understand the Body Works API and how data flows through the app.
UI library
Explore the Shadcn UI components used throughout the app.