Code Monkey home page Code Monkey logo

chatbot-demo's Introduction

Simple chatbot sample

This is a simple chatbot demo built with Express, node-nlp, ReactJS and Redux.

Project Structure

.
├── chtbot-api
└── chatbot-ui

chatbot-api: Contains backend codes written in Express and the natural language utilities node-nlp chatbot-ui: Contains frontend codes written in ReactJS and Redux

Install packages need for the project

Install npm packages in project root folder, ./chatbot-api and ./chatbot-ui first using npm install.

To start the project

To start the frontend and backend concurrently,run npm start in project root folder.

To start backend only, run npm start in ./chatbot-api. The Express server default serves at port 3100.

To start the frontend only, run npm start in ./chatbot-ui.

To start the development environment

To start the development encironment of frontend and backend concurrently,run npm run dev in project root folder.

To start backend only, run npm run dev in ./chatbot-api. The Express server default serves at port 3100.

To start the frontend only, run npm start in ./chatbot-ui.

Project Settings

To change the default port of Express server: Change the variable PORT which can be found inside ./chatbot-api/.env.

To change the default API domain in frontend: Change the variable REACT_APP_API_DOMAIN which can be found inside ./chatbot-ui/.env.

Adding data to train the chatbot

The mapping of question and answers are put inside ./chatbot-api/data/questions and ./chatbot-api/data/answers. The data will then be used by node-nlp.

For details node-nlp please read example usage provided by node-nlp.

Node version

  • Node >= 9

Special thanks

All my friends who have given me comments on this project. It really helped me a lot in making this project better!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.