kites icon indicating copy to clipboard operation
kites copied to clipboard

Todo - Kites Extensions/Templates

Open vunb opened this issue 7 years ago • 3 comments

Wanted the list of cli tools:

  • [x] mvc: Assembling all into complete ship (default), document
  • [x] basic: Template for building from scratch
  • [x] apidoc: Template for API Documentation, nodevn/kites-apidoc
  • [x] express: Template for Express Application
  • [x] restful: Template for generating a RESTful API Server
  • [x] spa: Template for generating a Single Page Application (kites/spa)
  • [ ] cms: Template for generating a Content Management System (CMS)
  • [ ] chat: Template for generating a Chat application
  • [x] chatbot: Template for generating an AI Chatbot application, vntk/chatbot, document
  • [ ] videocall: Template for generating a Video Call application
  • [ ] electron: Template for creating a desktop application with native_modules
  • [ ] gateway: Template for creating a microservices API Gateway
  • [ ] oauth|oauth2: Template for creating an OAuth2 Server
  • [ ] crawler: Template for crawl news, products, ...

Syntax:

kites init [my_app_name] --template chatbot

Example:

kites init my_kute_chatbot --template chatbot

Then a new project will be generated at the current directory.

vunb avatar Jan 06 '18 04:01 vunb

It's better if we have a general command called init:

For shortkey:

kites init [my-app-name] -t [template] -d [directory]

Or:

kites init [my-app-name] --template [template] --directory [directory]

Params:

  • t | template: application template (default: mvc)
  • d | directory: the directory will contain the genered project (default: current working directory)

Note: The name of template is corresponding to a branch of vunb/kites which it will be downloaded to the current working directory.

vunb avatar Apr 13 '18 07:04 vunb

Now we have done to create a chatbot easily with Nodejs by:

Using only NPM:

  1. Install kites cli: npm install @kites/cli
  2. Create a chatbot: kites init my-chatbot --template chatbot
  3. Install dependency: npm install
  4. Configure and restore database then run: npm start
  5. Browser and navigate to: http://localhost:3000

Using NPM with docker compose:

  1. Install kites cli: npm install @kites/cli
  2. Create a chatbot: kites init my-chatbot --template chatbot
  3. Build docker: docker-compose build
  4. Run daemon: docker-compose up -d
  5. Restore database by connect to mongdb container: docker exec -it mongodb bash
  6. Browser and navigate to: http://localhost:3000

More detail: https://github.com/vntk/vntk-chatbot-framework

Make sure you have installed Node.js and Mongodb.

vunb avatar Apr 13 '18 14:04 vunb

Example for use: SPA Template

// Every http GET request: `ip:port/myapp*` will be routed to static with folder name `myapp`.
// `kites.config.json` with option: `discover: false`
await kites().use(spa('myapp')).init()

// Or
// Every http GET request: `ip:port/myapp*` will be routed to static with folder name `public`.
await kites().use(spa('myapp', './public')).init()

vunb avatar Apr 21 '19 00:04 vunb