GithubHelp home page GithubHelp logo

tonyenerson / schemaui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from slocking/schemaui

0.0 0.0 0.0 2.28 MB

Schema UI - Headless Node.js & Vue Management Dashboard

Home Page: https://schemaui.herokuapp.com

License: MIT License

JavaScript 52.42% HTML 1.01% Vue 46.57%

schemaui's Introduction

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

schemaui's People

Contributors

molaga avatar or-bd avatar dependabot[bot] avatar tonyenerson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.