Frontend
This checklist outlines how our React frontend should be developed, verified, and deployed across environments.
Use it top-to-bottom when preparing changes for development/staging/production.
Quick checklist
- Environment variables set correctly (
.env.development,.env.staging,.env.production) - Dependencies installed and up-to-date
- TypeScript type-checks pass
- ESLint passes (no unused vars/imports)
- Prettier formatting clean
- SCSS builds without errors
- Unit tests pass (Jest)
- Build succeeds
- Source maps handled correctly
- Deploy to intended Firebase hosting project only
- Rollbar clean after deploy
Environments
-
Projects
- development: Development Firebase project
- staging (default): Not-prod Firebase project
- production: Production Firebase project
-
Node version: Check engines field in package.json
-
Environment files:
.env.development.env.staging.env.production
Prerequisites
- Node.js installed (version matching package.json engines)
- Firebase CLI installed and logged in
- Access to all Firebase projects
- Environment files configured
sassinstalled for SCSS compilation
Environment setup
-
Environment variables are loaded based on
REACT_APP_NODE_ENV:- development:
.env.development - staging:
.env.staging - production:
.env.production
- development:
-
Verify environment file exists for your target environment before starting
Local development
- Start development server against staging (default):
npm start
- Start against production environment:
npm run start-prod
Code quality gates
- SCSS compilation:
npm run build-css
- Type checking:
# TypeScript checks are part of the build process
npm run build
-
ESLint:
- Configured in package.json under "eslintConfig"
- Extends "react-app" defaults
-
Prettier:
# Check formatting
npx prettier --check "src/**/*.{ts,tsx,js,jsx,json,css,scss,md}"
# Auto-format
npx prettier --write "src/**/*.{ts,tsx,js,jsx,json,css,scss,md}"
- Unit tests:
npm test
Build
The build process includes:
- SCSS compilation
- TypeScript compilation
- Asset optimization
- Source map generation
# Build for staging
npm run build-for-staging
# Build for production (includes source map handling)
REACT_APP_NODE_ENV=production REACT_APP_GIT_SHA=`git rev-parse HEAD` npm run build
Source Maps
For production, source maps are:
- Generated during build
- Moved to sourceMaps/ directory
- Uploaded to Rollbar for error tracking
npm run upload-source-maps
Deployment
Always verify the target Firebase project first with firebase use.
- Deploy to staging (default project):
npm run deploy-staging
- Deploy to development:
npm run deploy-development
- Deploy to production (includes source map handling):
npm run deploy
The production deploy script:
- Sets production env and build timestamp
- Builds the application
- Handles source maps
- Deploys to Firebase hosting
- Updates Firebase version
Post-deploy verification
- Verify the application loads in the browser
- Check critical user flows
- Monitor Rollbar for any new errors
- Verify environment variables are correct
- Check Firebase hosting version
Troubleshooting
-
Build fails on SCSS
- Run
npm run build-cssseparately to isolate SCSS errors - Check for missing SASS dependencies
- Run
-
Environment variables not loading
- Verify
.env.[environment]file exists - Check
REACT_APP_NODE_ENVis set correctly - Remember all env vars must start with
REACT_APP_
- Verify
-
Source maps not working
- For production: verify
upload-source-mapscompleted - Check Rollbar source map configuration
- Verify build process didn't fail midway
- For production: verify
-
Deploy targets wrong project
- Check
firebase usecurrent project - Verify
-Pflag in deploy commands - Review
firebaseConfigin your app
- Check
-
CSS not updating
- Clear browser cache
- Verify
watch-cssis running - Check SCSS compilation errors
Pre-merge gate (copy/paste)
- Environment files validated for target environments
-
npm run build-csssucceeds - TypeScript checks pass
- ESLint passes
- Prettier check passes or code formatted
-
npm testpasses - Build succeeds for target environment
- Source maps handled (if production)
- Deploy command for target environment verified
- Application loads and functions in browser
- Rollbar reporting configured and clean