/caradisiac

Workshop about api

Primary LanguageJavaScript

CARADISIAC

Drive comfortably

Usage

Into app/server folder:

npm install
npm start

Open a webpage and enter those 2 endpoints:

  • localhost:9292/populate
  • localhost:9292/cars

The 10 models with the biggest volume would appear on the cars endpoint in the JSON format.

Instructions

Table of Contents generated with DocToc

Introduction

caradisiac.com provides a tone of technical records related to car specification.

Objective - Workshop in 1 sentence

Build an api that get the list of cars with the higher rate and the higher volume (car boot)

The api

  • must listen port 9292
  • must provide endpoint /populate to index records to Elasticsearch
  • must provide endpoint /cars that return list of cars with the higher car boot volume

How to do that?

By indexing technical records from caradisiac to Elasticsearch and build an api with Node.js

Stack

Node.js + ES6 + Elasticsearch

Just tell me what to do

  • Fork the project via github
  • Clone your forked repository project https://github.com/YOUR_USERNAME/caradisiac
cd /path/to/workspace
❯ git clone git@github.com:YOUR_USERNAME/caradisiac.git
  • Follow the steps
  • commit your different modifications:
cd /path/to/workspace/caradisiac
❯ git add -A && git commit -m "feat(es): index in bulk all car records"

(why following a commit message convention?)

  • Don't forget to push before the end of the workshop and before the end of the dedicated sessions
❯ git push origin master

Note: if you catch an error about authentication, add your ssh to your github profile.

  1. If you need some helps on git commands, read git - the simple guide

Examples of steps to do

Populate

  1. use the package node-car-api to get all records in json format
  2. index - with bulk - all records to Elasticsearch

List of cars

  1. Build an api that provide endpoint /populate
  2. Build an api that provide endpoint /cars
  3. The /cars endpoint could be a ES query to fetch the right data

MVP

  1. Build an api that provide endpoint /populate to index records to Elasticsearch
  2. Build an api that provide endpoint /cars that return list of 10 first cars with the higher car boot volume

Client-side (bonus)

Display the list of the cars with React

Don't forget

Focus on api

Licence

Uncopyrighted