Skip to main content
Thank you for your interest in contributing to PlanningSup! This guide will help you get started with development and understand our workflows.

Getting started

1

Fork and clone the repository

git clone https://github.com/YOUR_USERNAME/planningsup.git
cd planningsup
2

Install dependencies

PlanningSup uses Bun as the primary runtime and package manager.
# Install Bun (if not already installed)
curl -fsSL https://bun.sh/install | bash

# Install project dependencies
bun install
The project specifies the required Bun version in .bun-version. Bun will automatically use this version.
3

Configure environment

cp apps/api/.env.example apps/api/.env
The default configuration works for local development with Docker Compose.
4

Start development environment

bun dev
This command:
  • Starts PostgreSQL via Docker Compose
  • Runs database migrations
  • Starts the API server on http://localhost:20000
  • Starts the web app on http://localhost:4444

Project structure

PlanningSup is a Bun workspace monorepo:
planningsup/
├── apps/
│   ├── api/          # Elysia API server + Drizzle ORM
│   ├── web/          # Vue 3 PWA frontend
│   ├── app/          # Tauri desktop/mobile app
│   └── extension/    # Browser extension
├── packages/
│   ├── config/       # Shared build configs (Vite, TypeScript)
│   └── libs/         # Shared utilities and types
├── resources/
│   └── plannings/    # Planning JSON files by university
├── scripts/          # Build and utility scripts
└── test/             # Unit, integration, and E2E tests

Key directories

Elysia API server
  • src/index.ts - Server entry point
  • src/api.ts - API route setup
  • src/routes/ - Route handlers
  • src/db/ - Drizzle schema and queries
  • src/jobs/ - Background workers
  • src/utils/ - Event parsing, auth, logging
  • drizzle/ - SQL migrations

Development workflow

Working on the API

# Start only the API
cd apps/api
bun run dev

# Run type checking
bun run typecheck

# Generate Drizzle types after schema changes
bun run generate-drizzle

# Generate BetterAuth types after auth schema changes
bun run generate-better-auth

Working on the web app

# Start only the web app
cd apps/web
bun run dev

# Build for production
bun run build

# Preview production build
bun run preview

Working on the browser extension

cd apps/extension
bun run dev      # Development build
bun run build    # Production build
Extension scripts don’t participate in root-level bun dev. You must run them from the apps/extension directory.

Testing

Unit tests

Unit tests use Bun’s built-in test runner:
# Run all unit tests
bun run test:unit

# Run specific test file
bun test test/jobs.test.ts

# Watch mode
bun test test/jobs.test.ts --watch

# Filter by test name
bun test test/jobs.test.ts --test-name-pattern "quiet hours"

Integration tests

Integration tests run against Docker containers:
# Full run (builds image, starts stack, runs tests, cleans up)
bun run test:integration

# Skip Docker build (faster iteration)
bun run test:integration:local

# Keep containers running for debugging
bun run test:integration -- --no-cleanup --verbose
Tests run on http://localhost:20000

End-to-end tests

E2E tests use Playwright:
# Run E2E tests (Chrome only)
bun run test:e2e

# Include Safari/WebKit
bun run test:e2e:safari

# Headed mode (visible browser)
bun run test:e2e:headed

# Debug mode (step through tests)
bun run test:e2e:debug

# Custom flags
bun run test:e2e -- --workers 2 --headed
Playwright browsers are automatically installed on first run. The script creates .playwright-browsers-installed as a marker.

Running all quality checks

# Run linting, type checking, and unit tests
bun run lint-fix && bun run lint && bun run typecheck && bun run test:unit

# Or use the Docker build (includes all checks + build)
bun run docker:build

Code quality

Linting

# Check for issues
bun run lint

# Fix auto-fixable issues
bun run lint-fix

Type checking

# Check all workspaces
bun run typecheck

# Check specific workspace
cd apps/api
bun run typecheck
Important: There are NO colon-namespaced commands like bun run typecheck:web or bun run lint:api. Always use cd <workspace> && bun run <script>.

Database changes

Creating migrations

1

Modify the schema

