Skip to content

msgirlperl/buffer

Repository files navigation

buffer-code-exercise

Getting started

  1. Install Node.js version 8.x
  2. Clone this repo: git clone [email protected]:bufferapp/buffer-code-exercise.git
  3. Install dependencies: cd buffer-code-exercise && npm install
  4. Start up the local server in development mode npm run development

Now you'll have a local server running! Follow along to the next section to learn more about how this project is organized.

About this repo

Client side code

The client code is located in /client. The main entry point or root file is client.js. This is the starting file from which all other modules are imported and referenced. Files can be imported using ES2015 style import modules or the commonjs style require modules. The front-end is built using React.js components.

When running the npm run development command, webpack will be started. Webpack is a build tool that will automatically bundle your code into a single file. This bundled file will be created in /public.

All static assets like javascript files, stylesheets, and images should be placed in the /public directory. When the server is started, these files will all be available at localhost:8080.

Server side code

The server code is located in /server. The main entry point is server.js.

The server is written using Express.js which is similar to Sinatra for Ruby, Flask for Python, or Lumen for PHP if you are more familiar with those languages.

The JSON database uses lowdb which leverages the lodash library for querying the data in /server/database/db.json.

The exercise

We expect these tasks to take about 4 hours, but they may take less for you. If you have any questions or would like clarification, email [email protected]. Further down here are screenshots of the hopeful project end result!

How to complete the exercise

As your complete parts of the exercise, please use git to commit your code as you would normally work on a project. This is helpful component to see how you work as well. When you are complete, you can submit your work by zipping your the buffer-code-exercise directory then emailing to us. You can use Mac's "create archive" feature, Window's "compressed (zipped) folder," or the zip cli on Linux.

Try to complete the tasks to the best of your ability 😃 Good luck!

Tasks

  1. Add a “Load More” button at the end of the list of updates which loads the next 10 updates each time
  2. Append analytics from the "updates-analytics" collection to each update returned in the /getUpdates endpoint
  3. Write a script in /server/scripts/updateAnalyticsData.js to fetch the most recent Tweet analytics from the API and update the "updates-analytics" records in the database.
  4. Add new /getAnalyticsTimeseries endpoint which returns a timeseries of all update analytics aggregated by day that the update was sent: [{ timestamp: 1526601600, retweets: 1, favorites: 2, clicks: 4 }, ...]

Helpful notes & resources

Screenshots

In addition to the screenshot, here is a video of the "Load More" button working component: http://hi.buffer.com/3y2V113r0o3F

screenshot of end goal

Version

1.0

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published