https://github.com/josecelano/framework-kata
A DDD friendly and no vendor framework for katas with extra React and Vue style backend components
https://github.com/josecelano/framework-kata
ddd framework kata php
Last synced: about 2 months ago
JSON representation
A DDD friendly and no vendor framework for katas with extra React and Vue style backend components
- Host: GitHub
- URL: https://github.com/josecelano/framework-kata
- Owner: josecelano
- Created: 2017-10-30T07:38:06.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-30T07:55:25.000Z (over 7 years ago)
- Last Synced: 2025-04-01T21:54:37.281Z (about 2 months ago)
- Topics: ddd, framework, kata, php
- Language: PHP
- Size: 59.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Framework kata
## Goal
1. Build a framework from scratch. A DDD friendly framework.
2. Have a skeleton framework for web app katas that requires no third-party packages.
3. Proof of concept for PHP components like JS components (React & Vue).Regarding goal 3, I have always wondered why frontend template libraries have evolved to use classes and backend template libraries (at least in PHP) continue using plan php files (directly PHP or compiled templates).
I think I could be useful to have classes because we could:
* Test templates easily.
* Identify easily template data dependencies.
* Avoid runtime errors when templates receive wrong data types.
* Increase templates re-usability. You can use your components with different frameworks.
* Increase usability. Templates could load their data, avoiding controller bottleneck.There are some frameworks (like Laravel) that have "view composers" but I think there are not reusable for different projects and there are no easy to use. And they do not allow to pass data from the view to the class, I mean the component class can not receive data from the parent template.
## Install
```
[email protected]:josecelano/framework-kata.git
cd framework-kata
mysql -h "localhost" -u "root" "-pXXXXXXXX" < database/database.sql
composer install
```* Initialize your database setting in file: `./app/database.php`
## Run
Server:
```
cd public
php -S localhost:8000 server.php
```Unit tests:
```
composer run test
```Acceptance tests:
```
composer run acceptance
```## Console commands
Create user:
```
php -f ./app/console.php create-user "username" "email" "passwrod"
php -f ./app/console.php create-user "josecelano" "[email protected]" "1234"
```## TODO
* Testing.
* Use decorator pattern instead of inheritance for components that extend other components (A, Alert, Page, ...)