This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
NEVER use docker-compose or docker exec directly. ALWAYS use task commands.
# Starting containers
task docker:up-core # Core services only
task docker:up-debug # Core + debug tools (phpMyAdmin, Mailhog)
task docker:up-discourse # Core + Discourse
task docker:up-all # All services
# Stopping containers
task docker:down-core
task docker:down-debug
task docker:down-discourse
task docker:down-all
# Running commands in container
task docker:run:bash -- "npm run dev" # Run bash command
task docker:run:artisan -- migrate # Run artisan command
task docker:shell # Open shell in container
# Testing
task docker:test:phpunit # Run PHP tests
task docker:test:jest # Run JS tests
task docker:test:playwright # Run e2e tests
# Vite dev server (HMR)
task docker:vite:start # Start Vite in background
task docker:vite:stop # Stop Vite
task docker:vite # Start Vite in foreground (interactive)
# Logs and debugging
task docker:logs # View container logsRestarters.net is a suite of software for the repair community that brings together community repair enthusiasts and activists. It combines three core modules:
- The Fixometer - engine for organizing community repair events and recording their impact
- Restarters Talk - space for local and global discussion of community repair (powered by Discourse)
- Restarters Wiki - collectively produced knowledge base of advice and support (powered by MediaWiki)
This is a Laravel 9 application with PHP 8+ that integrates with external services including Discourse, MediaWiki, and WordPress.
Prerequisites: Install Task - the project uses Taskfile for Docker management.
See docs/local-development.md for full setup instructions.
# Start Docker environment (uses Task - do NOT use docker-compose directly)
task docker:up-core # Core only (app + database)
task docker:up-debug # With phpMyAdmin and Mailhog
task docker:up-discourse # With Discourse integration
task docker:up-all # All services
# Stop Docker environment
task docker:down-core # Stop core services
task docker:down-debug # Stop debug services
task docker:down-all # Stop all services
# Other Docker commands
task docker:logs # View container logs
task docker:shell # Open shell in container
task docker:run:artisan -- migrate # Run artisan commands
task docker:run:bash -- "command" # Run bash commands
# Run Vite for HMR (hot module replacement)
task docker:run:bash -- "npm run dev"
# The application will be available at:
# - Restarters: http://localhost:8001 (Admin: jane@bloggs.net / passw0rd)
# - phpMyAdmin: http://localhost:8002 (Host: restarters_db, User: root, Pass: s3cr3t)
# - Mailhog: http://localhost:8025
# - Discourse: http://localhost:8003# Install PHP dependencies
composer install
# Install and build frontend assets
npm install
npm run dev # Development build
npm run watch # Watch for changes
npm run production # Production build
# Laravel commands
php artisan migrate # Run database migrations
php artisan migrate:fresh # Fresh migration (drops all tables)
php artisan seed # Run database seeders
php artisan tinker # Laravel REPL
# JavaScript translation files are now auto-generated by Vite laravel-translator plugin
php artisan translations:check # Check translation completeness
# Generate application key (for new installs)
php artisan key:generate# Run PHP unit tests (inside Docker container)
task docker:shell
# Then inside container:
export DB_TEST_HOST=restarters_db
./vendor/bin/phpunit
# Run specific test file
./vendor/bin/phpunit tests/Feature/Events/AddRemoveVolunteerTest.php
# Run specific test method
./vendor/bin/phpunit --filter testMethodName
# Run JavaScript tests
npm run jest
# Run Playwright end-to-end tests
npm test# PHP CS Fixer (code style)
./tools/php-cs-fixer.phar fix
# Check code style without fixing
./tools/php-cs-fixer.phar fix --dry-run --diff- Device (
app/Device.php) - Represents items brought to repair events with repair status, categories, and impact calculations - Group (
app/Group.php) - Repair groups that organize events, with location, network affiliations, and member management - Party (
app/Party.php) - Repair events hosted by groups, with attendee management and statistics calculation - User (
app/User.php) - Platform users with roles (Admin, Host, Restarter, NetworkCoordinator) - Network (
app/Network.php) - Regional networks that groups can belong to - Category (
app/Category.php) - Device categories for classification and impact calculations
- Groups have many Events (Parties)
- Events have many Devices
- Users belong to Groups through UserGroups with roles
- Groups belong to Networks through group_network pivot table
- Devices belong to Categories and have repair status tracking
- Discourse API - User management, group creation, SSO integration
- MediaWiki API - User account sync and authentication
- WordPress XML-RPC - Content publishing for events and groups
- Geocoding - Location services for groups and events
- Drip - Email marketing integration
- Uses Laravel migrations in
database/migrations/ - Soft deletes enabled for key models (Events, Users)
- Audit trail via
owen-it/laravel-auditingpackage - JSON columns for flexible network_data storage
- Vue 2 components for interactive features
- Laravel Mix for asset compilation
- Bootstrap 4 for styling
- SCSS for styles in
resources/sass/ - Multiple build targets: main app, global styles, wiki styles
- Role-based permissions via custom
app/Role.phpandapp/Permissions.php - Middleware for authentication and authorization
- Network coordinators have regional permissions
- Group-level host permissions
- Controllers follow resource naming (e.g.,
DeviceController,GroupController) - Events and Listeners in
app/Events/andapp/Listeners/ - Custom artisan commands in
app/Console/Commands/ - API controllers separate from web controllers
- Blade templates in
resources/views/with partials organization
- PHPUnit for backend unit and feature tests
- Jest for JavaScript component testing
- Playwright for end-to-end testing
- Database factory patterns for test data
- Environment variables critical for external service integration
- Docker setup provides development databases and services
- Queue processing for background jobs (Discourse, WordPress sync)
- Caching used extensively for performance (categories, statistics)
- Timezone handling important for global event management
- The codebase uses custom helper functions in
app/Helpers/ - Translation files support multiple locales in
lang/directory - Image handling via intervention/image with custom sizing
- Custom validation rules in
app/Rules/ - Event-driven architecture with model observers
- Only translate fr and fr-BE
- Don't try to test changes when you're running on Windows.
- When you create files, add them to git