This app is meant to serve as the basis for my future React apps. It has my preferred technologies, testing frameworks, and project structure pre-configured so that I don't have to set up the same boilerplate with every project. If you're curious about my opinions and preferences when it comes to frontend development, this is a great place to look!
- Clone this project if it is not already on your machine.
- When you want to create a new app based on this template, create a new directory for the project with
mkdir [new-project-name-here]
- Copy/paste this repo's files & folders into the new directory.
- Make sure you copy the hidden
.eslintrc.js
and.gitignore
files. (Display these in Finder by hitting Command + Shift + . ) However, you probably don't want to copy the.git
ornode_modules/
directories.
- Make sure you copy the hidden
- Install packages with
npm i
- Confirm everything is working as expected by running
npm run test
- Setup the new project's git repo with
git init
- At this point, if you don't want to commit a bunch of CHANGE_ME variable names, you should change these values. See "To Customize" below.
- Create an initial commit with
git add . && git commit -m "Initial commit from template app"
. - Create a new remote repository for the app on your preferred host (GitHub, Bitbucket, etc.)
- Add the remote origin with
git remote add origin [url-provided-by-repo]
- Commit to remote with
git push -u origin main
- Begin development!
*If these instructions seem overly specific, it's because I don't trust my own memory--not because I don't trust your capabilities. I've been burned one too many times by telling myself "Surely I'll remember how to do this forever!" As a result I lean toward excess specificity in things like this, just in case.
There are several fields which will be different for every app, like site title, footer copyright owner, site icon, etc. Find these by searching for CHANGE_ME
across the entire app directory, including file names. Change these fields/files.
- Install packages:
npm i
- Start app:
npm start
- Start app in background using
pm2
:npm run start-background
- Kill background app process:
npm run kill-background
- Run all tests (lint, unit, and integration/visual):
npm run test
- Run unit tests:
npm run jest
- Run lint:
npm run lint
- Open integration/visual tests:
npm run cypress:open
The app's JSX files are categorized into pages and components. Redux actions and reducers are housed in their own directories as well. The app's overall styles are set in index.scss
and its style constants are defined in globals.scss
. Each .scss
file should import globals.scss
. Linter preferences are defined in .eslintrc.js
and unit test setup is performed in setupTests.js
. Cypress tests are configured in their own top-level directory.
- UI Framework: React (using Create React App)
- State Manager: Redux
- Package Manager: NPM
- Routing: React-Router-Dom
- CSS Processor: SASS
- Unit Tests: Jest/Enzyme
- Linter: ESLint
- Visual Regression Tests: cypress-visual-regression
- Integration Tests: Cypress