###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
- Please note that this will require some basic JavaScript and ExpressJS knowledge.
- You will need to have NodeJS installed to complete this task.
- Fork this repository.
- Create a
src
folder to contain your code. - In the
src
directory, please create an ExpressJS app that fills the requirements in Program Requirements below. - Write unit tests. See Tests below.
- Commit and push your code to your new repository. Don't squash commits.
- 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. - Send us a pull request, we will review your code and get back to you.
- Connect to the Github API
- Create a route (
/joyent
) that returns all repositories under the joyent org. - 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 asnode
orlibuv
) to get results for that repo. - 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.
- 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.
- Per commit, display:
- Author name
- 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)
- 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
. - 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.
Create the following unit test with the testing framework of your choice. Use the joyent/node repository for your tests.
- Verify the the correct number of results are returned and that they are each unique.
- Verify that rows ending in a number are colored light blue.
- 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.
- Add any other unit tests you feel are necessary to properly ensure correct operation of this program.