Running Days Docs
GitHub

Development Guide

How to set up your development environment and contribute to Running Days.

Prerequisites

  • Node.js 22+ - Required for modern JavaScript features
  • pnpm 9+ - Package manager (install with npm install -g pnpm)
  • Docker - For running the full stack locally
  • Git - Version control

Initial Setup

bash
# Clone the repository
git clone https://github.com/alexcedergren/running-days.git
cd running-days

# Install dependencies
pnpm install

# Copy environment file
cp .env.example .env

# Start development servers
pnpm dev

Project Structure

text
running-days/
├── apps/           # Deployable applications
├── packages/       # Shared libraries
├── infrastructure/ # Docker and deployment
└── docs/          # Documentation

Development Workflow

Making Changes

  1. Create a feature branch: git checkout -b feature/my-feature
  2. Make your changes
  3. Run tests: pnpm test
  4. Run linting: pnpm lint
  5. Commit with conventional commits: git commit -m "feat: add new feature"
  6. Push and create a PR

Conventional Commits

We use conventional commits for clear changelog generation:

PrefixDescription
feat:New feature
fix:Bug fix
docs:Documentation
style:Code formatting
refactor:Code restructuring
test:Adding tests
chore:Maintenance

Running Specific Apps

bash
# API only
pnpm --filter @running-days/api dev

# Web dashboard only
pnpm --filter @running-days/web dev

# Run tests for specific package
pnpm --filter @running-days/business-logic test

Code Style

Svelte 5 Runes

Always use Svelte 5 runes, not Svelte 4 stores:

svelte
<script lang="ts">
  // ✅ Correct - Svelte 5 runes
  let { data } = $props();
  let count = $state(0);
  const doubled = $derived(count * 2);

  // ❌ Wrong - Svelte 4 patterns
  import { writable } from 'svelte/store';
</script>

TypeScript

  • Use strict mode
  • Define interfaces for all data structures
  • Use @running-days/types for shared types

Database Access

Database code must be server-side only:

typescript
// ✅ Correct - in .server.ts or +server.ts
import { db } from '@running-days/database';

// ❌ Wrong - in regular .ts file
import { db } from '@running-days/database';

Testing

Unit Tests

bash
pnpm test           # Run all tests
pnpm test:watch     # Watch mode
pnpm test:coverage  # With coverage

E2E Tests

bash
pnpm --filter @running-days/web test:e2e

Building

bash
# Build all packages and apps
pnpm build

# Type check
pnpm check

Getting Help