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 devProject Structure
text
running-days/
├── apps/ # Deployable applications
├── packages/ # Shared libraries
├── infrastructure/ # Docker and deployment
└── docs/ # DocumentationDevelopment Workflow
Making Changes
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
pnpm test - Run linting:
pnpm lint - Commit with conventional commits:
git commit -m "feat: add new feature" - Push and create a PR
Conventional Commits
We use conventional commits for clear changelog generation:
| Prefix | Description |
|---|---|
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 testCode 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/typesfor 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 coverageE2E Tests
bash
pnpm --filter @running-days/web test:e2eBuilding
bash
# Build all packages and apps
pnpm build
# Type check
pnpm checkGetting Help
- Check existing GitHub Issues
- Read the Architecture Overview
- Review the API Reference