diff --git a/README.md b/README.md index 23c3705b..121e0a00 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ structure and a variety of components and features. The project applies current best practices and programming principles, with a strong emphasis on the Single Responsibility Principle -([SRP](https://github.com/samuelgfeller/slim-example-project/wiki/Single-Responsibility-Principle-(SRP))). +([SRP](https://samuel-gfeller.ch/docs/Single-Responsibility-Principle-(SRP))). External library dependencies -are [kept to a minimum](https://github.com/samuelgfeller/slim-example-project/wiki/Libraries-and-Framework) +are [kept to a minimum](https://samuel-gfeller.ch/docs/Libraries-and-Framework) to facilitate maintenance and ensure long-term viability. -The [architecture](https://github.com/samuelgfeller/slim-example-project/wiki/Architecture) +The [architecture](https://samuel-gfeller.ch/docs/Architecture) is inspired by the Domain Driven Design ([DDD](https://en.wikipedia.org/wiki/Domain-driven_design)) and the [Vertical Slice Architecture](https://www.youtube.com/watch?v=L2Wnq0ChAIA). @@ -24,7 +24,7 @@ The base for this project was the official [Slim-Skeleton](https://github.com/slimphp/Slim-Skeleton) and the [slim4-skeleton](https://github.com/odan/slim4-skeleton). -A detailed [**documentation**](https://github.com/samuelgfeller/slim-example-project/wiki) explains how the project is +A detailed [**documentation**](https://samuel-gfeller.ch/docs) explains how the project is built, components, design choices and features. @@ -33,7 +33,7 @@ templates. With frontend [**slim-starter**](https://github.com/samuelgfeller/slim-starter) or just for an API: [**slim-api-starter**](https://github.com/samuelgfeller/slim-api-starter). -Please read the [**installation guide**](https://github.com/samuelgfeller/slim-example-project/wiki/Installation-Guide) +Please read the [**installation guide**](https://samuel-gfeller.ch/docs/Installation-Guide) to get started. ## Features @@ -42,36 +42,36 @@ All the features were developed with an effort to ensure maximum user-friendline The frontend, intuitive, aesthetically pleasing, minimalistic, and functional. The backend, efficient and secure. -This project is currently designed for non-profit organizations or foundations that require a platform -to manage and maintain a record of communication through notes of people they help. - **Technologies:** * [Slim 4 micro-framework](https://github.com/slimphp/Slim) -* [Dependency Injection](https://github.com/samuelgfeller/slim-example-project/wiki/Dependency-Injection) - [PHP-DI](https://php-di.org/) -* [Logging](https://github.com/samuelgfeller/slim-example-project/wiki/Logging) - [Monolog](https://github.com/Seldaek/monolog) -* [Validation](https://github.com/samuelgfeller/slim-example-project/wiki/Validation) - [cakephp/validation](https://book.cakephp.org/4/en/core-libraries/validation.html) -* [Database migrations](https://github.com/samuelgfeller/slim-example-project/wiki/Database-Migrations) - [Phinx](https://phinx.org/) -* [Template rendering](https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering) - [PHP-View](https://github.com/slimphp/PHP-View) -* [Mailing](https://github.com/samuelgfeller/slim-example-project/wiki/Mailing) - [Symfony Mailer](https://symfony.com/doc/current/mailer.html) -* [Localization](https://github.com/samuelgfeller/slim-example-project/wiki/Translations) - [gettext](https://www.gnu.org/software/gettext/) -* [Query Builder](https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html) -* [Integration / unit testing](https://github.com/samuelgfeller/slim-example-project/wiki/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/) - [test-traits](https://github.com/samuelgfeller/test-traits) -* [Session and flash messages](https://github.com/samuelgfeller/slim-example-project/wiki/Session-and-Flash-messages) - [odan/session](https://github.com/odan/session) -* [Error handling](https://github.com/samuelgfeller/slim-example-project/wiki/Error-Handling) - [slim-error-renderer](https://github.com/samuelgfeller/slim-error-renderer) -* [GitHub Actions](https://github.com/samuelgfeller/slim-example-project/wiki/GitHub-Actions) - and [Scrutinizer](https://github.com/samuelgfeller/slim-example-project/wiki/How-to-set-up-Scrutinizer) -* [Coding standards fixer](https://github.com/samuelgfeller/slim-example-project/wiki/Coding-Standards-Fixer) - [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) -* [Static code analysis](https://github.com/samuelgfeller/slim-example-project/wiki/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan) - -**Functionalities demonstrating real-world features:** - -* [Authentication](https://github.com/samuelgfeller/slim-example-project/wiki/Authentication) (login) -* [Authorization](https://github.com/samuelgfeller/slim-example-project/wiki/Authorization) (permissions) +* [Dependency Injection](https://samuel-gfeller.ch/docs/Dependency-Injection) - [PHP-DI](https://php-di.org/) +* [Logging](https://samuel-gfeller.ch/docs/Logging) - [Monolog](https://github.com/Seldaek/monolog) +* [Validation](https://samuel-gfeller.ch/docs/Validation) - [cakephp/validation](https://book.cakephp.org/4/en/core-libraries/validation.html) +* [Database migrations](https://samuel-gfeller.ch/docs/Database-Migrations) - [Phinx](https://phinx.org/) +* [Template rendering](https://samuel-gfeller.ch/docs/Template-Rendering) - [PHP-View](https://github.com/slimphp/PHP-View) +* [Mailing](https://samuel-gfeller.ch/docs/Mailing) - [Symfony Mailer](https://symfony.com/doc/current/mailer.html) +* [Localization](https://samuel-gfeller.ch/docs/Translations) - [gettext](https://www.gnu.org/software/gettext/) +* [Query Builder](https://samuel-gfeller.ch/docs/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html) +* [Integration / unit testing](https://samuel-gfeller.ch/docs/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/) - [test-traits](https://github.com/samuelgfeller/test-traits) +* [Session and flash messages](https://samuel-gfeller.ch/docs/Session-and-Flash-messages) - [odan/session](https://github.com/odan/session) +* [Error handling](https://samuel-gfeller.ch/docs/Error-Handling) - [slim-error-renderer](https://github.com/samuelgfeller/slim-error-renderer) +* [GitHub Actions](https://samuel-gfeller.ch/docs/GitHub-Actions) + and [Scrutinizer](https://samuel-gfeller.ch/docs/How-to-set-up-Scrutinizer) +* [Coding standards fixer](https://samuel-gfeller.ch/docs/Coding-Standards-Fixer) - [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) +* [Static code analysis](https://samuel-gfeller.ch/docs/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan) + +**Functionalities demonstrating real-world features:** + +This project is currently designed for non-profit organizations or foundations that require a platform +to manage and maintain a record of communication through notes of people they help. + +* [Authentication](https://samuel-gfeller.ch/docs/Authentication) (login) +* [Authorization](https://samuel-gfeller.ch/docs/Authorization) (permissions) * Account verification - and [password reset](https://github.com/samuelgfeller/slim-example-project/wiki/Authentication#password-forgotten) + and [password reset](https://samuel-gfeller.ch/docs/Authentication#password-forgotten) via email link and token -* [Request throttling](https://github.com/samuelgfeller/slim-example-project/wiki/Security#request-throttling) - +* [Request throttling](https://samuel-gfeller.ch/docs/Security#request-throttling) - protection against brute force and password spraying attacks * User management for administrators * 4 user roles and different permissions @@ -81,7 +81,7 @@ to manage and maintain a record of communication through notes of people they he * Note creation and mutation * Hidden notes from unauthorized users * Dashboard with panels -* [Dark / light theme](https://github.com/samuelgfeller/slim-example-project/wiki/Dark-Theme) +* [Dark / light theme](https://samuel-gfeller.ch/docs/Dark-Theme)
@@ -114,11 +114,11 @@ explanations in the documentation. But it's not just about the features. Equally important -is the [architecture](https://github.com/samuelgfeller/slim-example-project/wiki/Architecture) +is the [architecture](https://samuel-gfeller.ch/docs/Architecture) and how the components interact with each other, following modern principles such as the -[Single Responsibility Principle](https://github.com/samuelgfeller/slim-example-project/wiki/Single-Responsibility-Principle-(SRP)) +[Single Responsibility Principle](https://samuel-gfeller.ch/docs/Single-Responsibility-Principle-(SRP)) and -[Dependency Injection](https://github.com/samuelgfeller/slim-example-project/wiki/Dependency-Injection). +[Dependency Injection](https://samuel-gfeller.ch/docs/Dependency-Injection). Of course, there are big frameworks that have their own well-established set of programming conventions and implementations of features. @@ -130,7 +130,7 @@ I also dislike having to follow the propitiatory rules of a framework [which oft follow best practices](https://www.reddit.com/r/PHP/comments/131t2k1/laravel_considered_harmful) and much prefer the freedom of a micro-framework and carefully -[choosing the libraries](https://github.com/samuelgfeller/slim-example-project/wiki/Libraries-and-Framework#choosing-the-right-libraries) +[choosing the libraries](https://samuel-gfeller.ch/docs/Libraries-and-Framework#choosing-the-right-libraries) and structure that make sense for the project. This lets me stay in control of the codebase, keep it lightweight, @@ -157,13 +157,13 @@ tech. I worked closely with the software engineer and architect [Daniel Opitz](https://odan.github.io/about.html), who also reviewed this project. I learned a lot during -[our exchanges](https://github.com/samuelgfeller/slim-example-project/wiki/Sources-of-knowledge#discussions) +[our exchanges](https://samuel-gfeller.ch/docs/Sources-of-Knowledge#discussions) and was inspired by his books, articles, tutorials and his slim [skeleton-project](https://github.com/odan/slim4-skeleton). ## Support -Please read the [Support❤️](https://github.com/samuelgfeller/slim-example-project/wiki/Support❤️) page +Please read the [Support❤️](https://samuel-gfeller.ch/docs/Support❤️) page if you value this project and its documentation and want to support it. ## License diff --git a/bin/console.php b/bin/console.php index d30b4339..85835d30 100644 --- a/bin/console.php +++ b/bin/console.php @@ -3,7 +3,7 @@ * Execute a class function instantiated by the container with the command line. * The first argument is the container key and the second the function name that should be called. * Example: php bin/console.php SqlSchemaGenerator generateMySqlSchema - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Console-Commands + * Documentation: https://samuel-gfeller.ch/docs/Console-Commands */ // Boot the application diff --git a/config/bootstrap.php b/config/bootstrap.php index d7341fcd..b544b4f6 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -2,7 +2,7 @@ /** * Start up the Slim App. * - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Web-Server-Config-and-Bootstrapping + * Documentation: https://samuel-gfeller.ch/docs/Web-Server-config-and-Slim-Bootstrapping#slim-bootstrapping */ use DI\ContainerBuilder; diff --git a/config/container.php b/config/container.php index 0c6a6463..fb0422b1 100644 --- a/config/container.php +++ b/config/container.php @@ -2,7 +2,7 @@ /** * Dependency Injection container configuration. * - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Dependency-Injection. + * Documentation: https://samuel-gfeller.ch/docs/Dependency-Injection. */ use App\Infrastructure\Utility\Settings; @@ -69,7 +69,7 @@ return new BasePathMiddleware($container->get(App::class)); }, - // Logging: https://github.com/samuelgfeller/slim-example-project/wiki/Logging + // Logging: https://samuel-gfeller.ch/docs/Logging LoggerInterface::class => function (ContainerInterface $container) { $loggerSettings = $container->get('settings')['logger']; @@ -143,7 +143,7 @@ return new Settings($container->get('settings')); }, - // Template renderer: https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering + // Template renderer: https://samuel-gfeller.ch/docs/Template-Rendering PhpRenderer::class => function (ContainerInterface $container) { $settings = $container->get('settings'); $rendererSettings = $settings['renderer']; @@ -152,7 +152,7 @@ return new PhpRenderer($rendererSettings['path']); }, - // Sessions: https://github.com/samuelgfeller/slim-example-project/wiki/Session-and-Flash-messages + // Sessions: https://samuel-gfeller.ch/docs/Session-and-Flash-messages SessionManagerInterface::class => function (ContainerInterface $container) { return $container->get(SessionInterface::class); }, @@ -162,7 +162,7 @@ return new PhpSession($options); }, - // Mailing: https://github.com/samuelgfeller/slim-example-project/wiki/Mailing + // Mailing: https://samuel-gfeller.ch/docs/Mailing MailerInterface::class => function (ContainerInterface $container) { $settings = $container->get('settings')['smtp']; // smtp://user:pass@smtp.example.com:25 diff --git a/config/defaults.php b/config/defaults.php index f4e21729..bcf6e670 100644 --- a/config/defaults.php +++ b/config/defaults.php @@ -8,7 +8,7 @@ * without the risk of overwriting something. * The only file where the following is permitted: $settings['db'] = ['key' => 'val', 'nextKey' => 'nextVal']; * - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Configuration. + * Documentation: https://samuel-gfeller.ch/docs/Configuration. */ // Timezone - time() is timezone independent https://stackoverflow.com/a/36390811/9013718 @@ -24,7 +24,7 @@ $settings['root_dir'] = dirname(__DIR__, 1); // Error handling -// Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Error-Handling +// Documentation: https://samuel-gfeller.ch/docs/Error-Handling $settings['error'] = [ // MUST be set to false in production. // When set to true, it shows error details and throws an ErrorException for notices and warnings. @@ -39,7 +39,7 @@ 'version' => '1.0.0', // When true, JsImportCacheBuster is enabled and goes through all js files and changes the version number // from the imports. Should be disabled in env.prod.php. - // https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering#js-import-cache-busting + // https://samuel-gfeller.ch/docs/Template-Rendering#js-import-cache-busting 'update_js_imports_version' => false, // Asset path required by the JsImportCacheBuster 'asset_path' => $settings['root_dir'] . '/public/assets', @@ -54,7 +54,7 @@ ], ]; -// Translations: https://github.com/samuelgfeller/slim-example-project/wiki/Translations +// Translations: https://samuel-gfeller.ch/docs/Translations $settings['locale'] = [ 'translations_path' => $settings['root_dir'] . '/resources/translations', // When adding new available locales, new translated email templates have to be added as well in their @@ -64,7 +64,7 @@ ]; // Protection against rapid fire and password spraying force attacks -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Security#request-throttling +// Docs: https://samuel-gfeller.ch/docs/Security#request-throttling $settings['security'] = [ // Bool if login requests should be throttled 'throttle_login' => true, @@ -89,7 +89,7 @@ ]; // Database -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder +// Docs: https://samuel-gfeller.ch/docs/Repository-and-Query-Builder $settings['db'] = [ 'host' => '127.0.0.1', 'database' => 'slim_example_project', @@ -118,14 +118,14 @@ ]; // API endpoint settings -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/API-Endpoint +// Docs: https://samuel-gfeller.ch/docs/API-Endpoint $settings['api'] = [ // Url that is allowed to make api calls to this app 'allowed_origin' => null, ]; // Phinx database migrations settings -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Database-Migrations +// Docs: https://samuel-gfeller.ch/docs/Database-Migrations $settings['phinx'] = [ 'paths' => [ 'migrations' => $settings['root_dir'] . '/resources/migrations', @@ -145,14 +145,14 @@ ]; // Template renderer settings -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering +// Docs: https://samuel-gfeller.ch/docs/Template-Rendering $settings['renderer'] = [ // Template path 'path' => $settings['root_dir'] . '/templates', ]; // Session -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Session-and-Flash-messages +// Docs: https://samuel-gfeller.ch/docs/Session-and-Flash-messages $settings['session'] = [ 'name' => 'slim-example-project', // 5h session lifetime @@ -165,7 +165,7 @@ ]; // Logger -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Logging +// Docs: https://samuel-gfeller.ch/docs/Logging $settings['logger'] = [ // Log file location 'path' => $settings['root_dir'] . '/logs', @@ -174,7 +174,7 @@ ]; // Email settings -// Docs: https://github.com/samuelgfeller/slim-example-project/wiki/Mailing +// Docs: https://samuel-gfeller.ch/docs/Mailing $settings['smtp'] = [ // use type 'null' for the null adapter 'type' => 'smtp', diff --git a/config/env/env.dev.php b/config/env/env.dev.php index 4c75608d..3189588c 100644 --- a/config/env/env.dev.php +++ b/config/env/env.dev.php @@ -1,7 +1,7 @@ addBodyParsingMiddleware(); diff --git a/config/routes.php b/config/routes.php index 3e78e2db..3193ba5e 100644 --- a/config/routes.php +++ b/config/routes.php @@ -2,7 +2,7 @@ /** * Routes configuration. * - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Routing + * Documentation: https://samuel-gfeller.ch/docs/Slim-Routing */ use App\Application\Middleware\UserAuthenticationMiddleware; diff --git a/config/settings.php b/config/settings.php index 34c983a3..c6159662 100644 --- a/config/settings.php +++ b/config/settings.php @@ -1,7 +1,7 @@ handle($request); } // Add response headers in post-processing before the response is sent - // https://github.com/samuelgfeller/slim-example-project/wiki/Middleware#order-of-execution + // https://samuel-gfeller.ch/docs/Slim-Middleware#order-of-execution $response = $response ->withHeader('Access-Control-Allow-Credentials', 'true') ->withHeader('Access-Control-Allow-Origin', $this->allowedOrigin ?? '') diff --git a/src/Application/Middleware/PhpViewMiddleware.php b/src/Application/Middleware/PhpViewMiddleware.php index d57564fb..2887d117 100644 --- a/src/Application/Middleware/PhpViewMiddleware.php +++ b/src/Application/Middleware/PhpViewMiddleware.php @@ -18,7 +18,7 @@ /** * Adds attributes to the PhpRenderer and updates js imports with version number. - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Template-rendering. + * Documentation: https://samuel-gfeller.ch/docs/Template-Rendering. */ final class PhpViewMiddleware implements MiddlewareInterface { diff --git a/src/Infrastructure/Factory/QueryFactory.php b/src/Infrastructure/Factory/QueryFactory.php index 589cc725..4242a40a 100644 --- a/src/Infrastructure/Factory/QueryFactory.php +++ b/src/Infrastructure/Factory/QueryFactory.php @@ -12,7 +12,7 @@ * The Query factory provides methods to create queries. * * CakePHP documentation: https://book.cakephp.org/5/en/orm/query-builder.html. - * Repository and QueryBuilder: https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder + * Repository and QueryBuilder: https://samuel-gfeller.ch/docs/Repository-and-Query-Builder */ final readonly class QueryFactory { diff --git a/src/Infrastructure/Service/Mailer.php b/src/Infrastructure/Service/Mailer.php index c926926d..2b9c3c37 100644 --- a/src/Infrastructure/Service/Mailer.php +++ b/src/Infrastructure/Service/Mailer.php @@ -12,7 +12,7 @@ /** * Mailer class with added method to get the html string from a template and added logging in the send() function. * Test sender score: https://www.mail-tester.com/. - * Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Mailing. + * Documentation: https://samuel-gfeller.ch/docs/Mailing. */ final readonly class Mailer { diff --git a/tests/Trait/AppTestTrait.php b/tests/Trait/AppTestTrait.php index e1c24abc..370d7443 100644 --- a/tests/Trait/AppTestTrait.php +++ b/tests/Trait/AppTestTrait.php @@ -14,7 +14,7 @@ /** * Initialize slim app for testing. * Traits "extend" the class that include them (via "use TraitName;") with their content. - * Test traits: https://github.com/samuelgfeller/slim-example-project/wiki/Test-setup#test-traits. + * Test traits: https://samuel-gfeller.ch/docs/Test-Setup#test-traits. */ trait AppTestTrait {