kitesjs / kites

Template-based Web Application Framework
https://kitesjs.github.io/kites
MIT License
53 stars 6 forks source link

Todo - Kites Extensions/Templates #1

Open vunb opened 6 years ago

vunb commented 6 years ago

Wanted the list of cli tools:

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 commented 6 years ago

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:

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

vunb commented 6 years ago

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 commented 5 years ago

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()