This is a template you can use to create other Algolia sample applications. It contains a variety of features that every Algolia sample app should ideally include. You can use the Github repository template functionality to create your sample app from this template.
The sample app uses the following features:
- Three back-end implementations in different languages
- ...
Adding a live demo (e.g., on CodeSandbox) will let the people quickly test your sample application!
The sample app implements three servers in the following programming languages:
The client is a single HTML page.
git clone https://github.com/algolia-samples/chatbot-with-algolia-answers
Copy the file .env.example
to the directory of the server you want to use and rename it to .env
. For example, to use the Python implementation:
cp .env.example server/python/.env
To use this sample app, you need an Algolia account. If you don't have one already, create an account for free. Note your Application ID.
In the .env
file, set the environment variables ALGOLIA_APP_ID
:
ALGOLIA_APP_ID=<replace-with-your-algolia-app-id>
After you set up your Algolia account and Algolia application, create and populate an index.
To upload your data, you can use the Algolia dashboard or use on of Algolia's API clients.
After creating the index and uploading the data, set the environment variables ALGOLIA_INDEX_NAME
and ALGOLIA_API_KEY
in the .env
file:
ALGOLIA_INDEX_NAME=<replace-with-your-algolia-index-name>
ALGOLIA_API_KEY=<replace-with-your-algolia-api-key>
Each server directory has a file with instructions:
For example, to run the Python implementation of the server, follow these steps:
cd server/python # there's a README in this folder with instructions
python3 venv env
source env/bin/activate
pip3 install -r requirements.txt
export FLASK_APP=server.py
python3 -m flask run --port=4242
- GitHub's repository template functionality
This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.