- Install Node.js version 8.x
- Clone this repo:
git clone [email protected]:bufferapp/buffer-code-exercise.git
- Install dependencies:
cd buffer-code-exercise && npm install
- 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.
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
.
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
.
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!
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!
- Add a “Load More” button at the end of the list of updates which loads the next 10 updates each time
- Append analytics from the "updates-analytics" collection to each update returned in the
/getUpdates
endpoint - 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. - 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 }, ...]
- Your analytics time series chart may look slightly different from the screenshot below due to your local timezone. This is ok 😉
- The documentation for the API used in Task 3
- On the update "model," the
service_update_id
is the Twitter tweetid
- lowdb
- lowdash
In addition to the screenshot, here is a video of the "Load More" button working component: http://hi.buffer.com/3y2V113r0o3F
1.0