0.3.3 • Published 5 years ago

express-admin-page v0.3.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

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: ['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', { // 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'
	}]
}))
0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago