ebas is a lightweight user friendly mysql content manager.
Url: https://janikvonrotz.ch/ebas
Login with
User admin@ebas.ch
Password ebas
Or
User login@ebas.ch
Password ebas
- Excel like table edit
- Authentication for editor and admin users
- Export data to CSV
- Simple sort and search functionality
- Add custom events for your workflow
- Customizable dropdown for foreign key resolution
- Everything is customizable (see config chapter)
- Responsive and touch friendly
To make this application work with your existing database, it has to meet the follwing requirements:
- ID must be the first field on every table
- ID must be an Auto Increment
First of all, you have to install Npm which is part of Node.js.
Afterwards you can install the required tools with Npm on your command line:
Bower > npm install bower -g
and
Grunt > npm install grunt-cli -g
.
If you have installed all these tools, start to set up the project from your command line by running these commands:
bower install
grunt
The application is now ready to run.
As you should have seen this guide doesn't cover any webserver nor mysql installations. You have to do that on your own. Checkout the guide from Janik von Rotz.
Now it's time to edit the configuration file so the application works with your database.
Create a copy of the config file and update it (see the Config chapter).
config-example.json > config.json
At this point you have to consider security restrictions. It's very important that you prevent the configuration files from being access. We recommand you to use at least the following Nginx access rules:
location ~* \.(json)$ {
deny all;
}
location ~* /(node_modules|bower_components)/ {
deny all;
}
This configuration will restrict access to any .json configuration files of this project and also denys access the development folders, which might contain code you are not aware of.
Update config.json
based on your database fields and functions.
user
MySQL database userpassword
MySQL database user passwordserver
MySQL database servernamedatabase
MySQL database containing the tables to displaytable[]
Contains a configuration part for each table to display
name
Displayname for the table of your choicesqlname
SQL table namesqlstart
Start of SELECT query for this tableoptions
Display options for this tablehide
Hide the tableadminonly
Only give access to admin users
fields[]
Contains definitons for each field to displayevents[]
Tasks to trigger on specific events
name
Displayname for the field of your choicesqlname
SQL field namesqldropdown
Contains a SELECT statement, which acts as a foreign key display in the end. The first field has to be the ID of the foreign table, the foreign key in this field then will be replaced by a dropdown list containing the other fields of this statement.options
Display and process options for this fieldcontenteditable
Allow edit on this fieldrunfunctiononce
Run the process function only once
function
MySQL function to run when value is added to the databse, use%VALUE%
as placeholder
Events are tasks with different conditions that can be triggered on specific actions.
In the PHP code you can add a trigger with the following snippet:
$result = runEvents("tablename","task-Bereinigunglauf",elementid);
Then in the config file you have to associate the trigger with optional conditions and a task.
trigger
Name of the event, which is being triggered on specific locations in the codecondition
Contains conditions that have be true in order to run the event taskistable
Condition where table name must be the value
task
Definition of the event task
Whenever a data row is deleted this trigger is called.
This trigger is associated with the example task on the task page.
name
Name of the task to run
This task copies the values of the current table to another table.
totable
Name of the destination tablefieldmap[]
Tell which field should be copied to a field in the destinationsource
Fieldname from the current tabledestination
Fieldname from the destination table
This task deletes items based on the rule where specific fields in a table hold the same value as the items to delete.
sourcetable
Table containing the reference data setsdeleteontable
Table containing the data sets to delete, referenced by the source tablefieldmap[]
Define match rules for the delete referencesource
Field holds the values to identify the elements for Deletion in the delete tabledestination
Field holds the value which are identified by the source field