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
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/openathlete.git
cd openathlete- Add upstream remote:
git remote add upstream https://github.com/openathleteorg/openathlete.gitStep 2: Install Dependencies
pnpm installStep 3: Environment Setup
Frontend
cp apps/web/.env.example apps/web/.envBackend
cp apps/api/.env.example apps/api/.envUpdate the .env files with your local configuration.
Step 4: Build Shared Packages
pnpm shared buildStep 5: Database Setup
- Create a local PostgreSQL database
- Update
DATABASE_URLinapps/api/.env - Run migrations:
pnpm database run db:deployStep 6: Start Development
pnpm devThis 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-description2. Make Changes
- Write code following our code standards
- Test your changes locally
- Update documentation if needed
3. Type Check
pnpm tsc:check4. Lint and Format
pnpm lint
pnpm format5. 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-nameThen create a pull request on GitHub.
Code Standards
TypeScript
- Use TypeScript for all new code
- Avoid
anytypes - 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 testGetting Help
- Check existing issues and Discord messages
- Ask in our Discord community
- Review the Contributing Guide