
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@shagital/adonisjs-crud-generator
Advanced tools
Adonisjs Admin Panel Generator is a package that helps you quickly scaffold your typical CRUD admin interfaces. It generates the admin panel code based on the existing (migrated) table in the database
This package allows you easily generate admin dashboard for your existing AdonisJS app. The package generates the following:
You can install the package via NPM:
npm install @shagital/adonisjs-crud-generator
Or with yarn
yarn add @shagital/adonisjs-crud-generator
adonis acl:setup
to create role permission migrationsadonis crud:init
to generate default files for admin paneldatabase/migrations/admin_default_role_permission.js
to see the password. You can also change password after loginconfig/crudGenerator
to specify admin modelstatic get traits () {
return [
'@provider:Adonis/Acl/HasRole',
'@provider:Adonis/Acl/HasPermission'
]
}
adonis key:generate
to generate App keyconfig/auth.js
and change authenticator to jwt
config/shield.js
. Under csrf section, set enable to false
config/auth.js
and change authenticator to session
config/shield.js
. Under csrf section, set enable to true
start/kernel.js
and make sure 'Adonis/Acl/Init'
is in the globalMiddleware arraystart/kernel.js
, add the following to namedMiddleware
:is: 'Adonis/Acl/Is',
can: 'Adonis/Acl/Can',
requestType:'App/Middleware/RequestTypeMiddleware'
start/app.js
, make sure the following exists in providers
array:'adonis-acl/providers/AclProvider',
'@adonisjs/validator/providers/ValidatorProvider'
start/app.js
, add the following to alias array:Role: 'Adonis/Acl/Role',
Permission: 'Adonis/Acl/Permission',
start/app.js
, add the following to commands
array:'@shagital/crud-generator/src/Commands/CrudInitCommand',
'@shagital/crud-generator/src/Commands/CrudGeneratorCommand',
'@shagital/crud-generator/src/Commands/PermissionMigrationGeneratorCommand',
'@shagital/crud-generator/src/Commands/ControllerGeneratorCommand',
'@shagital/crud-generator/src/Commands/ModelGeneratorCommand',
'@shagital/crud-generator/src/Commands/ViewGeneratorCommand',
administrator@webmail.com
. You can change the email before running migrationadonis migration:run
to create admin user and set up roles and permissionsadonis serve
cd /resources/views/admin
npm install
or yarn install
to install dependenciesnpm run dev
or yarn dev
to start the admin app in development modeTo generate CRUD management for table regions
, run adonis crud:generate regions
and the following will be created
app/Controllers/Http/Admin/RegionController
start/routes.js
file will be updated with new routesRegion
model will be created with appropriate relationships, getters, setters and hooksNavigate to your app and you should see the Region menu on the sidebar
adonis crud:controller tableName
: This creates controller file and routeadonis crud:model tableName
: This creates model file with relationshipsadonis crud:permission tableName
: This creates migration file for crud permissionsadonis crud:view tableName
: This creates vue filesadonis crud:init tableName
: This runs all of the above commands--connection
: This option allows you specify which DB connection to use for the command e.g
adonis crud:controller tableName --connection=sqlite
NB: The connection must have been defined in
config/database.js
--migrate
: This option is available for the crud:generate
and crud:permission
commands. It tells the system to automatically run the migration after creation.--prefix
: This option is available when initialising the CRUD with crud:init
. It allows you specify a prefix for the admin endpoints that'll be created. If not specified, the system generates a random prefixRun npm run build
or yarn build
http:<BASE_URL>/admin
Note: In running the commands, if you don't have adonis CLI installed globally, you can use
node ace
instead. For example, to generate CRUD for table posts, runnode ace crud:generate posts
If an error occurs while executing any of the command, it'll crash. Simply check your log to find out what went wrong - likely a file/directory permission issue, then run the command again.
Note: The commands always overwrite existing files (with same name)
If you have a feature you'd like to add, kindly send a Pull Request (PR)
If you discover any security related issues, please email zacchaeus@shagital.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
FAQs
Adonisjs Admin Panel Generator is a package that helps you quickly scaffold your typical CRUD admin interfaces. It generates the admin panel code based on the existing (migrated) table in the database
We found that @shagital/adonisjs-crud-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.