Git Product home page Git Product logo

getir-case-study's Introduction

Welcome to getir case study rest api documentation

This application is a technical test project for senior backend software engineer role of Getir.

Before start you can access backend rest api online from here.

Prerequisites

Before we begin, make sure you have NodeJs version >=12.* and Express version ^4.17.1.

$ node -v # node v12.10.0
$ express --version # Express 4.16.1

Npm

As you know Nodejs utilizes npm to manage its dependencies. So, before starting setup our app, make sure you have npm installed on your machine.

You can check if you have

$ which npm

To update to its latest version with:

$ npm update --system

Project Setup

First step, we need to clone rest api repo to your local machine.

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

After that, go to inside directory your cloned path and running this command.

$ npm install

Dependencies

Let's take a moment to review the npms that we used.

  • Express - Fast, unopinionated, minimalist web framework for Node.js.

  • dotenv - Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.

  • express-validator - express-validator is a set of express.js middlewares that wraps validator.js validator and sanitizer functions.

  • mongoose - Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

  • jest - Jest is a delightful JavaScript Testing Framework with a focus on simplicity.

  • mongodb-memory-server - Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).

  • nodemon - Nodemon is a utility that will monitor for any changes in your source and automatically restart your server. Perfect for development. Install it using npm.

  • swagger-node-express - This is a Swagger module for the Express web application framework for Node.js.

  • express-swagger-generator - This is a Swagger module generator for the Express web application framework for Node.js.

Unit Test

In your root directory, run this command and see all tests are success, like below image

$ jest

Figure 1-1

Run Project

For starting serve backend api, just you need to run this command

$ npm run dev or node start.js (without nodemon)

All done!

API Details

You can test manually with the link below.

$ https://akin-gundogdu-getir-case-study.herokuapp.com/api/records
Item Description
Uri Base https://akin-gundogdu-getir-case-study.herokuapp.com
Route api/records
Http Method POST
Content-Type application/json
Accept application/json
Query Parameter limit for pagination
Query Parameter page for pagination
Body { "startDate": "2016-01-26", "endDate": "2018-02-02", "minCount": 2700, "maxCount": 3000}

Tech

  • Nodejs
  • ExpressJS
  • Javascript
  • Ohmzsh
  • Postman
  • MacOS

About me

Thanks for reading.

getir-case-study's People

Contributors

akingundogdu avatar

Watchers

 avatar  avatar

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.