Cognigy gave me the chance to work on their great coding challenge so I created this repo to share my code.
As I have no permission to publish Cognigy's challenge this documentation will solely focus on what I have created and how it can be installed, configured, started, used and tested.
Please take my code as an inspiration how to work with the Cognigy Websocket Client and use it to create your own Webchat clients.
If you are tasked to complete the challenge please don't take my code because
- They will find out it's not yours
- It made a lot of fun working on it
- You will learn a lot trying it yourself
- I'm not the best developer around, there are surely many ways how to improve my code
-
Install Git
If not already installed please install Git. You can find a instructions for your Operating System here
-
Install Node and NPM
If not already installed please install Node and NPM from here
-
Clone this repo
git clone https://github.com/schinkenpapst/C5.git
- Enter the folder and install it's dependencies
cd C5
npm install
-
Create a configuration file with your endpoint credentials
Create a file
config.tsin the foldersrcwith this content:export const endpointURL = 'https://YOUR_ENDPOINT_URL' export const urlToken = 'YOUR_ENDPOINT_RUL_TOKEN'Please update the placeholders with the proper credentials to access the Socket Client. If you need credentials please contact Cognigy here
-
Run the web server
npm run start -
Open your browser and navigate to
http://localhost:8080orhttp://127.0.0.1:8080You should now see something like this:
-
Enter some text into the input box and press enter or hit the Send button. The interface will contact the Cognigy Socket Client and reply like this:
-
Send
cat imageto the Endpoint and see what happens :D
-
Dev Build:
run
npm run buildDev -
Prod Build:
run
npm run buildProd
-
Get sure the web server is running. If not run
npm run start -
run
npm run testto run all tests with Cypress
1.0.0 Upload first version.
Implementation Status:
| ID | Feature | Status |
|---|---|---|
| 001 | WebInterface | Completed |
| 002 | Redux State | Completed |
| 003 | Socket Client Helper Functions | Completed |
| 004 | Type Annotations | Completed |
| 005 | Cat Image implementation | Completed |
| 006 | Scroll to bottom functionality | Completed |
| 007 | Material UI Theme | Completed |
| 008 | Custom Bundler Configuration | Completed |
| 009 | Automated Tests | Started |
- Support for other message data inputs such as buttons and bubbles
- I18N support for different interface languages and locales
- Keyword specific triggers to call other web APIs
- Implement an authentication and send a userID with each request
- Improve styling
- Add more tests

