kites
Template-based Web Application Framework
Kites is a framework providing dynamic applications
assembling and Template-based
extracting. Namely it contains a lot of templates and extensions to help building a new application quickly.
Installation
# install kites cli $ npm install -g @kites/cli # init a project kites init my-project --template mvc # move to project workspace cd my-project # install dependencies npm install # run app server, navigate browser at http://localhost:3000 npm start
Development environment:
# start project in development mode npm run dev
To change environment use cmd set NODE_ENV=development
or use options your IDE provides. If you don't specify node environment kites assumes development
as default.
Documentation
- See Overview for an overview of concepts, guides and general documentation.
- See Templates for installation guides how to create a new project based on Kites Templates.
Templates
Here is the list of built-in templates and their implementation status:
-
mvc
: Assembling all into complete ship (default) -
basic
: Template for building from scratch -
apidoc
: Template for API Documentation -
express
: Template for Express Application -
chatbot
: Template for generating an AI Chatbot
More templates, checkout issue #1
Extensions
Kites is an eco-system and has many modules which can be assembled into a larger application. You are welcome to write your own extension or even publish it to the community.
TODO:
- Write an article for implementing custom kites extension
Extensions auto discovery
Kites by default auto discovers extensions in the application's directory tree. This means kites
by default searches for files kites.config.js
which describes the extensions and applies all the extensions that are found.
// let kites autodiscover the extensionsvar kites = logger: console: transport: 'console' level: 'debug' ); // init the kiteskites
Kites extensions auto discovery slows down the startup and can be explicitly using use
function with mode discover: false
// do not let kites autodiscover the extensions// do not load extensions from locations cachevar kites = discover: false extensionsLocationCache: false logger: console: transport: 'console' level: 'debug' ); // explicitly use extensionskites
Logging
kites leverages winston logging abstraction together with debug utility. To output logs in the console just simply set the DEBUG environment variable
DEBUG=kites node app.js
on windows:
set DEBUG=kites & node app.js
kites exposes logger
property which can be used to adapt the logging as you like. You can for example just add winston console transport and filter in only important log messages into console.
var kites = ;var winston = ;kiteslogger;
License
MIT License
Copyright (c) 2018 Nhữ Bảo Vũ