Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including graojs with all npm packages installed. Try it out:

var graojs = require("graojs")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

graojs v1.0.13

graoJS - A full stack MVC NodeJS framework

graoJS

graoJS - A full stack MVC NodeJS framework

This project is a scaffolding generator code, based on angularjs, twitter bootstrap, pug, express, mongoose and mongoose-validator.

INSTALL DEPENDS

  • https://nodejs.org/en/download/package-manager/
  • https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

graoJS install and run:

sudo npm install -g graojs
service mongodb start
grao generate:app demo --name demo --description demo --author-name Marcelo --author-email marcelomf@gmail.com --server-ports 8015,8016 --template-engine pug --theme bootstrap --mongodb-host localhost --mongodb-db grao
cd demo
grao main:create:admin --username admin --name Admin --email admin@admin.localhost --password admin123
node index.js

Create your schemas

  • Create gen/Person.json
{
    "bundle": "cadastre",
    "label": "Persons",
    "description": "All people",
    "refLabel": "name",
    "fields": {
        "id": {
            "label": "Id",
            "type": "primary"
        },
        "name": {
            "label": "Name",
            "type": "text",
            "required": true,
            "isList": true,
            "isFilter": true
        },
        "email": {
            "label": "Email",
            "type": "email",
            "unique": true,
            "required": true,
            "isList": true,
            "isFilter": true
        },
        "born": {
            "label": "Born",
            "type": "date"
        },
        "sex": {
            "label": "Sex",
            "type": "radio",
            "options": { "marculine": "Masculine", "feminine": "Feminine" }
        },
        "news": {
            "label": "Receive newsletter ?",
            "type": "checkbox",
            "value": "IS_NEWS",
            "attr": {"multiple": true}
        },
        "address": [{
            "type": {
               "label": "Type",
               "type": "select",
               "options": { "residence": "Residence", "comercial": "comercial" },
               "required": "true"
            },
            "principal": {
               "label": "Principal",
               "type": "checkbox",
               "required": "true"
            },
            "address": {
               "label": "Address",
               "type": "textarea",
               "required": "true"
            }
        }]
    }
}
  • Generate scaffolding(CRUD):
grao generate:bundle --schemas Person --force
  • Start graojs:
node index.js
  • Access Person in your browser: http://localhost:8015/admin/person
  • Others examples(with relashionships) of schemas: https://github.com/marcelomf/graojs/tree/master/gen_examples

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free