|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Høringsportal (deltag.aarhus.dk) is a Drupal 10 civic engagement platform for Aarhus municipality. |
| 8 | +It enables citizens to participate in public hearings, submit citizen proposals, attend public meetings, |
| 9 | +and engage with local projects. |
| 10 | + |
| 11 | +## Development Commands |
| 12 | + |
| 13 | +This project uses [Task](https://taskfile.dev/) for all development workflows. Run `task` to see available commands. |
| 14 | + |
| 15 | +### Essential Commands |
| 16 | + |
| 17 | +```bash |
| 18 | +# Initial setup (resets database) |
| 19 | +task site-install |
| 20 | + |
| 21 | +# Update existing installation |
| 22 | +task site-update |
| 23 | + |
| 24 | +# Build theme assets |
| 25 | +task assets-build |
| 26 | + |
| 27 | +# Watch for changes during development |
| 28 | +task assets-watch |
| 29 | + |
| 30 | +# Load test fixtures |
| 31 | +task fixtures:load |
| 32 | + |
| 33 | +# Run Drush commands |
| 34 | +task drush -- <command> |
| 35 | + |
| 36 | +# Access container |
| 37 | +task compose -- exec phpfpm bash |
| 38 | +``` |
| 39 | + |
| 40 | +### Code Quality |
| 41 | + |
| 42 | +```bash |
| 43 | +# Apply all coding standards (PHP, JS, CSS, Twig, YAML, Markdown) |
| 44 | +task coding-standards:apply |
| 45 | + |
| 46 | +# Check all coding standards |
| 47 | +task coding-standards:check |
| 48 | + |
| 49 | +# Static analysis (PHPStan) |
| 50 | +task code-analysis |
| 51 | + |
| 52 | +# Individual checks |
| 53 | +task coding-standards:php:check |
| 54 | +task coding-standards:twig:check |
| 55 | +task coding-standards:javascript:check |
| 56 | +task coding-standards:styles:check |
| 57 | +``` |
| 58 | + |
| 59 | +### Testing |
| 60 | + |
| 61 | +Playwright tests are located in `playwright/` directory: |
| 62 | + |
| 63 | +```bash |
| 64 | +docker compose --profile test run --rm playwright npx playwright test |
| 65 | +``` |
| 66 | + |
| 67 | +## Architecture |
| 68 | + |
| 69 | +### Directory Structure |
| 70 | + |
| 71 | +- `web/modules/custom/` - Custom Drupal modules |
| 72 | +- `web/themes/custom/hoeringsportal/` - Main theme (Bootstrap 5, Webpack Encore) |
| 73 | +- `web/themes/custom/hoeringsportal_admin/` - Admin theme |
| 74 | +- `config/sync/` - Drupal configuration |
| 75 | + |
| 76 | +### Core Custom Modules |
| 77 | + |
| 78 | +- **hoeringsportal_hearing** - Hearing (høring) content type and functionality |
| 79 | +- **hoeringsportal_citizen_proposal** - Citizen proposal system with OpenID Connect authentication |
| 80 | +- **hoeringsportal_public_meeting** - Public meetings with Pretix integration for ticketing |
| 81 | +- **hoeringsportal_activity** - Extends public meetings to include other activity types |
| 82 | +- **hoeringsportal_project** - Project content type for civic engagement projects |
| 83 | +- **hoeringsportal_deskpro** - Deskpro helpdesk integration for hearing replies |
| 84 | +- **hoeringsportal_data** - Data helpers and API endpoints |
| 85 | +- **hoeringsportal_dialogue** - Dialogue/discussion features with comments |
| 86 | +- **hoeringsportal_anonymous_edit** - Allow anonymous users to edit their submissions |
| 87 | +- **hoeringsportal_openid_connect** - OpenID Connect authentication customizations |
| 88 | + |
| 89 | +### External Integrations |
| 90 | + |
| 91 | +- **Pretix** - Event ticketing for public meetings (docker-compose.pretix.yml) |
| 92 | +- **Deskpro** - Helpdesk for hearing submissions |
| 93 | +- **OpenID Connect** - Citizen authentication (docker-compose.oidc.yml) |
| 94 | +- **ClamAV** - Virus scanning for uploads |
| 95 | +- **Serviceplatformen** - Danish government services integration |
| 96 | + |
| 97 | +### Theme Architecture |
| 98 | + |
| 99 | +The theme uses Webpack Encore for asset building: |
| 100 | + |
| 101 | +```bash |
| 102 | +# Theme location |
| 103 | +web/themes/custom/hoeringsportal/ |
| 104 | + |
| 105 | +# Build commands |
| 106 | +npm install --prefix web/themes/custom/hoeringsportal |
| 107 | +npm run build --prefix web/themes/custom/hoeringsportal |
| 108 | +``` |
| 109 | + |
| 110 | +CSS uses SCSS with Bootstrap 5 and CSS custom properties for color management. |
| 111 | + |
| 112 | +## Coding Standards |
| 113 | + |
| 114 | +- PHP follows Drupal coding standards (phpcs.xml.dist) |
| 115 | +- PHPStan level 0 for custom modules, level 9 for hoeringsportal_audit_log |
| 116 | +- Twig uses twig-cs-fixer |
| 117 | +- JavaScript and CSS use Prettier |
| 118 | +- YAML uses Prettier |
| 119 | + |
| 120 | +## Docker Services |
| 121 | + |
| 122 | +Primary services (docker-compose.yml): |
| 123 | + |
| 124 | +- phpfpm (PHP 8.3) |
| 125 | +- nginx |
| 126 | +- mariadb |
| 127 | +- memcached |
| 128 | +- mail (Mailpit) |
| 129 | + |
| 130 | +Optional profiles: |
| 131 | + |
| 132 | +- `pretix` - Event ticketing system |
| 133 | +- `test` - Playwright testing |
| 134 | +- `dev` - Code quality tools (markdownlint, prettier) |
| 135 | + |
| 136 | +Start optional services: |
| 137 | + |
| 138 | +```bash |
| 139 | +PROFILES=pretix task compose -- up --detach |
| 140 | +``` |
| 141 | + |
| 142 | +## Configuration |
| 143 | + |
| 144 | +Local settings go in `web/sites/default/settings.local.php`. |
| 145 | +Environment variables can be set in `.env.local`. |
| 146 | + |
| 147 | +Key settings: |
| 148 | + |
| 149 | +- `TASK_DOCKER_COMPOSE_PROFILES` - Docker profiles to auto-start |
| 150 | +- `TASK_ASSETS_SKIP_BUILD` - Skip asset building on site-update |
| 151 | + |
| 152 | +## Translations |
| 153 | + |
| 154 | +Import custom translations: |
| 155 | + |
| 156 | +```bash |
| 157 | +task translations:import |
| 158 | +``` |
| 159 | + |
| 160 | +Translation files are in `translations/` and managed via Drush locale commands. |
0 commit comments