Frontend Development Guidelines

This document aims to serve as a baseline for the majority of medium to large-scale front-end / JavaScript-based projects in Arbisoft. We've curated the best practices in one place in order to ensure adherence to the quality level, performance, and extensibility of the products we deliver.

Beyond all of the guidelines mentioned here, the most important thing to make an effort for is developing a culture of creating quality among ourselves; the rest will follow automatically.


Note: The recommendations of tools and libraries present in this document are suggested based on their long-standing past experiences and great track record in the industry for their performance and maintainability. Nonetheless, we know that the JS world is continuously evolving with innovation. Therefore if there is any library/tool superior to the suggested ones in this document, please discuss with the committee and we shall incorporate it in our guidelines.


Definitions

Marker Title Definition
Highest Priority Must be implemented or followed. This can not be compromised in any case.
⚠️ Medium Priority Should be implemented or followed. This can only be left over with a fairly justifiable rationale and a future plan to handle later on.
💡 Low Priority Good to Have but can be ignored in the interest of available resources and project priorities.

1. Choice of Framework for Frontend

Choose a framework for a frontend that can build applications that are able to be used by thousands and millions of users. Keep performance, extensibility, and community support in mind when choosing a framework. Our recommendations of the framework(s) are:

React.JS with Redux


1.2 Scaffolding 💡


1.3 UI Development ⚠️


1.4 Optimizing Ubiquitous Feature Aspects ❗⚠️


1.5 CSS Framework ⚠️


1.6 Language for Development ⚠️❗


1.7 Lint Your Code ❗❗


2. Optimize React Apps for Speed & Extensibility

2.1 React.JS ❗


2.2 Redux ❗


3. Performance Optimization

3.1 JavaScript ❗


3.2 CSS ❗


3.3 HTML ❗


3.4 Bundler Performance Optimization ❗

Modern web applications often use bundling tools like Webpack or Parcel. Whatever bundler you use, there are certain aspects to take care of:


3.5 Wholistic App Optimization Principles


4. Configuration, Deployment, Release, Monitor

4.1 Manage Secrets and App Constants as Configurations ❗


4.2 Reproducibility with Containerization ⚠️


4.3 Dev/Prod Separation


4.4 Setup CI 💡


4.5 Monitor for Events in Production ❗


5. Test Your Code

Testing is an essential part of the application lifecycle and it increases the maturity of the codebase with increasing feature-set. Jest provides the most advanced test-runner with a lot of built-in assertions. react-testing-library


5.1 Snapshot Testing 💡


5.2 Integration Testing ⚠️

You should write e2e integration tests that can fire up some actions, trigger sagas to execute processes of application, and then finally test the expected state of reducers. ⚠️

This is the most crucial part of testing and if the project uses redux-sagas, the testing experience is really intuitive and meaningful. This is another reason to ditch redux-thunks in favor of sagas.


5.3 Setup Unit Testing of Utilities ⚠️

With simple test assertions of Jest, one should write unit tests for all utility functions/helpers present in the codebase to ensure correct behavior. ⚠️


5.4 Monitor and Achieve a Higher Code Coverage ⚠️


5.5 Automation of Acceptance Testing 💡


5.6 Setup Code Contribution Insights 💡