npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

schemaui

v1.3.1

Published

<p align="center"> <img src="https://user-images.githubusercontent.com/7160836/98726793-a500d700-239f-11eb-8d32-f85821e0fbbe.png" /> </p>

Downloads

20

Readme

Turn every mongoose schema, into a shiny, slick, good looking UI, that will help you manage fully CRUD operations to your registered models.


NPM version Build Status codecov.io dependencies

Installation

Just import SchemaUI package, register your models, and

Schema UI code

SchemaUI should be installed with few little steps:

  1. Import Schema UI
const SchemaUI = require('schemaui');
  1. Initialize Schema UI with options (TBD)
SchemaUI.init({});
  1. Register your model
SchemaUI.registerModel(YOUR_MODEL);
  1. Connect the middleware to your app
app.use('/schemaui', SchemaUI.middleware());
  1. Visit your new dashboard! go to: http://YOUR-URL/schemaui

At the moment it's not possible to change the schemaui path, we're working on making it dynamic.

The result

Intuitive, responsive, generic CRM dashboard, that created to help you manage your models

SchemaUI Dashboard

Documentation

SchemaUI.init([options])

options (optional) - global options for SchemaUI instance (TBD)

| Property | Type | Description | :--- | :--- | :--- | auditLog | Boolean | (optional) allow audit_log for create, edit, delete for the registered models. default: true

Example

SchemaUI.init({
    auditLog: false // disable audit log for all models
})

SchemaUI.registerModel(Model, [options])

this method should be called multiple times, for every model that you wish to include in the admin UI

Model - A single mongoose model you wish to include in the generated UI

options (optional) - An object with properties, that define set of options per single model (collection)

| Property | Type | Description | | :--------- | :--- | :--- | | listFields | String[] | (optional) array of strings that defines which fields to display per item in the items view | | fields | Object | (optional) define properties that exist in the schema for custom options per field | | permissions | Object | (optional) set of permissions (read,create,edit,delete) with Boolean values. |

Example

SchemaUI.registerModel(Image, {
    listFields: ['title', 'type', 'isActive'], // fields that present before expanding
    fields: { // define explicit options per field
        'description': {
            textarea: true // make the description field auto-expand, behave like textarea
        }
    },
    permissions: { // define permissions per model
        read: true, // readonly
        create: false,
        edit: false,
        delete: false
    }
});

SchemaUI.middleware()

Initiates express router that injects the admin UI into your existing app.

Schema UI middleware must be under /schemaui route, any other route will not be able to load SchemaUI's admin panel

Demo

Live demo & source code can be found here