How Algolia uses Electron to improve internal productivity

Baptiste Coquelle
Algolia Stories
Published in
5 min readOct 26, 2016

--

For a fast-growing startup like Algolia, the more we grow, the more internal data we produce and the more time we spend navigating content. We use Lever for hiring, Help Scout for support emails, GitHub for code, Asana to track projects, the list goes on.

Here are a few examples of issues that Algolia team members face everyday:

  • Who’s the account executive for customer@mail.com?
  • Show me the best practices for support
  • Open the documentation for searchableAttributes
  • Who’s in charge of our WordPress plugin?
  • Open all support tickets for customer@mail.com
  • Search “React” in all our GitHub issues
  • What are the active candidates for our CSE roles?

Answering all these questions would require opening several tabs, browsing, 🖱 clicking, locating multiple search boxes, ⌨ typing, refining and closing your browser in frustration 😤, and of course finally asking 10 different colleagues where to find what you are looking for. And you would need to have an account on each website, which is not necessarily the case at Algolia. Developers don’t have a Salesforce account, for example — nor should they.

We started thinking about how we could make things easier for our entire team, and, of course, we knew a good search experience was the solution. We wanted something that could be available at the touch of a button, without even needing to open a browser. We wanted to put every one of our internal tools, the answers they held to our questions, and the solutions they held to our problems at our fingertips. And we did.

We developed an internal desktop app for macOS, Windows and Linux that allows us to perform internal search across all the services we use with a Spotlight/Alfred-like experience.

How we built it

Being heavy users of Alfred and Spotlight, we had a fair idea of what we were looking for. We wanted a desktop app: something that would let us hit a shortcut and search — that’s it.

We chose Electron, a Node.js package to build desktop applications using JavaScript. We’re not the first to use this stack — we took inspiration from Atom & Slack — Electron enables any developer to build their own desktop application and package them to Mac, Windows or Linux target with web frameworks.

We decided to give Angular 2 a go and for autocompletion, we used our very own autocomplete.js.

Securing Access

This tool is about accessing internal documents: it needed to be secure, period.

At Algolia, we use OKTA to create centralized identity management and a single sign on process. We go to great lengths to ensure that only an Algolia team member should be able to access our internal documents.

Once logged in, users get the Algolia API keys needed to perform the search.

Algolia being Algolia, we added an additional layer of security. We decided on generating search only secure api keys that last 1 hour. Every hour, the app checks if the keys are valid. In case they are not valid, the app checks if the user is still authentified on OKTA: if so, the app gets new API keys and if not, the user has to log in again so they can get new keys.

This way, we ensure that the app does not leak information to third parties, or is accessible to former colleagues that still have the app.

Reducing Minutes to Seconds

Imagine you want to know if person@company.com is already a customer. You know the salesperson assigned to it and you want to check the company website traffic to size the business — this is a typical operation for our sales team.

With a classic browser, you would:

  1. Open the browser
  2. Go to your CRM’s website
  3. Log in
  4. Type the company’s name in the search bar and hit enter
  5. Wait for the results to load
  6. Click on the result and get redirected to another page once it loads
  7. Find your company info
  8. Go on SimilarWeb
  9. Log in
  10. Type the website in the search bar and hit enter.

With our internal search tool you can:

  1. Load the search bar with a customizable hotkey (less than one second to launch the search bar)
  2. Type customer@company.com, and instantaneously view a preview of the basic infos related to the account
  3. Type company.com to get the traffic (the tool detects when a domain name is typed and call SimilarWeb)

Satisfying all team members

We had to ensure that it could be used by the whole team. For example a salesperson would be interested in searching for Salesforce opportunities and accounts, but a developer would probably want to search for GitHub issues or repositories. Thus we had to make sure to index everything.

Here’s the list of services and documents currently indexed :

  • Salesforce opportunities, accounts, leads, custom objects, contacts
  • GitHub closed/open issues and closed/open pull requests
  • Lever for candidates
  • Algolia technical documentation
  • Helpscout for support emails
  • Asana for projects & tasks

We make these various services easily targetable by using keyboard shortcut filters in the form of [!commands], for instance:

  • “!a” targets Salesforce accounts
  • “!o” targets Salesforce opportunity
  • “!hub” arget Github issues and pull requests
  • “!h” targets support emails

Lastly, our crawler runs on Heroku. Depending on the service and their API constraints we may check for updates every five minutes or every hour.

And most importantly, we added two different color themes to please everyone.

One tool to rule them all

Using Electron with Algolia’s autocomplete.js to make a desktop application made it really easy to get a proof of concept up and running in no time. Once the first source of content was indexed, it took no more than a couple hours to have a basic autocomplete working. Spend another couple of hours to add an auto-update process to the application, and now end users don’t have to download the app each time an update is available — Electron is taking care of it. The benefit of this tool became more and more obvious when we began adding several data sources. Performance-wise, querying algolia on 7+ indices at each keystroke has very little impact on the overall UX.

This tool is now in widespread use and reduces the friction between multiplicity of internal interfaces and the user by unifying the search into one single fast and relevant search experience. Algolia’s environment becomes clearer for everybody and the teams can now focus on other things than just browsing around for information (#milliseconds matter !).

--

--