express-admin-page

v0.3.3
Admin page for Express + Mongoose to monitor your app send updates to users

express-billing-page

Still in alpha testing.

A simple Express (4.0+) middleware for rendering an admin page, directly connected to your database.

Made with Bootstrap 4, DataTables and Chart.JS.

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.

Features

  • Render a table for your data
  • Choose fields to display
  • Chart for evolution over time
  • Broadcasting function: send emails to all users
  • Broadcast emails to select users
  • Edit select users

Usage

Install the library

npm i express-admin-page

Server code:

app.use('/admin', require('express-admin-page')({
    adminEmails: ['[email protected]'],
    data: [{
        name: 'Users',
        type: 'mongoose',
        mongo: db.User,
        toShow: ['email', 'registered', 'plan'],
        dateField: 'registered'
    }, {
        name: 'Apps',
        type: 'mongoose',
        mongo: db.TrackedApp,
        toShow: ['name', 'created', { // Can either be strings (properties of your documents) or objects that include a 'render' **async** function
            name: 'Parent user':
            render: async (app) => {
                let user = await db.User.findById(app.parentUser).exec()
                return user.email
            }
        }],
        dateField: 'created'
    }]
}))
npm i express-admin-page

Metadata

  • MIT
  • Whatever
  • Unknown
  • released 7/10/2019

Downloads

Maintainers