OpenAthleteOpenAthlete

Development Setup

Set up your environment for contributing to OpenAthlete

This guide will help you set up your development environment to contribute to OpenAthlete.

Prerequisites

  • Node.js v22.14.0
  • pnpm v9.x
  • PostgreSQL
  • Git

Step 1: Fork and Clone

  1. Fork the repository on GitHub
  2. Clone your fork:
git clone https://github.com/YOUR_USERNAME/openathlete.git
cd openathlete
  1. Add upstream remote:
git remote add upstream https://github.com/openathleteorg/openathlete.git

Step 2: Install Dependencies

pnpm install

Step 3: Environment Setup

Frontend

cp apps/web/.env.example apps/web/.env

Backend

cp apps/api/.env.example apps/api/.env

Update the .env files with your local configuration.

Step 4: Build Shared Packages

pnpm shared build

Step 5: Database Setup

  1. Create a local PostgreSQL database
  2. Update DATABASE_URL in apps/api/.env
  3. Run migrations:
pnpm database run db:deploy

Step 6: Start Development

pnpm dev

This starts:

  • Frontend at http://localhost:5173
  • Backend at http://localhost:3000

Development Workflow

1. Create a Branch

git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-description

2. Make Changes

  • Write code following our code standards
  • Test your changes locally
  • Update documentation if needed

3. Type Check

pnpm tsc:check

4. Lint and Format

pnpm lint
pnpm format

5. Commit

Follow our commit message convention:

type(scope): description

[optional body]

[optional footer]

Types: feat, fix, docs, style, refactor, test, chore

6. Push and Create PR

git push origin feature/your-feature-name

Then create a pull request on GitHub.

Code Standards

TypeScript

  • Use TypeScript for all new code
  • Avoid any types
  • Use shared types from @openathlete/shared

React

  • Functional components with hooks
  • Use Tailwind CSS for styling
  • Follow existing component patterns

NestJS

  • Follow NestJS best practices
  • Use dependency injection
  • Implement proper error handling

Database

  • Use Prisma for all database operations
  • Write migrations for schema changes
  • Follow existing naming conventions

Testing

Run tests before submitting:

pnpm test

Getting Help

Next Steps

On this page