Giter VIP home page Giter VIP logo

js-ecommerce-data-fetch's Introduction

E-commerce data fetching

Description

Software which fetch e-commerce like data and perform logic on it.

Table of contents

Techstack

  • JavaScript

Prerequisities

  • Node.js

Libraries

API

Table below presents functions which are responsible for data fetching from REST API.

Resources is only name convention here to generalize usage of an API endpoints.

You can click specific endpoint in order to get more in-depth information about usage.

Additionally you can click function in order to check implementation.

Method Endpoints Function
GET /resources getAll
GET /resources/:id getOne

Utils

Table below shows util functions which perform logic on data fetched from an API.

Function
Aggregate prices by category
Highest cart value
Furthest distance between users

To run

Clone repository.

git clone https://github.com/wojciechszmelczerczyk/js-ecommerce-data-fetch.git

Navigate to project root directory.

cd ./js-ecommerce-data-fetch

Install dependencies.

npm i

Create following .env file in project root directory.

BASE_URL=https://fakestoreapi.com

CARTS_URL=carts
PRODUCTS_URL=products
USERS_URL=users

CARTS_DATE_QUERY_STR=?startdate=2000-01-01&enddate=2023-04-07

Project use CommonJS syntax, so export is not supported. Please change node_modules/geolocation-distance-between/lib/index.js line 54 from export to module.exports =.

Run server.

npm run start

Tests

Table below represents docs for unit tests.

Unit tests
getAll
getOne

To run

Run tests.

npm run test

js-ecommerce-data-fetch's People

Contributors

wojciechszmelczerczyk avatar

Watchers

 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.