Thank you for your interest in contributing to Viewhook! This document describes how to set up your development environment and the conventions we follow.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/viewhook.git - Copy the environment file:
cp .env.example .env - Start Laravel Sail:
./vendor/bin/sail up -d - Install PHP dependencies:
./vendor/bin/sail composer install - Install Node dependencies:
npm install - Generate app key:
./vendor/bin/sail artisan key:generate - Run migrations:
./vendor/bin/sail artisan migrate - Build frontend assets:
npm run dev
We use Laravel Pint for code style enforcement (PSR-12 + Laravel conventions).
# Auto-fix code style
./vendor/bin/sail composer run lint:fix
# Check only (no fix)
./vendor/bin/sail composer run lintWe use ESLint and Prettier for frontend code quality.
# Auto-fix ESLint issues
npm run lint
# Auto-fix Prettier formatting
npm run format
# Check only (no fix)
npm run lint:check
npm run format:checkWe run PHPStan at level 8 on all application code.
./vendor/bin/sail composer run typesAll code must be covered by tests. We require 100% minimum code coverage.
# Run all backend checks (lint + types + tests)
./vendor/bin/sail composer run test
# Run individual suites
./vendor/bin/sail composer run test:unit
./vendor/bin/sail composer run test:feature
# Run all frontend checks (eslint + prettier + tsc + vitest)
npm test
# Run frontend unit tests only
npm run test:unit- Feature tests: Test from HTTP endpoints, Artisan commands, or Jobs only. Never test Actions, Services, or Models directly.
- Unit tests: No database, no Laravel context required.
- Tests live in
tests/Feature/andtests/Unit/. - Follow the existing Pest PHP conventions.
Please follow the existing layered architecture:
| Layer | Responsibility |
|---|---|
| Actions | Single-purpose business logic, delegates to models/services |
| Services | External I/O (HTTP calls), return DTOs, never write to DB |
| Jobs | Async work, call services then persist via models |
| DTOs | Immutable data containers between layers |
- Ensure
./vendor/bin/sail composer run testpasses (all 4 checks green) - Ensure
npm testpasses (all frontend checks green) - Write or update tests for any changed behaviour
- Keep PRs focused — one feature or fix per PR
- Write a clear description of what the PR changes and why
- Reference any related issues
We use Conventional Commits:
<type>: <description>
Types: feat, fix, refactor, docs, test, chore, perf, ci
Examples:
feat: add custom domain supportfix: prevent duplicate requests on retrydocs: update self-hosting guide
Please use the GitHub issue templates:
By contributing, you agree that your contributions will be licensed under the MIT License.
Built by Paul Underwood.