Edit apps/api/src/db/schemas/*.ts
2

Generate migration

cd apps/api
bun run generate-drizzle
This creates a new SQL file in apps/api/drizzle/
3

Review migration

Check the generated SQL to ensure it matches your intent.
4

Test migration

Restart the API to apply migrations:
bun dev

Updating auth schema

If you modify apps/api/src/db/schemas/auth.ts:
cd apps/api
bun run generate-drizzle
bun run generate-better-auth

Making commits

Commit message style

Follow the existing commit message style:
# Good examples
git commit -m "add: support for custom timezone conversion"
git commit -m "fix: planning refresh queue deadlock"
git commit -m "update: improve error handling in event parser"
git commit -m "docs: clarify environment variable usage"
Prefixes:
  • add: - New feature or capability
  • update: - Enhancement to existing feature
  • fix: - Bug fix
  • refactor: - Code restructuring
  • docs: - Documentation changes
  • test: - Test additions or fixes
  • chore: - Maintenance tasks

Pre-commit checklist

  • Code passes linting: bun run lint
  • Code passes type checking: bun run typecheck
  • Unit tests pass: bun run test:unit
  • Integration tests pass (if applicable): bun run test:integration
  • Changes are documented (if user-facing)

Submitting pull requests

1

Create a feature branch

git checkout -b feature/my-new-feature
2

Make your changes

Write code, add tests, update documentation.
3

Test thoroughly

Run all relevant tests:
bun run lint-fix
bun run lint
bun run typecheck
bun run test:unit
bun run test:integration
4

Commit and push

git add .
git commit -m "add: description of your feature"
git push origin feature/my-new-feature
5

Open pull request

Open a PR on GitHub with:
  • Clear description of changes
  • Screenshots (for UI changes)
  • Related issue numbers
  • Testing steps

PR review process

  1. Automated checks - GitHub Actions runs linting, type checking, tests, and builds
  2. Code review - Maintainers review your code
  3. Feedback - Address any requested changes
  4. Merge - Once approved, your PR will be merged

Adding universities

See the dedicated Adding Universities guide for detailed instructions on contributing new planning sources. Quick summary:
1

Create JSON file

Add a new file to resources/plannings/ following the existing structure.
2

Validate JSON

node scripts/check-plannings-json.js
3

Test locally

bun dev
Verify your planning appears in the UI and events load correctly.
4

Submit PR

Open a pull request with your new planning file.

CI/CD pipeline

GitHub Actions workflows

.github/workflows/docker-publish.yml Main CI/CD pipeline:
  1. Build Docker image (includes lint, typecheck, build, unit tests)
  2. Run integration tests (auth disabled)
  3. Run integration tests (auth enabled)
  4. Run E2E tests (only when UI files change)
  5. Publish image (only on main, dev, or vX.Y.Z tags)
.github/workflows/extension-build.yml Builds the browser extension.

Validating workflows locally

bun run validate:workflows
This checks workflow syntax without pushing to GitHub.

Release process

Releases are handled by maintainers using the release script:
# Must be on main branch with clean working tree
git checkout main
git pull origin main

# Bump version and create tag
bun run release patch  # or minor, major

# Push with tags
git push --follow-tags
This:
  1. Bumps version in package.json files
  2. Creates a git tag (vX.Y.Z)
  3. GitHub Actions builds and publishes the Docker image

Development tools

  • ESLint - Linting support
  • Vue Language Features (Volar) - Vue 3 support
  • Tailwind CSS IntelliSense - CSS class suggestions
  • Bun for Visual Studio Code - Bun runtime support

Useful commands

# Remove all node_modules
./scripts/remove-node-modules.sh

# Check planning JSON files
node scripts/check-plannings-json.js

# Build everything
bun run build

# Clean Docker resources
docker compose -f docker-compose.test.yml down -v --remove-orphans

Getting help

GitHub Issues

Report bugs or request features

Telegram

Chat with the maintainer (@kernoeb)

Discord

Message kernoeb on Discord

Documentation

Learn about the architecture

Contributor recognition

All contributors are listed in the README. Thank you to everyone who has contributed!
If you’ve donated to support PlanningSup, you’re also recognized in the README’s donors section.

Build docs developers (and LLMs) love