-
Notifications
You must be signed in to change notification settings - Fork 6
Rewrite docs #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
tijsverkoyen
wants to merge
9
commits into
421-seo
Choose a base branch
from
rewrite-docs
base: 421-seo
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Rewrite docs #236
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2b098f4
chore: remove non-bundle docs and flatten docs/ to single directory
tijsverkoyen 3446b47
docs: add index.md as entry point with architecture overview
tijsverkoyen 68626d7
docs: rewrite stub docs (encrypted, dark-mode, installation, no-results)
tijsverkoyen ff6489e
docs: fix and expand incomplete docs
tijsverkoyen 1bff0de
docs: apply consistent format to remaining docs
tijsverkoyen bb13c90
docs: update CLAUDE.md and README.md to reflect flat doc structure
tijsverkoyen b92f3cb
docs: remove stale link to deleted components.html
tijsverkoyen 4bc767f
chore: fix formatting
tijsverkoyen b6d415c
feat: documented crud
tijsverkoyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## About this bundle | ||
|
|
||
| `FrameworkCoreBundle` is a Symfony 8 bundle used as a shared foundation across SumoCoders projects. It is not a | ||
| standalone application. It is installed into projects via `sumocoders/application-skeleton`. | ||
|
|
||
| Requirements: | ||
|
|
||
| - PHP ^8.5 | ||
| - Symfony ^8.0, | ||
| - Doctrine ^3.3. | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| # Install dependencies | ||
| composer install | ||
|
|
||
| # Run tests | ||
| ./vendor/bin/phpunit | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best |
||
|
|
||
| # Run a single test file | ||
| ./vendor/bin/phpunit tests/path/to/FooTest.php | ||
| ``` | ||
|
|
||
| No phpstan or phpcs config exists in this repo. Those are configured per-project in the consuming application. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Request lifecycle | ||
|
|
||
| Two event listeners fire on every request: | ||
|
|
||
| 1. `BreadcrumbListener` (`kernel.controller_arguments`, priority -1): reads `#[Breadcrumb]` attributes from the matched | ||
| controller and populates `BreadcrumbTrail`. | ||
| 2. `TitleListener` (`kernel.controller_arguments`, priority -1): reads `#[Title]` attributes and writes to `PageTitle`. | ||
| Falls back to breadcrumbs if no `#[Title]` is present. | ||
|
|
||
| `PageTitle` and `BreadcrumbTrail` are request-scoped services aliased for direct injection. | ||
|
|
||
| ### Attribute-driven configuration | ||
|
|
||
| Controller behaviour is controlled via PHP 8 attributes, not YAML or annotations: | ||
|
|
||
| | Attribute | Target | Purpose | | ||
| |--------------------|-----------------|----------------------------------------------------------------------------------------------------| | ||
| | `#[Breadcrumb]` | method / class | Adds one crumb; repeatable for chains; supports `parent:` for automatic trail building | | ||
| | `#[Title]` | method | Explicit page title; supports `{param}` / `{object.property}` interpolation and `parent:` chaining | | ||
| | `#[AuditTrail]` | entity class | Enables Doctrine audit logging for that entity; `withData: false` skips field-level diff | | ||
| | `#[SensitiveData]` | entity property | Masks property value in audit log output | | ||
|
|
||
| ### Subsystems | ||
|
|
||
| - **Pagination** (`src/Pagination/Paginator.php`): wraps a Doctrine `QueryBuilder`; exposes current page, total | ||
| results, prev/next. See `docs/pagination.md`. | ||
| - **Menu** (`src/Menu/MenuBuilder.php`): KnpMenu builder dispatching `ConfigureMenuEvent`; consuming apps listen to | ||
| that event to add items. See `docs/menu.md`. | ||
| - **Audit trail** (`src/DoctrineListener/DoctrineAuditListener.php`): Doctrine `onFlush` + `postPersist` listener that | ||
| logs creates/updates/deletes via `AuditLogger`. Entities opt in with `#[AuditTrail]`. See `docs/audit-trail.md`. | ||
| - **Forms** (`src/Form/`): custom types (`ImageType`, `FileType`, `BelgiumPostCodeType`) and extensions wiring date | ||
| pickers, toggle-password, and collection UI. See `docs/forms.md`. | ||
| - **DBAL types** (`src/DBALType/`): `EncryptedDBALType`, `AbstractImageType`, `AbstractFileType` for custom column | ||
| handling. See `docs/encrypted.md`, `docs/uploading-files.md`, `docs/uploading-images.md`. | ||
| - **Twig** (`src/Twig/`): `FrameworkExtension`, `PaginatorExtension`, `ContentExtension`; `PageTitle` is available as a | ||
| string in templates. | ||
| - **Doctrine extension** (`src/Extensions/Doctrine/MatchAgainst.php`): custom DQL function for MySQL | ||
| `MATCH ... AGAINST` full-text search. | ||
|
|
||
| ### Service registration | ||
|
|
||
| All services are registered in `config/services.php` (PHP-format DI config, no YAML). The bundle extension | ||
| (`src/DependencyInjection/SumoCodersFrameworkCoreExtension.php`) loads that file. `Configuration.php` is intentionally | ||
| empty. No runtime bundle config is needed. | ||
|
|
||
| ## Documentation | ||
|
|
||
| All docs live in `docs/`. Start at `docs/index.md` for an overview of all subsystems, the request lifecycle, and key | ||
| injectable services. | ||
|
|
||
| When adding or changing a subsystem, update the corresponding doc file in `docs/`. Each doc follows the format: purpose, | ||
| prerequisites, usage, options table, examples, troubleshooting. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,31 @@ | ||
| # SumoCoders FrameworkCoreBundle | ||
| This bundle is created and maintained by [SumoCoders](https://github.com/sumocoders). It contains a set of basic tools that enable us to build an application in a shorter timespan. The bundle is intended to be used together with our [npm package](https://github.com/sumocoders/FrameworkStylePackage). | ||
|
|
||
| Shared foundation bundle for SumoCoders Symfony projects. Provides page titles, breadcrumbs, navigation menus, | ||
| file/image uploads, encrypted fields, audit logging, pagination, and a frontend design system. Created and maintained | ||
| by [SumoCoders](https://github.com/sumocoders). | ||
|
|
||
| ## Installation | ||
| To properly use this bundle, create a new project with our application skeleton: | ||
| ``` | ||
| $ composer create-project sumocoders/application-skeleton my_project | ||
|
|
||
| Create a new project with the application skeleton. It installs this bundle and all required config: | ||
|
|
||
| ```bash | ||
| composer create-project sumocoders/application-skeleton my_project | ||
| ``` | ||
| The skeleton will load this bundle, install our npm package and add some extra config for CI, deployment, etc.. | ||
|
|
||
| Requires: | ||
|
|
||
| - PHP ^8.5 | ||
| - Symfony ^8.0 | ||
| - Doctrine ^3.3. | ||
|
|
||
| ## Documentation | ||
| All documentation is located in the `docs/` subdirectory. | ||
|
|
||
| Start at [`docs/index.md`](docs/index.md). | ||
|
|
||
| ## Issues? | ||
|
|
||
| Feel free to add an Issue on Github, or even better create a PR. | ||
|
|
||
| ## License | ||
|
|
||
| This software is published under the [MIT License](LICENSE.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beter aanpassen naar
symfony composer