This repository contains the local files for the sample Algolia Document indexer application that is explained as part of a blogpost series. It implements a document indexer & search application that can be used search in project documentation, essentially finding projects that were done in a specific technology, topic or containis specific domain knowledge that we might be looking for. This demo implementation scrapes the top GitHub repositories, stores their README.md in Algolia and makes them searchable.
- A NodeJS script to scrape the top GitHub repositories and store their basic information and documentation in an Algolia index. The relevant Algolia code is contained in the algolia.js.
- A Web application frontend to query the Algolia index directly and display search results
To try the loading of the Algolia index based on the sample dataset, you need an Algolia API key, which you can obtain by:
- Registering for a free Algolia account, or Logging in to your existing account
- After signing in, an Algolia Application will automatically be created for you. You can either use the default (unnamed) application, or create a new application
- Go to your API Keys section of your application and retrieve your Application ID and Admin API Key You will need to use both the Application ID and Admin API Key in when connecting your Algolia account from the Python code below
- Clone this repo
- Navigate into the indexer folder and run
npm install
- Run the script by calling
node index.js -a [Algolia AppId] -k [Algolia ApiKey] -i [Algolia index name]
. The full list of command line options can be displayed either by calling the app with no arguments (node index.js
) or calling it with the-h
or--help
switches.
The script will:
- Connect to Algolia index using your credentials and validate the connection
- Start enumerating the top GitHub repositories using the GitHub API
- Prepare the Algolia index
- Load the dataset into Algolia from GitHub and replace the existing index
You can also easily try out the Search Web Application by either:
- opening the StackBlitz hosted version of the application on the cloud. This contains both the source and the created application and allows you to make modifications and see the changes real-time.
- opening the local files for the web application. You will need to run npm install and npm start from the frontend directory to run the app.