# AGENTS.md This file provides guidance to AI coding assistants working with code in this repository. ## Commands ### Setup ```bash composer i npm ci ``` ### JavaScript See `package.json` scripts for all available commands (build, dev, watch, lint, stylelint, test:unit, test:e2e, etc.). ### PHP Available composer commands: ```bash composer cs:check # Check code style composer cs:fix # Fix code style composer psalm # Run static analysis composer test:unit # Run unit tests composer test:integration # Run integration tests ``` See `composer.json` for all available commands. ## Architecture ### Stack - **Backend**: PHP (see `appinfo/info.xml` for version requirements), Nextcloud app framework, CalDAV protocol support. Namespace: `OCA\Calendar\`. - **Frontend**: Vue 3, Pinia, Vue Router 5, FullCalendar 6, bundled with rspack. ### PHP Backend (`lib/`) Layered: Controllers → Services → DB Mappers. - **`Controller/`** — Thin HTTP handlers; business logic lives in services. - **`Service/`** — Core logic. Key areas: calendar management, event handling, attendee management, reminders/alarms, availability/free-busy, appointment booking integrations, CalDAV synchronization. - **`Db/`** — Nextcloud `QBMapper`-based mappers and entity models. - **`BackgroundJob/`** — Nextcloud background jobs for maintenance tasks (e.g., cleaning up outdated bookings). - **`Listener/`** — Event listeners hooked to domain events from `lib/Events/`. - **`Dashboard/`** — Widgets for the Nextcloud dashboard. - **`Http/`** — HTTP client utilities for external calendar sources (WebCal support). - **`Objects/`** — Domain models for calendar objects (events, availability, etc.). - **`Migration/`** — Database migrations. ### JavaScript Frontend (`src/`) Single-page Vue 3 app using FullCalendar for event visualization. Main entry point is `App.vue`. - **`store/`** — Central Pinia store (calendars, events, user preferences). - **`services/`** — JS services that call the PHP REST API. - **`components/`** — Vue components (event creation, event detail view, calendar sidebar, settings, etc.). - **`router.js`** — Routes for main calendar view and other views. - **`views/`** — Top-level page views. ### Frontend Conventions - **New components** must use the **Vue Composition API** with `