Coder Social home page Coder Social logo

tkrugg / create-instantsearch-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from algolia/create-instantsearch-app

0.0 1.0 0.0 721 KB

⚡️ Build InstantSearch apps at the speed of thoughts

License: MIT License

JavaScript 57.52% TypeScript 6.60% CSS 7.26% HTML 18.00% Java 1.60% Swift 4.87% Ruby 0.25% Vue 3.90%

create-instantsearch-app's Introduction

Create InstantSearch App

⚡️ Build InstantSearch apps at the speed of thoughts

Build Status Version License

create-instantsearch-app is a command line utility that helps you quick start your InstantSearch app using any Algolia InstantSearch flavor (InstantSearch.js, React InstantSearch, Vue InstantSearch, Angular InstantSearch, InstantSearch iOS and InstantSearch Android).

Preview

Contents

Get started

The tool requires Node ≥ 8.

npx create-instantsearch-app my-app
cd my-app
npm start

npx is a tool introduced in [email protected] that makes it possible to run CLI tools hosted on the npm registry.


Alternatively, you can use Yarn:

yarn create instantsearch-app my-app
cd my-app
yarn start

Usage

This package comes with the module createInstantSearchApp(path, options?) and the command-line tool create-instantsearch-app.

$ create-instantsearch-app --help

  Usage: create-instantsearch-app <project-directory> [options]

  Options:

    -v, --version                                      output the version number
    --name <name>                                      The name of the application
    --app-id <appId>                                   The application ID
    --api-key <apiKey>                                 The Algolia search API key
    --index-name <indexName>                           The main index of your search
    --attributes-to-display <attributesToDisplay>      The attributes of your index to display
    --attributes-for-faceting <attributesForFaceting>  The attributes for faceting
    --template <template>                              The InstantSearch template to use
    --library-version <libraryVersion>                 The version of the library
    --config <config>                                  The configuration file to get the options from
    --no-installation                                  Ignore dependency installation
    -h, --help                                         output usage information

--template

Supported templates are:

create-instantsearch-app my-app --template "React InstantSearch"

You can also create your own template and specify its path.

--config

The config flag is handy to automate app generations.

config.json
{
  "name": "my-app",
  "template": "InstantSearch.js",
  "libraryVersion": "2.8.0",
  "appId": "MY_APP_ID",
  "apiKey": "MY_API_KEY",
  "indexName": "MY_INDEX_NAME",
  "searchPlaceholder": "Search",
  "attributesToDisplay": ["name", "description"],
  "attributesForFaceting": ["brand", "location"]
}

Create the app based on this configuration:

create-instantsearch-app my-app --config config.json

API

create-instantsearch-app is based on the module createInstantSearchApp(path, options?). The same camel cased options as the CLI are available.

const createInstantSearchApp = require('create-instantsearch-app');

const app = createInstantSearchApp('~/lab/my-app', {
  template: 'InstantSearch.js',
  libraryVersion: '2.0.0',
  attributesToDisplay: ['name', 'description'],
  attributesForFaceting: ['keywords'],
});

app.create().then(() => console.log('App generated!'));

Tutorials

Previews

You can use the web templates on CodeSandbox:

License

Create InstantSearch App is MIT licensed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.