This is a little chat room with a bot that answers previously asked questions by indexing all questions to elasticsearch then analyzing incoming messages. The full challenge description can be found here
It is based on the following tech stack:
- dojo-starter repository.
- lit - A simple library for building fast, lightweight web components.
- Node.js - A JavaScript runtime.
- express - Fast, unopinionated, minimalist web framework for Node.js.
- socket.io - A library for real-time, bidirectional and event-based communication between the browser and the server.
- elasticsearch - A distributed, RESTful search and analytics engine.
- elasticsearch-js - The official Elasticsearch client for Node.js.
- docker.elastic.co/elasticsearch/elasticsearch:8.6.1 - The official Elasticsearch Docker image.
- Clone the repository.
- Install elastic search locally:
- Create docker network:
docker network create elastic
- Pull the image:
docker pull docker.elastic.co/elasticsearch/elasticsearch:8.6.1
- Run the container without authentication:
docker run --name elasticsearch --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" -t docker.elastic.co/elasticsearch/elasticsearch:8.6.1
- Create docker network:
- Install the dependencies both on the server and client.
- Under the root folder, simply run:
cd client npm install
- Then,
cd server npm install
- Under the root folder, simply run:
- Start the development server.
- This command serves the app at
http://localhost:8000
:npm run serve
- The command will also start the express server at
http://localhost:8001
- You can run the only server manually by using this command on the "server" directory
npm run start:dev
- This command serves the app at
- Profit!
chit.chat.app.mp4
To run the server side tests, simply run from the "server" directory:
npm run test
- For each of access to elastic search, you can use the highly convenient Chrome extension Elasticsearch Head.
- The app logo was generated using DALL-E 2.0, a neural network trained on 400 million image pairs from the internet. You can read more about it here.
- The bot attitude was chosen to be more personal and friendly as according to various researches, it is more effective in increasing the user's engagement with the chatbot. You can read more about it here.
- The bot's answers were generated using ChatGPT, a large-scale generative pre-trained language model. You can read more about it here.
- The robot's welcoming voice was generated using UberDuck learnt from Jerry Seinfeld's voice.
- The avatars rely on 2 different APIs:
- DiceBear - A free API for generating unique avatar images.
- Boring Avatars - A free API for generating unique "boring" avatar images.
- The bot has peculiar humor, it likes dad jokes. Just ask him "bot tell me a joke" and you'll see...