-
Notifications
You must be signed in to change notification settings - Fork 53
Project best practices
Dan BROOKS edited this page Oct 15, 2017
·
13 revisions
This project is an ongoing hobby for over 12 years. I transitioned the business logic to hapi.js (previously PHP then Node.js with Express) web application frameworks. This is a living example of how to add new features to legacy code while avoiding a complete re-write due to my architectural choices to use small REST components and now the UI is being refactored to use React.js latest.
To showcase code choices for employers and students I have documented some recent highlights:
-
Component lifecycle methods
- UI allows the sort order to be changed causing React components to update
-
Promisify core modules
- Avoid callbacks
-
Async and many promises
- Avoid blocking code
-
- Avoid deep nesting anti-pattern
-
- Avoid too many arguments
-
- Avoid revealing secrets in public repository
-
- Avoid hardcoded constants
- Unit tests for ES2017 and React.js run for every commit and pull request Linux and Windows CI badges
- Avoid breaking existing behaviour
- Follow best practices with CI services such as Code Climate and Better Code badges
- Avoid committing buggy code
-
CSS Grid to structure columns
- Avoid CSS hacks using flex box or floats