Dynamic CRUD in seconds with good code quality and NoSQL flexibility.
- Email registry
- Account edit form
- User Management
- Bootswatch themes
- Password change form
- Access by token
- Web responsive
- Flexible/Extensible with plugins
- Android app ready
- Continuous integration (mocha, protractor)
- JS and CSS minify
- AngularJS FrontEnd
- Socket.IO ready
- Templates support with pug
- Sanbox mode
- Dynamic form generation
Configuration over Convention.
Know and edit the configuration of the project and control the foundations.
vi config.jsonMain database of the project. Every plugin has their own db url.
"dburl": "mongodb://127.0.0.1/core""site": "Core App""port": {
"web": 1344,
"api": 1345,
"rds": 6379
}Change the index file editing the INDEX property.
By default app search files in 'view' folder but you can write relative or absolute paths.
"INDEX": "plugins/plugin-name/folder/file.pug"Add your sendgrid token:
# .zshr or .bashrc
export SENDGRID_TOKEN=mysecret"URL": {
"BASE": "http://core.monoapps.co",
"ACK": "/api/email/confirm/"
}"APIVARS": {
"PRE": "/",
"ID": "/:id",
"PLUGINS": { // plugins definition for core
"DIR":"/plugins", // base folder for plugins
"MAIN": "/plugin.js", // main file per plugins
"VIEWS": "/views", // views folder of the plugins
"CONFIG": "/config.json" // configuration file of the plugins
}
}#config.json
32"plugins": [
"wizard" // github submodule on plugins folder
33]### pages Public pages. Unrestricted access and main file located at {name}/index.pug
"pages":[
"account",
"recover",
"registered",
"docs",
"dev"]One json definition for models/api/views/cruds.
"resources": {
"rname": {
"admin": true, // filter, indicates that only (user.admin = true) is able to access this info
"param": "token", // name of the param in single
"clean": {"password": 1}, // filter to hide keys on the view
"exclude": false, // Indicates to include or not in the view, if false the model can be access but without api or web routes
"schema": { // filter for specific params from view form hat will be accepted
"name": 1,
... // more keys
}
}
...
}We have written a lot of filters like:
helpers/filters.js # admin, schema, author, cleaner
helpers/base.js # controller base who knows his own model
helpers/email.js # send emails
helpers/generator.js # add api and web (pages[no auth] and views[auth crud view])
helpers/inspector.js # helper for dynamic plugin creation
helpers/manager.js # filter auth request and prepare response
helpers/models.js # helper for models defined on plugins and core
helpers/ps.js # helper for redis pub/sub
helpers/utils.js # helper for password and auth
helpers/zappy.js # middleware between response and controllerUpdates are welcome. DropDB or DropCollection need a review.
node migrations/seed.js
# drop current database and insert all defaultsAdd your own data
#Roles must be defined in config.json
#Replace 'collection' with your new model
var #{collection} = require('migrations/data/#{collection}.json');
persist(#{collection}, db.#{collection});./refresh.shAdd your missing forms.
# Run wizard to create forms
gulp autoformEnable autoform by default
//config.json
autofom: true// vi migrations/data/settings.json
"user": ["tasks"] // menu for normal user
"admin": ["users"] // menu for admin user## themes
// vi migrations/data/settings.json
"themes": [{"name": "the name", "css": "{URL}.min.css" }]Add the guest user.
//config.json
#This will show the button to enter as guest.
#Be carrefoul with this because user and passw will be visible.
#Do not enable unless you really want all allow access to the whole world.
guest.enabled = true;node migrations/guest.jsCreate normal users: register your own email.
Be admin just setting something like:
mongo
>use coreapp
>db.users.update({email: '[email protected]', admin: true});## writing plugins
See wizard sample
Add plugins on config.plugins.
Prevent network visibility enabling the trusted mode
# web/routes.js
18 web.use(middleware.trusted);Write your allowed ips.
#config.js
15 "ALLOW": ["127.0.0.1"],npm install istanbul mocha-istanbul -g
make covUse nginx config to deploy. If needed add the hostname domains on /etc/hosts file.