# Contributing

Thank you for helping. Bug reports, documentation fixes, themes and features are all welcome.

## Get set up

Follow the installation steps in the introduction. For development, run:

```bash
composer install
npm install
npm run dev          # in one terminal
php artisan serve    # in another
```

## Ground rules

- One change per pull request, with a clear description of the problem it solves.
- Follow the existing structure: class-based Livewire components, models in `app/Models`, helpers in `app/Support`.
- Format PHP with Laravel Pint before committing:

```bash
  ./vendor/bin/pint
```

- Do not commit `.env`, uploaded files or `database/database.sqlite`.
- New database changes need a migration. Never edit a migration that has already been released.
- Escape output with `{{ }}`. Use `{!! !!}` only for sanitised article and page bodies.
- Keep admin screens usable at phone width.
- Update the documentation in `docs/` when behaviour changes. It is Markdown and also renders in the admin.

## Tests

The project does not have an automated test suite yet. Adding one with Pest is the most valuable contribution right now. Good first targets:

- the role middleware and `ArticlePolicy`
- publishing rules (draft, published, future date)
- `ImageProcessor` and the upload endpoint
- `MenuBuilder::tree()`
- theme fallback in `ThemeManager`

## Pull request checklist

- [ ] The change is described and linked to an issue where there is one
- [ ] `./vendor/bin/pint` has been run
- [ ] Migrations run on a fresh database and on an existing one
- [ ] Tried as an administrator, an editor and an author where permissions matter
- [ ] Checked in at least two themes if a theme file changed
- [ ] Documentation updated

## Contributing a theme

Follow the checklist in *Themes*. Add the theme's two folders, a `screenshot.png` and a short note in the pull request about which browsers you tested.

## Ideas for the roadmap

- Automated tests
- Per-article SEO fields (meta title and description)
- Scheduled publishing and an editorial review step for authors
- Comments and a contact form
- RSS feed and sitemap
- Theme options (colours, layout choices) set from the admin
- A command to regenerate thumbnails after changing image sizes
- Multiple languages

## Security

Please do not open a public issue for a vulnerability. Report it privately to `<security-contact>` and allow time for a fix.

## License

Choose a license for the project (MIT is common for Laravel applications), add a `LICENSE` file at the repository root, and state it here.
