Skip to content

j8/elastic-challenge

Repository files navigation

Elastic Challenge

elastic-challenge

Elastic challenge is AngularJS SPA app with Node.js and Elasticsearch backend. It demonstrates simple functionality of importing .json data in Elastic via command line and building simple REST server for streaming the data to AngularJS front end.

This project is generated with yo angular generator version 0.14.0 and restify

Preresquits

Install 'jq'

Mac OS X

brew install jq

Ubuntu

sudo apt-get install jq

Install Elasticsearch

brew install elastic

Note: version 2.0.0_1 should be installed to support the backend queries

Setup the backend

Download Node.js or verify if you have already installed it:

$ node -v
v5.1.0

Note: the project is build with Node.js v5.1.0

Build & development

Clone the repo:

git clone https://github.com/j8/elastic-challenge.git

Install needed package dependancies

bower install && npm install

Import books.json into Elasticsearch

Note: books.josn was preformated in https://jsonformatter.curiousconcept.com to match RFC 4627

We need to import books.json file into Elasticsearch:

cat backend/books.json | jq -c '.[] | {"index": {"_index": "books", "_type": "book", "_id": .id}}, .' | curl -XPOST localhost:9200/_bulk --data-binary @-

Test if import is succesful by browsing to: http://localhost:9200/books/book/{id}, for example http://localhost:9200/books/book/b334861393

Run elastic-challenge

Run elasticsearch

elasticsearch

Run Node.js REST API

node server.js

Run the AngularJS front end

grunt serve

Testing

TODO: Running grunt test will run the unit tests with karma.

Author

J8

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published