-
Notifications
You must be signed in to change notification settings - Fork 11
Home
BEdita Manager (aka BEM, or Manager) is the official Web application for BEdita API.
This page contains BEM informations for developers.
You can create project via composer or download a release archive file.
To create project via composer:
composer create-project bedita/managerThis will create a new manager folder and install composer dependencies.
To create project from a release archive file, you choose the archive from the Manager Releases and download .zip or .tar.gz release file.
Unpack it and then run composer install.
Build JS/CSS bundles with yarn
yarn
yarn build-plugins
yarn buildManager document root is /webroot folder.
You can configure a virtual host on webserver to serve manager document root.
Apache example:
<Directory /var/www/manager>
Require all granted
AllowOverride All
</Directory>
<VirtualHost *:80>
ServerName dev.manager.localhost
DocumentRoot /var/www/manager/webroot
</VirtualHost>
Nginx example:
server {
listen 80;
listen [::]:80;
server_name dev.manager.localhost;
root /var/www/manager/webroot;
index index.html index.php;
# ...
}
You can run manager using yarn and webpack proxy.
Edit config/.env, i.e.:
WEBPACK_PROXY_HOST=dev.manager.localhost
WEBPACK_PROXY_PORT=80
Then, launching yarn run dev will open a browser window proxing your dev.manager.localhost to localhost:3000, i.e.:
$ yarn run dev yarn run v1.22.11
webpack --mode development --hot
--------------------
Development Bundle
--------------------
[...]
[Browsersync] Proxying: http://dev.manager.localhost:80
[Browsersync] Access URLs:
--------------------------------------
Local: http://localhost:3000
External: http://192.168.1.184:3000
--------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
--------------------------------------This way, you'll have page auto reload on js and scss changes.
Configuration main file is config/app.php. You can customize configuration by editing config/app_local.php (or in config/projects/<projectName>.php if you use multi project configuration).
Every module can have a configuration overriding the default; you can modify config/app_local.php as explained in Modules configuration.
Api Proxy configuration is used to allow or block specific API endpoints methods. You can decide which methods are allowed or blocked per endpoint. Default is to trust methods by /api/home response, considering hints.allow values. See ApiProxy.
Module access control can be set by role. Look at Module access by role.
You can edit properties display configuration to change the properties organization in templates. For more details, see Properties display.
To customize upload restrictions, you can set uploadAccepted and uploadForbidden configurations. For more details, see Upload.
A BEM instance can use multiple APIs (Projects). How? see Multi project.
You find BEM tests in tests folder.
You can run tests against a docker BEdita API (versions 4 or 5).
Check the latest release of bedita/bedita at BEdita Releases.
Run the latest bedita/bedita docker image available:
docker run -p 8090:80 \
--env BEDITA_API_KEY=1234567890 \
--env BEDITA_ADMIN_USR=beditatest \
--env BEDITA_ADMIN_PWD=beditatestpwd \
bedita/bedita:4or
docker run -p 8090:80 \
--env BEDITA_API_KEY=1234567890 \
--env BEDITA_ADMIN_USR=beditatest \
--env BEDITA_ADMIN_PWD=beditatestpwd \
bedita/bedita:5Create a tests/.env file with proper environment variables, i.e.:
# local docker
export BEDITA_API="http://127.0.0.1:8090"
export BEDITA_API_KEY="1234567890"
# Set admin credentials
export BEDITA_ADMIN_USR="beditatest"
export BEDITA_ADMIN_PWD="beditatestpwd"
Run tests:
composer run test // this runs all tests
vendor/bin/phpunit tests/TestCase/Controller/AppControllerTest.php // this runs tests in a single fileHigh level tests should be always performed by developers, anytime something changes, expecially with code refactoring. Look at Tests Cases.