Skip to content

jovotech/jovo-inbox

Repository files navigation

Jovo Inbox

Access and analyze your Jovo app conversations using Jovo Inbox.

Jovo Inbox

Jovo Inbox allows you to learn from the conversations your users have with your voice and chat apps, across Alexa, Google's Business Messages, the web, and all other platforms supported by Jovo.

This can be used for:

  • Monitoring and analyzing live conversations
  • Coordinated QA testing with your team and beta testers

Jovo Inbox can be hosted on your own servers. You have full control, no user data is sent to Jovo servers.

Learn more below:

Getting Started

First, download the repository:

# Clone repository
$ git clone https://github.com/jovotech/jovo-inbox.git
$ cd jovo-inbox

Then, copy the .env.example file and rename it to .env. Right now, you don't need to make any changes to the file:

NODE_ENV=development # or production

MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_USER=jovoinbox
MYSQL_PASSWORD=pass123
MYSQL_DATABASE=jovoinbox
MYSQL_ROOT_PASSWORD=pass123

VUE_APP_BASE_APP_URL=http://localhost:4000 # or https://example.com for production
AVATARS_PATH=../../storage/avatars # or /usr/src/app/storage/avatars/ for production (docker)

There are 2 options how you can run Jovo Inbox locally:

Recommended: Using Docker

By using Docker, you don't need to start all the services by yourself. Docker Compose sets up a MySQL database and starts the backend and frontend services.

# Clone repository
$ git clone https://github.com/jovotech/jovo-inbox.git
$ cd jovo-inbox

# Start Docker container
$ docker-compose -f docker-compose.yml -f docker-compose.development.yml up

Then open http://localhost:8080 and create a project.

Learn how to connect that project to your Jovo app below.

Docker Troubleshooting

If you need to rebuild the Docker image, you can also add the --build flag:

# Start Docker container
$ docker-compose -f docker-compose.yml -f docker-compose.development.yml up --build

In case of a database error, try deleting the volume jovo-inbox_mysql_data:

$ docker volume rm jovo-inbox_mysql_data

Alternative: Manual Setup

You can also manually start all the services. This is especially helpful for local development because it doesn't require the Docker images to be rebuilt with every change.

Make sure that you have a MySQL database running and have the correct credentials in .env.

# Install dependencies for /core, /backend, /frontend
$ npm run setup

# Start the backend
$ cd backend
$ npm run start:dev

# Start the frontend
$ cd frontend
$ npm run serve

Then open http://localhost:8080 and create a project.

Learn how to connect that project to your Jovo app below.

Connect to Jovo App

Install the Jovo Inbox plugin as explained here: https://github.com/jovotech/jovo-framework/tree/v4/latest/integrations/plugin-inbox/docs

// src/app.prod.ts

import { JovoInbox } from '@jovotech/plugin-inbox';
// ...

app.configure({
  plugins: [
    new JovoInbox({
      projectId: '<PROJECT_ID>',
    }),
    // ...
  ],
});

Features

CSV Export

Logs can be exported in csv format calling this api url:

http://localhost:4000/api/inboxlog/export?projectId=<PROJECT_ID>&from=2023-01-01&to=2023-01-31

Available query params:

  • projectId
  • from: Timestamp YYYY-MM-DD
  • to: Timestamp YYYY-MM-DD

Structure of the exported columns: userId, userSaid, botSaid, intent, timestamp

Deployment

Requirements

  • Server with at least 2gb of RAM

This is not the best way, but sufficient for the beginning. Better approaches will follow.

Copy .env.example, rename it to .env.production.

$ cd /frontend
$ cp .env.example .env.production

Change the VUE_APP_BACKEND_URL env variable to http://<MY_SERVER>:4000/api.

Build the frontend files into api/public/client:

$ cd /frontend
$ npm run build

Run the API:

$ cd /backend
$ npm start

Then open http://<MY_SERVER>:4000.

Run Docker image on Ubuntu

  1. Install Docker on Ubuntu: https://docs.docker.com/engine/install/ubuntu/
$ sudo apt-get update
$ sudo apt-get install \
   ca-certificates \
   curl \
   gnupg \
   lsb-release
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$  echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-compose
  1. Clone repository (e.g. /opt)
$ cd /opt
$ git clone https://github.com/jovotech/jovo-inbox.git
  1. Change owner of the folder
$ sudo chown -R $USER:$USER /opt/jovo-inbox
  1. Create .env file in project folder
$ cd /opt/jovo-inbox
$ cp .env.example .env
  1. Edit .env file
$ nano .env
NODE_ENV=production

MYSQL_HOST=db
MYSQL_PORT=3306
MYSQL_USER=jovoinbox
MYSQL_PASSWORD=pass123
MYSQL_DATABASE=jovoinbox

MYSQL_ROOT_PASSWORD=pass123

VUE_APP_BASE_APP_URL=https://my-domain.com
  1. Install Letsencrypt
$ sudo apt install certbot python3-certbot-nginx
  1. Create certificate for domain
$ sudo systemctl start nginx
$ sudo certbot --nginx -d inbox.jovo.cloud
$ sudo systemctl stop nginx
  1. Open nginx config and remove comment from last line include /etc/nginx/nginx.production.conf;
$ nano /opt/jovo-inbox/nginx.conf
  1. Open production config and update server_name and certificates to my-domain.com
$ nano /opt/jovo-inbox/nginx.production.conf

You have two options to start the docker container: Build it yourself or use the prebuild image from docker hub.

a.) Build docker image and run container

$ sudo docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d --build

b.) Pull docker image and run container

$ sudo docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d