jetkit
Dynamic website generator. Work in progress
Last updated 4 years ago by jacoborus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jetkit 
SYNC missed versions from official npm registry.

JetKit

Work in progress

Dynamic website generator

Built on top of:

  • Express - server middleware
  • Mongoose + node-validator - DB, ORM and validation
  • Hardwire - app container
  • Wiretree - dependency injection container
  • Passport - Multiservice auth
  • Jade - Template engine
  • deep.json - config loader
  • curlymail - SMTP mailer and mail template engine with mustaches support
  • miniruler - Roles, levels and permissions
  • node-cron - cronjobs
  • ¿?¿? - Handle errors and logs

Requirements

Node.js and MongoDB

Quick start

Install

Initialize a npm proyect and install JetKit as dependency (it requires a package.json):

mkdir myapp && cd myapp
npm init
npm install --save jetkit

Boilerplate

JetKit postinstall script add 2 scripts to your package.json: jk-boilerplate and jk-initdb, run the first one in order to generate your app structure folder (/app) and a launcher (app.js)

npm run jk-boilerplate

Database

You must configure your database connection before run your app. Open /app/config/default.json and add your credentials into mondgodb section.

Then create a user in DB:

npm run jk-initdb

Start app

Run your app:

npm start

App structure

JetKit is structured in blocks, and block are composed by public files, views and/or plugins.

Blocks

Blocks folder structure:

  • config
  • controllers
  • lib
  • models
  • public
  • routes
  • services
  • utilities
  • views

Plugins

See Wiretree

Configurations

Configuration is exposed in tree as config. Their files are stored in /config.

See deep.json

Public files

Public files are stored in /public folder in blocks, and by default available through HTTP under /_public URLs. JetKit creates also 3 folders in public folder: js, css and img

Views

Views are not exposed in tree. Their files are stored in /views. Views are jade templates

Routers

Routes are not exposed in tree and their files are stored in /routes

Controllers

Controller files are stored in /controllers.

Exposed in group control with its file name as keyname, and under tree root with suffix Ctrl

Models

JetKit uses Mongoose models stored in /models folder.

Exposed in group models with its file name as keyname, and under tree root with suffix Model.

3 types of models:

Collections

Collections are pure Mongoose models with its entirely API, and their files are stored in /models/collections

Subcollections (not implemented yet)

Subcollections are collections stored into a single document into _keyval collection.

Subcollection document schemas are stored in /models/subcollections folder

Singles

Singles are models that contain a single document and their files are stored in /models/singles.

Simplified API: read and update

Libraries

Libraries are not exposed in tree.

Their files are stored in /lib

Services

Service plugins are stored in /services.

Exposed in group services with its file name as keyname, and under tree root with suffix Srv.

Core services:

mailer

See Curlymail

ruler

See miniruler

log

Logger (¿?¿?¿?¿?)

fm

File manager.

Routing

Main

GET		/					Home page

User

GET		/user/login			    Login page
GET		/user/logout		    Login page
POST    /user/login             Post login credentials
GET     /user/forgot-password   Forgot password view
POST    /user/forgot-password   Post forgot password credentials
GET     /user/forgot-error      Error recovering password view
GET     /user/restore/:hash     Restore password form view
POST    /user/restore/:hash     Post new credentials recovering password
GET     /user/password-restored Restored password ok view

Admin API

GET		/admin							Admin dashboard
// collection docs
GET		/admin/collection/:model				List/Search documents of model :model
GET		/admin/collection/:model/new			New doc view
POST	/admin/collection/:model				Create new doc
GET		/admin/collection/:model/:id			Read doc
GET		/admin/collection/:model/:id/edit		Edit doc view
PUT		/admin/collection/:model/:id			Update doc
DEL		/admin/collection/:model/:id			Destroy doc
// single docs
GET		/admin/single/:model/:id/edit	Edit doc view
PUT		/admin/single/:model/:id		Update doc




© 2015 Jacobo Tabernero - jacoborus

Released under MIT License

Current Tags

  • 0.0.15                                ...           latest (4 years ago)

15 Versions

  • 0.0.15                                ...           4 years ago
  • 0.0.14                                ...           4 years ago
  • 0.0.13                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           4 years ago
  • 0.0.2                                ...           4 years ago
  • 0.0.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 15
Dependencies (29)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |