2.6 KiB
2.6 KiB
Repository Guidelines
Project Structure & Module Organization
src/layers PHP code (Application,Domain,Framework,Infrastructure); create new classes under the matching namespace and keep adapters in Infrastructure.resources/stores Vite-managed frontend code (resources/js,resources/css), while build artifacts belong inpublic/assetsunder thepublic/web root.tests/mirrors the PHP namespaces and houses Playwright suites intests/e2e; share fixtures and stubs throughtests/Support.- Operational docs and tooling sit in
docs/,docker/, anddeployment/; update those paths whenever runtime behaviour changes.
Build, Test & Development Commands
make up/make downmanage the Docker stack; addmake logswhen you need container output.npm run devstarts Vite locally, andnpm run buildproduces optimized bundles intopublic/assets.make testdrives the full Pest suite; usemake test-unit,make test-domain, ormake test-coveragefor focused runs.- JavaScript and browser checks run via
npm run test,npm run test:e2e, andnpm run test:coverage. - Quality gates:
make phpstan,make cs(dry run),make cs-fix(auto-fix), plusnpm run lint:jsandnpm run format.
Coding Style & Naming Conventions
- Follow PSR-12 with strict types; prefer constructor injection and suffix integrations with their role (
MailerAdapter,RedisCache). - Keep PHP objects immutable unless Domain logic requires mutation; colocate interfaces with their consuming layer.
- Use 4-space indents in PHP and Prettier defaults for TypeScript; name frontend components in PascalCase and utilities in camelCase.
Testing Guidelines
- Add Pest specs beside the feature namespace with expressive names (
it_handles_invalid_tokens); keep builders intests/Support. - Mock external services through
tests/__mocks__; rely on Pest datasets for edge cases. - Sync Playwright specs with UX changes, reuse
tests/e2e/fixtures, and review reports viaplaywright show-report.
Commit & Pull Request Guidelines
- Use Conventional Commits (
fix:,feat:, optional scope) to match history. - PRs must outline the change, list executed checks, and link issues; attach screenshots for UI work or config diffs for ops updates.
- Confirm CI covers Pest, Jest, Playwright, PHPStan, and php-cs-fixer before requesting review.
Security & Configuration Tips
- Never commit
.envor secrets; followENV_SETUP.mdand store deployment credentials in Vault. - Run
make security-checkahead of releases and reflect infrastructure changes indocs/deployment/.