Skip to main content

React

Application structure#

Below are the main files and directories. The main structure remains well inline with Create React App, with some Atomic design principles for React components.

LocationPurpose
src/Only files inside this folder are processed by Webpack
src/index.jsThe JavaScript entry point
src/App.jsThe root React component for the application. Here all page routes all delegated to the router, as well as some base layout
src/ComponentsStandard React components
src/BlocksBlocks are components which are "building blocks" of a page layout. They are always full-width and can be stacked on top of each other. They may make use of standard components
src/ContainersContainers generally wrap React components or blocks, to supply data or interact with the API. This creates a seperation of concerns and allows for more modular, re-usable components
src/PagesEach page is a route or template used by React router
public/Static data. Only files inside public can be used from public/index.html
public/index.htmlThe static html file where React will mount to
build/The build output folder. Completed build appears here after running npm build