- MySql: 5.5
- Node.js: >=4.2.6
- mysql
- NPM: >=3.5.2
- Bower: >=1.7.9
- Configure NodeJs Env.
- Clone project file in the PATH_TO_PROJECT_IN_SERVER.
cd PATH_TO_PROJECT_IN_SERVER
npm install
bower install
cp .env.example .env
- Create a DB in Mysql Server (DB_NAME)
- Change database connection in .env file: DB_NAME, DB_HOST, DB_PORT, DB_USER, DB_PASSWORD
- Run the migration rollback (if already exist data):
./ace migration:rollback
- Run the migration:
./ace migration:run
- Run the seeders:
./ace db:seed
- Initiate the Server:
npm run serve:dev
- Default user: [email protected]
- Default Password: 123456
- AdonisJS 3.2
- MySQL
- JQuery
- Twitter Bootstrap
This repository is a pre-configured project structure taken from Adonisjs.
This project includes the CRUD and ACL for users. The ACL module has four (4) sections: permissions, roles, Permissions-roles and User-role. Let's see how to work with them!
The greatest thing is you can hide element inside a view (like menu options) by calling a global listener:
#!nunjucks
{% if hasRole(old('my_roles'), 'super_admin') %}
<li>{{ linkTo('/users', 'Users') }}</li>
<li><a>ACL<span class="fa fa-chevron-down"></span></a>
<ul class="nav child_menu">
<li class="sub_menu">{{ linkTo('/permissions', 'Permissions') }}</li>
<li>{{ linkTo('/roles', 'Roles') }}</li>
<li>{{ linkTo('/permissions-roles', 'Permissions-Roles') }}</li>
<li>{{ linkTo('/users-roles', 'User-Role') }}</li>
</ul>
</li>
{% endif %}
HasRole(a,b) is a listener defined by me to check if a role_slug belongs to an authenticated user.