Skip to content

Latest commit

 

History

History
90 lines (56 loc) · 3.37 KB

README.md

File metadata and controls

90 lines (56 loc) · 3.37 KB

Sample application template

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.

Features

The sample app uses the following features:

  • Three back-end implementations in different languages
  • ...

Demo (Try it yourself!)

Adding a live demo (e.g., on CodeSandbox) will let the people quickly test your sample application!

How to run the sample app locally

The sample app implements three servers in the following programming languages:

The client is a single HTML page.

1. Clone this repository

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

2. Set up Algolia

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>

3. Create your Algolia index and upload data

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>

6. Follow the instructions in the server directory

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

Resources

Contributing

This template is open source and welcomes contributions. All contributions are subject to our Code of Conduct.

Authors