It's a LineBot combined StateMachine. You can use it to control the user state and your workflow.
- Add your LINE_CHANNEL_ACCESS_TOKEN="access token" and LINE_CHANNEL_SECRET="secret" to .env (both docker-compose and code base)
- And Set redis current state as .env add your REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_USERNAME, YOUR_API_DOMAIN to .env (redis Host: port:6379)
LINE_CHANNEL_ACCESS_TOKEN=your_access_token LINE_CHANNEL_SECRET=your_secret REDIS_HOST=client_bot_redis REDIS_PORT=6379 REDIS_PASSWORD=your_redis_password REDIS_USERNAME=your_redis_username YOUR_API_DOMAIN=''
-
build application 安裝依賴 yarn install
-
load .env and build packages by docker-compose 加載環境變數並使用 Docker Compose 構建packages set -a source .env docker-compose -f cicd/docker-compose/docker-compose.dev.yml up -d
-
Use ngrok as Dev mode
- use ngrok service and set ngrok as http 3000
- go to LineDeveloper and set the path { your ngrok url }/bot/webhook to LineDeveloper webhook URL
-
Stop or restart Docker-Compose service 停止和重啟 Docker Compose 服務 docker-compose -f cicd/docker-compose/docker-compose.dev.yml down docker-compose -f cicd/docker-compose/docker-compose.dev.yml up -d
-
adjust 自行調整
- you can adjust Line response in ./infra/response. 在此修改Line的回覆內容
- you can adjust your interact with your backend api in ./domain/register and ./app/command/register.handler. 可以在此修改和後端api的交互
- you can adjust StateMachine content at ./app/command/register.machine 可以在此修改狀態機內容