Installation
Set up OpenAthlete on your local machine
This guide will help you set up OpenAthlete for local development.
Prerequisites
Before you begin, make sure you have the following installed:
- Node.js v22.14.0 (use
.nvmrcfor version management) - pnpm v9.x
- PostgreSQL (for the database)
- Git
Step 1: Clone the Repository
git clone https://github.com/openathleteorg/openathlete.git
cd openathleteStep 2: Install Dependencies
pnpm installStep 3: Set Up Environment Variables
Frontend Configuration
Copy the example environment file:
cp apps/web/.env.example apps/web/.envUpdate the .env file with your configuration. At minimum, you'll need:
VITE_API_URL=http://localhost:3000Backend Configuration
Copy the example environment file:
cp apps/api/.env.example apps/api/.envUpdate the .env file with your database connection and other settings:
DATABASE_URL="postgresql://user:password@localhost:5432/openathlete"
JWT_SECRET="your-secret-key"Step 4: Build Shared Packages
pnpm shared buildStep 5: Set Up the Database
Run database migrations:
pnpm database run db:deployOr for development with migrations:
pnpm database run db:migrate devStep 6: Start Development Servers
Start both frontend and backend:
pnpm devThis will start:
- Frontend at
http://localhost:5173 - Backend API at
http://localhost:3000
Verify Installation
- Open your browser to
http://localhost:5173 - You should see the OpenAthlete login page
- Create an account or log in
Troubleshooting
Database Connection Issues
Make sure PostgreSQL is running:
# macOS
brew services start postgresql
# Linux
sudo systemctl start postgresqlPort Already in Use
If ports 3000 or 5173 are already in use, you can change them:
- Frontend: Update
vite.config.tsinapps/web - Backend: Update the port in
apps/api/src/main.ts
Type Errors
If you encounter TypeScript errors, make sure shared packages are built:
pnpm shared buildNext Steps
- First Steps - Create your first workout
- Development Setup - Set up for contributing
- Architecture Overview - Understand the codebase