express-admin-block
Still in alpha testing.
A simple Express (4.0+) middleware for rendering an admin page, directly connected to your MongoDB database.
Current user is checked with req.user
The goal is to be a drop-in admin panel for Express apps.
You can add custom fields and will soon be able to add custom charts.
Made with Bootstrap 4, DataTables and Chart.JS.
Features
Who uses it?
|
|
|
|
Nucleus | ElioPay | Backery | Litch.app |
👋 Want to be listed there? Contact me.
Usage
Install the library
npm i express-admin-block
Include it in your app like this:
db
represents an object of Mongoose schemas.
app.use('/admin', require('express-admin-block')({
adminEmails: ['webmaster@website.com'],
data: [{
name: 'Users',
type: 'mongoose',
mongo: db.User,
toShow: ['email', 'registered', 'plan'],
dateField: 'registered'
}, {
name: 'Apps',
type: 'mongoose',
mongo: db.TrackedApp,
toShow: ['name', 'created', {
name: 'Parent user':
render: async (app) => {
let user = await db.User.findById(app.parentUser).exec()
return user.email
}
}],
dateField: 'created'
}]
}))