Skip to content

A sample hero and chart component written in React (with Webpack) for an analytics platform containing data-driven graph animations run with the help of D3.

Notifications You must be signed in to change notification settings

r0ughnex/analytics-animations-d3-react-webpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Analytics Animations with D3 and React Codeship Status for r0ughnex/analytics-animations-d3-react-webpack

NAME: analytics-animations-d3-react-webpack
AUTHOR: Pradeep Sekar

REPOSITORY:
https://github.com/r0ughnex/analytics-animations-d3-react-webpack

AWS STAGING (develop):
http://analytics-animations-d3-react-webpack.develop.s3-website-ap-southeast-2.amazonaws.com

AWS STAGING (master):
http://analytics-animations-d3-react-webpack.master.s3-website-ap-southeast-2.amazonaws.com

Table of Contents

A Brief Overview

This project is an extension of two individual technical tests combined into one, which contains a sample hero and chart component written in React (with Webpack) for an analytics platform containing data-driven graph animations run with the help of D3.

Essential Deliverables

  • status complete Create a Hero component that fills the entire viewport containing a simple D3 chart.
  • status complete Create a Button module within the hero that changes the data shown on the chart.
  • status complete Demonstrate solid understanding of component lifecycle methods and best practises.
  • status progress  Demonstrate ability to write unit tests with Jest and Enzyme (at least 80% coverage).
  • status complete Integrate application with a CI/CD tool of choice and deploy to a staging environment.

Optional Deliverables

  • status complete Bonus points if the chart is responsive and has been augmented with D3 transitions.
  • status pending   Bonus points if a state management pattern such as Flux or Redux has been utilized.

Getting Started

Install the latest LTS version of Node and it's package manager (which were 8.9.1 and 5.5.1 at the time of writing this document). Once Node is installed on your machine, open the terminal or command prompt at the root of the project directory and run the following commands.

npm install -g webpack
npm install
npm start

Then open http://localhost:3000/ to see the app run on the local development server. There is no need to configure tools like Webpack or Babel, since they have already been pre-configured so that you can focus on the code.

npm start

Available Scripts

This project was Bootstrapped with and ejected from Create React App. Additonal configuration options, so as to be able to use features (and tools) like Enzyme, CSS Modules and Pre-rendering (or minimalist Server Side Rendering) have been added the the build. In the root project directory, you can run the following commands:

npm start

This runs the app in the development mode. You can open http://localhost:3000/ to view it in the browser. The current view will reload if you make edits to and save any of the files imported within the app. You will also see ESLint errors in the console.

npm test

This launches the Jest test runner in interactive watch mode. The tests will reload if you make edits to and save any of the files imported within the app. You can also filter (or skip) and drill-down into each test suite using the commands displayed on the console.

npm run build

This builds the app for production to the build folder. It correctly bundles React in production mode and optimizes the build for best performance. It also does Pre-rendering by taking snapshots of all the routes configured in the package.json file. The build files are minified and the filenames include hashes. The app is now ready to be deployed!

serve -s build

This launches the app in Pre-rendered production mode (once built) on your local machine using a Node server. You can open http://localhost:5000 to view it in the browser, or follow the instructions and link displayed in the console to view it on a mobile device connected to the same network.

Deploying to AWS S3

There are two AWS S3 buckets that have been configured for this project, one on develop and another on master. If you want a new AWS S3 bucket created on a specific feature branch that you are currently working on, contact someone who has admin access to this repository, to create and configure one for you.

Staging for Develop

If you are on a feature branch and want to deploy to the bucket configured on develop, then merge your feature branch into develop through a pull request and get it approved. Once the pull request is approved, merged and commited into develop, Codeship will automatically compile, bundle and build the neccessary files and deploy it to the relevant AWS S3 bucket configured on that branch (links listed at the top).

Staging for Master

If you are on develop and want to deploy to the bucket configured on master, then use git flow to create a new release branch from develop and merge the release branch into master. Once the release is merged and commited into master, Codeship will automatically compile, bundle and build the neccessary files and deploy it to the relevant bucket configured on that branch (links listed at the top).

About

A sample hero and chart component written in React (with Webpack) for an analytics platform containing data-driven graph animations run with the help of D3.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published