Giter Site home page Giter Site logo

getir-case-study's Introduction

Getir Case Study Challenge

Description

It is a RESTful API with a single endpoint that fetches the data in the provided MongoDB collection and return the results in the requested format.

Tech Stack

  • express - Node.js web application framework
  • mongoose - MongoDB object modelin for Node.js
  • lodash - Utili# functions library for iterating arrays, objects & strings
  • winston - Simple and universal logging library

Getting Started

Use the package manager npm to install project.

1) Clone the project

  git clone https://github.com/berkbuyukdurak/getir-case-study.git

2) Install the dependencies

    cd getir-case-study
    
    npm install

How to Use

Configuration

To configure the project, you can use the files in the config directory.

How to Run

There are 2 ways to run this project.

1) If you want to run the project with development configurations

    npm run devStart

2) If you want to run the project with production configurations

    npm run prodStart

Testing

If you want to run tests on the project, please use the following command.

    npm test

How to Use

โš ๏ธ Beware, this API only accepts POST requests with JSON format.

API Rerefence

Onboarding

GET <public-endpoint-url> or <localhost:<8080 or your preferred port which can be changed from config/env/>>

Fetch Data

  POST /api/records

Sample Request Body

{
"startDate": "2016-01-26",
"endDate": "2018-02-02",
"minCount": 2700,
"maxCount": 3000
}

Expected Response

{
    "code":0,
    "msg":"Success",
    "records":[
        {
            "key":"TAKwGc6Jr4i8Z487",
            "createdAt":"2017-01-28T01:22:14.398Z",
            "totalCount":2800
        },
        {
            "key":"NAeQ8eX7e5TEg7oH",
            "createdAt":"2017-01-27T08:19:14.135Z",
            "totalCount":2900
        }
    ]
}

Test Results

Integration and unit tests are conducted. Here is the results;

Test Suites: 4 passed, 4 total
Tests:       15 passed, 15 total
Snapshots:   0 total
Time:        5.802 s, estimated 6 s
Ran all test suites.

License

MIT

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.