This is a clone of the official web application https://github.com/yiisoft/app
What was added/modififed:
- CSS Bootstrap was added and the main menu was created
- Rendered using
Yiisoft\Yii\Widgets\Menufrom https://github.com/yiisoft/yii-widgets
- Rendered using
- Added more containers (mainly MariaDB) to
docker/dev/compose.yml- Added more env variables to
docker/.env
- Added more env variables to
- MariaDB is used, migrations were enabled in CLI, password hashing, Annotations and Repository were engaged.
- REST API enabled. See
config/common/routes.phpandsrc/Api.- Some middleware was moved from
config/web/di/application.phptoconfig/common/routes.php - ... because session and CSRF are only needed in the web application
- Note: Error "422 Unprocessable entity" = missing CSRF token
- Note: Error "Formatter is not set" = the API does not know whether XML or JSON should be returned. See the
solution in
config/common/routes.php.
- Some middleware was moved from
- REST API endpoints added
- / = Lists all the users
- /login = validates the login and creates the bearer token
- Use this data in the POST request: { "username": "admin", "password": "admin" }
- /bearer = tests if the correct bearer token is in the POST request
- Use the "Bearer Token" Auth Type in Postman on the Authorization tab.
- Enabled step debugging via xDebug
- The first attempt at the user-CRUD implemented. Only routes index & view work.
- Font Awesome added (via CDN)
- GridView used to display list of users
TODO:
- Filter in the GridView should be an array:
<input name="filter[id]" ...>. But it may not be possible. See renderFilter() in DataColumnRenderer. - Study all the files in the
src/Api/Sharedfolder. Are they needed? I just copied them from the API demo. - Use ActiveRecord
- Show usage of https://htmx.org/
- Implement user management
- Add language and timezone selection to the main menu, save them to the user profile
- Place the language-code at the beginning of the URL?
- Implement translations and localization (datetime format, numbers, etc.)