This repository is part of the larger Cloud Insurance Co. project.
The admin dashboard provides Cloud Insurance Co. administrators with an overview of the ongoing activities on the site. It starts with real-time view on the chat bot conversations providing admins with insights about the interactions between the chat bot and the visitors.
This project is designed with a bunch of awesome new front-end technologies, all on top of a configurable, feature-rich webpack build system that's already setup to provide hot reloading, CSS modules with Sass support, unit testing, code coverage reports, bundle splitting, and a whole lot more, while providing amazing developer tools such as Redux CLI (a generator), Redux devtools (Chrome extension), and Storybook for visually developing and testing components.
In order to deploy the full set of microservices involved, check out the [insurance-toolchain repo][toolchain_url]. Otherwise, you can deploy just the app by following the steps here.
- node
^6.7.0
- npm
^3.10.10
-
If you do not already have a Bluemix account, sign up here
-
Download and install the Cloud Foundry CLI tool
-
The app depends on the main website app. Make sure to deploy it first.
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/insurance-bot-dashboard.git
-
cd
into this newly created directory -
Open the
manifest.yml
file and change thehost
value to something unique.
The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net
- Connect to Bluemix in the command line tool and follow the prompts to log in
cf login -a https://api.ng.bluemix.net
- Create a Watson Tone Analyzer service.
cf create-service tone_analyzer standard insurance-tone_analyzer
- Build the app web site
npm install
npm run deploy:prod
- Push the app to Bluemix
cf push --no-start
- Define a variable pointing to the main site deployment.
cf set-env insurance-bot-dashboard SOCKET_URL https://your-insurance-bot.mybluemix.net
- Start your app
cf start insurance-bot-dashboard
And voila! You now have your very own instance of the app running on Bluemix.
-
If you do not already have a Bluemix account, sign up here
-
Download and install the Cloud Foundry CLI tool
-
The app depends on the main website app. Make sure to deploy it first.
-
Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/insurance-bot-dashboard.git
-
cd
into this newly created directory -
Create a new Watson Tone Analyzer service named
insurance-tone_analyzer
using your Bluemix account -
Replace the corresponding credentials for the
insurance-tone_analyzer
andinsurance-bot-db
services in yourvcap-local.json
file - usingvcap-local.template.json
as template file. -
Define an environment variable pointing to the main site (which can be running locally or in Bluemix)
export SOCKET_URL=https://localhost:6040
- Install the required npm packages using the following command
npm install
- Start your app locally with the following command
npm start
This command will start your Node.js web server and print the address where it is listening to requests in the console: server starting on http://localhost:3000
.
Webpack is configured to make use of resolve.root, which lets you import local packages as if you were traversing from the root of your ~/src
directory. Here's an example:
// current file: ~/src/views/some/nested/View.js
// What used to be this:
import SomeComponent from '../../../components/SomeComponent'
// Can now be this, HORRAY!:
import SomeComponent from 'components/SomeComponent'
These are global variables available to you anywhere in your source code. If you wish to modify them, they can be found as the globals
key in ~/config/index.js
. When adding new globals, make sure you also add them to ~/.eslintrc
.
Variable | Description |
---|---|
process.env.NODE_ENV |
the active NODE_ENV when the build started |
__DEV__ |
True when process.env.NODE_ENV is development |
__PROD__ |
True when process.env.NODE_ENV is production |
__TEST__ |
True when process.env.NODE_ENV is test |
__DEBUG__ |
True when process.env.NODE_ENV is development and cli arg --no_debug is not set (npm run dev:no-debug ) |
__BASENAME__ |
history basename option |
__SOCKET_URL__ |
The websocket endpoint for the main website. It is initialized from process.env.SOCKET_URL variable specified as https://host:port. |
See License.txt for license information.