Giter Site home page Giter Site logo

nodejs-task's Introduction

###Implementation ##libs redis - cache layer npm github lib - GitHub api integration underscore.js - fast and lightweight template engine backbone+require.js - js frameworks for models+api integration mocha - backend tests qunit.js - frontend test

NodeJS Programming Task

Prerequisites

  • Please note that this will require some basic JavaScript and ExpressJS knowledge.
  • You will need to have NodeJS installed to complete this task.

Task

  1. Fork this repository.
  2. Create a src folder to contain your code.
  3. In the src directory, please create an ExpressJS app that fills the requirements in Program Requirements below.
  4. Write unit tests. See Tests below.
  5. Commit and push your code to your new repository. Don't squash commits.
  6. Write a README.md file explaining the choices you made any why you made them. Don't treat this assignment like a simple one-off app; please build it to be usable (no inline scripts, styles, etc). Bonus points if you correctly execute a proper build. Use this as an opportunity to impress us with a sane, extensible architecture.
  7. Send us a pull request, we will review your code and get back to you.

Program Requirements

  1. Connect to the Github API
  2. Create a route (/joyent) that returns all repositories under the joyent org.
  3. Create a route (/joyent/:repo) that returns the 100 most recent commits of any of joyent's repos in a table or list. To be clear, :repo is a parameter, and a user can enter any string (such as node or libuv) to get results for that repo.
  4. Cache responses coming from the GitHub API using an external store. Be prepared to talk about which store you chose, why you chose it, the pros/cons of that store versus others and how you chose to configure it. This is a deliberately open-ended question.
  5. Be a nice consumer to the GitHub API. Ensure that no more than 3 concurrent requests are ever made to the API. Write an abstraction layer over your requests to the API that performs this throttling. If more requests than the limit are made, requests should wait for an open spot. Do not simply an error if too many requests are in progress.
  6. Per commit, display:
    • Author name
    • Email
    • Author avatar (gravatar)
    • Full commit message
    • Date per commit (in the user's local time zone)
    • fib(i) (the value of the fibonacci sequence at index i, where i is the row number)
  7. Using CSS (no JS or style tags in the template), when the commit hash ends in a number, color that row to light blue #E6F1F6.
  8. Using CSS (no JS or style tags in the template), ensure that each commit message completely fills the bounds of its box. For example, a commit message containing 20 characters should take up the same width as a commit message containing 160 characters.

Use whichever templating engine you wish, but be prepared to tell me why you chose it.

Tests

Create the following unit test with the testing framework of your choice. Use the joyent/node repository for your tests.

  1. Verify the the correct number of results are returned and that they are each unique.
  2. Verify that rows ending in a number are colored light blue.
  3. Verify that no more than 3 concurrent requests can be made to the GitHub API at a single time. Consider mocking up a webserver to test this properly.
  4. Add any other unit tests you feel are necessary to properly ensure correct operation of this program.

nodejs-task's People

Contributors

pechalka avatar ssafejava avatar

Watchers

James Cloos avatar Valery avatar  avatar Vadim Asadchi 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.