Giter Club home page Giter Club logo

reddit's Introduction

NodeJS/Mongo Test Task

Using MongoDB, Node.js, Express, Bluebird, Lodash, and Snoowrap create a new API server which accumulates data over time and provides access to historical data from reddit.com front page. Note that it is sufficient to store data at hourly intervals. You should build your own node application that retrieves the reddit fresh data at least once per hour, stores it and implements the API described below. Your API implementation should be public without any authentication mechanism. Your calls to reddit should also be anonymous without any oauth usage. For API calls implementation please use the full methods of requests, GET, POST, PUT/PATCH, DELETE.

  1. Retrieve all users ********
GET /api/users
params: limit [int], offset[int]. filter [ object: { user_attribute_name: attribute_value } ]
  1. Retrieve all posts.
GET /api/posts
params: limit [int], offset[int]. filter [ object: { post_attribute_name: attribute_value } ]
  1. Get all reddits. ********
GET /api/reddits 
params: limit [int], offset[int]. filter [string: value ]
  1. Retrieve latest posts from a certain reddit. ****
GET /api/posts/:reddit
params: limit [int], offset[int]. filter [ object: { post_attribute_name: attribute_value } ]
  1. Get the specific post record
GET /api/post/:id
  1. Delete the specific post record
DELETE /api/post/:id
  1. Search posts
GET /api/search
params: limit [int], offset[int]. filter [ object: { post_attribute_name: attribute_value } ]

Technical details:

  • return json formatted payload
  • design the mongo collection having in mind query performance
  • store all data retrieved from reddit api in appropriate collection structure
  • use git to commit your work
  • commit as often as possible and push at least once a day
  • function body should not exceed 30 LOC
  • class should not exceed 200 LOC
  • stick to DRY principles
  • base your implementation on design patterns

Advanced requirements:

  • implement authentication support using jwt
  • implement authenticated request to reddit using oauth and user token
  • unit test coverage
  • Trying to use cron job for retrieving data instead of setInterval

reddit's People

Contributors

peppapig13132 avatar

Stargazers

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