Giter Club home page Giter Club logo

cluno-task's Introduction

Description

Github Cluno-task repository.

Libraries

This project uses NestJS, ExpressJS and Mongoose libraries.

There are two options to store the data, in memory or MongoDB. (Default = In Memory) In order to run it with MongoDB, you have to pass DB_ADAPTER environment variable as mongodb. Default web server port is 3000. Can be changed with PORT environment variable.

Adapters

There are 2 data adapters in this project, in memory and MongoDB. In memory is written for more performance tried to avoid cpu intensive loops, mostly with O(n) time complexity loops but sacrifices memory by creating indexes.

Postman Collection

There is an exported Postman Collection with all possible requests.

Tests

Tests are written with Jest, with all possible cases with pricing sort and visible controls.

List Offers (Port = 3000)

POST /listOffers HTTP/1.1
Host: localhost:3000
Content-Type: application/json
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Postman-Token: 6c09c671-c840-4b1e-af11-b4aa967ade11,b393c18b-d874-440d-8659-c7b98512f7e5
Host: localhost:3000
Accept-Encoding: gzip, deflate
Content-Length: 88
Cookie: ss-opt=temp; X-UAId=6; ss-id=ubJqF7bsyvELIHdLc5Uu; ss-pid=ECyL79W0mpNunqwHZlxz
Connection: keep-alive
cache-control: no-cache

{
	"priceStart": 100,
	"priceEnd": 290,
	"portfolio": "0001",
	"make": ["Opel", "BMW"]
}

Detail of an Offer (Port = 3000)

GET /details/115 HTTP/1.1
Host: localhost:3000
User-Agent: PostmanRuntime/7.20.1
Accept: */*
Cache-Control: no-cache
Postman-Token: b5b7814e-0000-4f24-9a3a-6e0103d43086,009e03be-873b-4b40-a1a6-b98371faa89a
Host: localhost:3000
Accept-Encoding: gzip, deflate
Cookie: ss-opt=temp; X-UAId=6; ss-id=ubJqF7bsyvELIHdLc5Uu; ss-pid=ECyL79W0mpNunqwHZlxz
Connection: keep-alive
cache-control: no-cache


Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test 

Stay in touch

cluno-task's People

Contributors

bugralevent 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.