assasz / rmr
Implementation variant of RMR architecture.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Type:project
Requires
- php: ^7.4
- ext-json: *
- cakephp/collection: ^3.8
- doctrine/orm: ^2.6
- filp/whoops: ^2.1
- haydenpierce/class-finder: ^0.4.2
- moneyphp/money: ^3.3
- symfony/config: ^5.0
- symfony/console: ^5.0
- symfony/dependency-injection: ^5.0
- symfony/dotenv: ^5.0
- symfony/http-foundation: ^5.0
- symfony/property-access: ^5.0
- symfony/property-info: ^5.0
- symfony/serializer: ^5.0
- symfony/validator: ^5.0
- symfony/yaml: ^5.0
- twig/twig: ^3.0
- zircote/swagger-php: ^3.0
Requires (Dev)
- justinrainbow/json-schema: ^5.2
- nelmio/alice: ^3.6
- phpunit/phpunit: ^9
- roave/security-advisories: dev-master
This package is auto-updated.
Last update: 2025-03-01 00:31:16 UTC
README
More about this exact architecture here. Code above is my own implementation variant, which came to life as a result of long nights in quarantine ;) It's still under development, though.
I would rather call it ROR (Resource-Operation-Representation) architecture, where controller logic is moved from resources to separate classes, Operations. They follow Request Handler pattern and actually act like Action components known from ADR architecture.
Installation
Via Composer:
composer create-project assasz/rmr=dev-master
cd rmr
cp .env.dist .env && cp .env.test.dist .env.test
Set up the database:
# .env
DATABASE_URL='mysql://user:secret@localhost/mydb'
./vendor/bin/doctrine orm:schema-tool:create
./vendor/bin/doctrine orm:schema-tool:update --force
Set up test environment:
# .env.test
DATABASE_URL='mysql://user:secret@localhost/mydb_test'
BASE_URI='http://localhost'
Utilities
Load fixtures for specified environment (dev
by default):
php bin/console app:load-fixtures --env=dev
Generate basic API for existing resources:
php bin/console app:generate-api
Generate OpenAPI docs into YAML file:
./vendor/bin/openapi --output openapi/openapi.yaml src/ public/