{"id":20646724,"url":"https://github.com/cbartram/chatbot","last_synced_at":"2025-04-16T02:40:45.939Z","repository":{"id":69898062,"uuid":"99005547","full_name":"cbartram/ChatBot","owner":"cbartram","description":"A Simple Wit.Ai powered Healthcare Chatbot","archived":false,"fork":false,"pushed_at":"2017-08-04T12:46:26.000Z","size":379,"stargazers_count":10,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:23:16.339Z","etag":null,"topics":["chatbot","express","javascript","nodejs","react","witai"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cbartram.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-01T13:40:50.000Z","updated_at":"2024-04-04T14:22:10.000Z","dependencies_parsed_at":"2023-03-02T10:30:36.325Z","dependency_job_id":null,"html_url":"https://github.com/cbartram/ChatBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbartram%2FChatBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbartram%2FChatBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbartram%2FChatBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbartram%2FChatBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbartram","download_url":"https://codeload.github.com/cbartram/ChatBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249185486,"owners_count":21226567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","express","javascript","nodejs","react","witai"],"created_at":"2024-11-16T16:26:55.486Z","updated_at":"2025-04-16T02:40:45.927Z","avatar_url":"https://github.com/cbartram.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" # ChatBot\n A Simple Wit.Ai powered Healthcare Chatbot which can answer questions about insurance plans, finding providers, and deductibles\n \n ## Installation\n \n Installing this software is simple! \n \n Clone the repo\n \n `git clone https://github.com/cbartram/ChatBot.git`\n \n Install any dependencies \n \n `npm install`\n \n Start the app\n \n `npm start`\n \n The app will be available at `http://localhost:3000`\n \n \n ## Testing\n \n This repo already comes preconfigured with several unit tests. \n To run the tests simply use:\n \n `npm run test`\n \n\n ## Production Ready Build\n To run a production build and transpile all the source code run:\n \n `npm run build`\n \n \n ## How it Works\n \n This app is bootstrapped using the `create-react-app` command and as such \n comes with a webpack dev server which provides hot reloading of the app. \n \n There is another NodeJS express server which runs concurrently along with the webpack dev server. \n Any unknown HTTP requests will be proxied by the webpack dev server along to the NodeJS express server which communicates\n directly with Wit.ai's services. \n \n When a user sends a message the text is sent it a POST request with a `message object` body (see Message Object below) to the Express server where it is passed along to Wit.ai for \n parsing. Wit.ai will respond back with a string representing the `intent` it thinks best exemplifies the users request. \n \n From here this intent is acted upon by the Express server and it creates an `intent object` which is used by React to render\n and display the proper chatbot responses and associated links in the user interface.\n  \n Its important to know that the server and client communicate with **message object requests** and **Intent Object responses**\n \n # Intent Object \n \n The intent object is the response coming back from the Express server and contains information vital to displaying a message\n from the Chat Bot back to the user.\n \n | **Property Name** | **Property Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                   |\n |-------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | `msg`             | `String`          | This is the Bots response text which will be placed inside the chat bubble                                                                                                                                                                                                                                                                                                                        |\n | `type`            | `String`          | The message type defines whether the message is just a plain old text message, if its a picture message, or if its an event message. The value should either be `message` or `event` Event messages are created and sent by the Application itself and occurs when an \"event\" takes place in the conversation. For example: the user changes their chat color, an event would be sent in the message window saying \"You changed your chat color\". |\n | `link`            | `String`          | The link specifies an HTTP link to be placed in a button linking to a specific context that was referenced in the conversation. If there is no link to go along with the context **then leave link as `null`**.  For example saying \"hi\" doesn't have much reference, however, saying \"Find me doctors nearby\" might have a Google Maps link to doctors close by.                                 |\n | `subject`         | String            | The subject specifies the link button's primary text attribute                                                                                                                                                                                                                                                                                                                                    |\n | `label`           | String            | Primary, Danger, Warning or Success to style the button different colors. This attribute is purely cosmetic                                                                                                                                                                                                                                                                                       |\n | `timestamp`       | String            | The timestamp should be a string (usually a formatted momentJS object) which specifies when the message was sent. It is displayed to the right of the message in the dialogue box                                                                                                                                                                                                                 |\n | `requireAuth`     | Boolean           |  `requireAuth` is a boolean value which specifies whether or not the users intent requires authentication before the server/database can provide the information requested. If auth is false then the information **should not** be presented to the user. It **is up to the developer** to use this value to determine which information is filtered in the chat on the client side                                                                                                                                                                                                               |\n | `auth`            | Boolean           | Auth is a boolean value which is stored and originates from the server and indicates that the server realizes the user is already authenticated (or not authenticated). The client can use this value to alter the responses accordingly                                                                                                                                                                                                             |\n\n \n An example message object might look like this in the context of the following conversation\n \n Bot: \"How can I help you?\"\n \n User: \"Id like to buy some insurance\"\n \n ```javascript\n{\n    msg: 'Sure thing, which plan would you like to purchase?',\n    type: 'message',\n    link: 'https://someinsuranceplans.com/thebestplan',\n    subject: 'Relevant Insurance Plans',\n    label: 'primary',\n    timestamp: moment().format('h:mm a')\n}\n```\n # Message Object\nThe message object is the \"request\" made to the Express server in order for Wit.ai to process\nthe users intent. The message object is both sent to the server and automatically appended to the conversation by the client. \n\n| **Property Name** | **Property Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                   |\n|-------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `user`            | `Integer`         | This determines \"who\" is talking. Use 1 for the user (the human typing), 0 for the bot responding, and 2 for an event message                                                                                                                                                                                                                                                                     |\n| `type`            | `String`          | The message type defines whether the message is just a plain old text message, if its a picture message, or if its an event message. Event messages are created and sent by the Application itself and occurs when an \"event\" takes place in the conversation. For example: the user changes their chat color, an event would be sent in the message window saying \"You changed your chat color\". |\n| `text`            | `String`          | This is the actual text the user typed. It is sent over to the Express server for Wit.ai to process and is also applied to the bottom of the conversation in the chat bubble                                                                                                                                                                                                                      |\n| `color`           | String            | The chat bubbles color this is a hexadecimal color code `#00FF00`                                                                                                                                                                                                                                                                                                                                 |\n| `timestamp`       | String            | The timestamp should be a string (usually a formatted momentJS object) which specifies when the message was sent. It is displayed to the right of the message in the dialogue box                                                                                                                                                                                                                 |\n\nA message object might look something like this in the context of the conversation below\n\nBot: \"Hello what can I help you with?\"\n\nUser I need to find a doctor fast!\n\n```javascript\n{\n    user: 1, //because the user is the one talking\n    type: 'message', //Its just a plain ole' message not a picture/event\n    text: 'I need to find a doctor fast!' //This is what the user typed\n    color: '#046AFF' //Chat bubble color\n    timestamp: moment().format('h:mm a') //7:14 AM\n}\n```\n\n## Built With\n\n* [React JS](https://facebook.github.io/react/) - The web framework used on the frontend for the UI Components\n* [NPM](https://www.npmjs.com/) - Dependency Management\n* [Wit.ai](https://wit.ai) - Used as Machine learning and NLP models to power the chat bot\n* [Express](https://expressjs.com/) - Used to power the Proxy Server HTTP requests and routes\n* [NodeJS](https://nodejs.org) - Used to power the Proxy Server\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning.\n\n# Author\n\nChristian Bartram  [Cbartram Github](https://github.com/cbartram)\n\n# Contributing\n\nCreate a new issue on this Github repo if you have any questions or concerns!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbartram%2Fchatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbartram%2Fchatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbartram%2Fchatbot/lists"}