This is a syntenthesis of best practices when building a new React App in Sparkgeo.
This template is meant for single-page applications (SPAs), as well as Progressive Web Apps (PWAs). If you are looking for Server Side Rendered applications or Static Site Generator, this is not a starter repo you want at all.
Each of these directories are of a single depth.
Directory | Description |
---|---|
components |
All visual components |
helpers |
Immutable JS functions |
lib |
All JS tools that aren't immutable helper functions |
File Name | Description |
---|---|
theme.js | Theme information for grommet and styled components |
App.css | All CSS for all core DOM elements |
.eslintrc | Instructions for linting rules |
.eslintignore | Where to ignore the linting rules entirely |
.prettierrc | Configuration instructions for autoformat rules |
.serviceWorker.js | Autogenerated file by CRA that assists with PWAs |
- App.css for global rules of HTML elements
- 1rem = 10px by default
- Grommet for abstract primitives (Box, Form, FormField, etc)
- Styled Components for styling at the component-level.
TBD - Jest for Unit Tests and Integration; Cypress for E2E
Linting is based on a subset of AirBNB's style guide and internal best practices.