kites
kites copied to clipboard
Todo - Kites Extensions/Templates
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 withnative_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.
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.
Now we have done to create a chatbot easily with Nodejs by:
Using only NPM:
- Install kites cli:
npm install @kites/cli
- Create a chatbot:
kites init my-chatbot --template chatbot
- Install dependency:
npm install
- Configure and restore database then run:
npm start
- Browser and navigate to: http://localhost:3000
Using NPM with docker compose:
- Install kites cli:
npm install @kites/cli
- Create a chatbot:
kites init my-chatbot --template chatbot
- Build docker:
docker-compose build
- Run daemon:
docker-compose up -d
- Restore database by connect to mongdb container: docker exec -it mongodb bash
- Browser and navigate to: http://localhost:3000
More detail: https://github.com/vntk/vntk-chatbot-framework
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()