Client-Side Architecture Basics [Guide]
Client-Side ArchitectureWelcome
When I first learned React and Redux in 2015, I made an enormous mess of the production codebase I was working on.
Back then, class-based components and Redux were the coolest kids on the block. This was my first time prepping up to work on a real-world React project, so I bought the best courses I could find on the topics and dove in.
After a couple of months, according to the React community, the way I was doing things were outdated. There were newer, cleaner, and recommended best practices for me to follow.
I think it's incredible that we question the way we do things. But my vast gap in knowledge of client-side architecture left me always finding it necessary to play catch up to refactor to the new approaches.
These sentiments were also recently echoed in this painfully accurate Twitter thread from Joel Hooks.
Developers are confused about where to start and what to choose when they start learning to write high-quality React applications. They want a strong foundation of knowledge and the confidence to architect React applications at scale built to current industry standards.
They are frustrated that there are no widely accepted standards for building React applications consistently, coherently, and with minimal risks to their professional reputations and livelihoods.
On top of that, there is a sea of choices and tradeoffs that React developers face every day. From how the project is even started, which framework to use, how to manage state, how does it get bundled, accessibility, and deployment just to get going.
At each f🐬kin' stop, there's a new choice to make: a new chance to be wrong.
Trying to build a solid foundation in React feels like a slot machine. — @jhooks, June 17th, 2020
Some point later in my developer journey, I too realized this was happening. I realized I could never keep up to date with the current trends of the libraries and frameworks I was using. I also decided I didn't want those nuances to dictate my professional reputation or livelihood. It wasn't good enough for me. I needed something better.
Eventually, I sought out the originating principles— the fundamentals, to client-side architecture. I sought out to construct a standard for building client-side apps. A professional one. One based on the software design principles that have helped us design robust software for decades.
This guide teaches you client-side architecture fundamentals.
It's the result of my research using first principles on how to design and develop robust, flexible, testable, and maintainable client-side applications.
During my experience working on client-side apps of varying sizes, I've realized that some serious upfront design on the architecture can have a significant impact on the quality of the code for the duration of its life.
From simple dashboards to multi-layered apps with rendering layers, domain logic, multiple types of users - this guide teaches you the essential design principles front-end developers inadvertently code around within their everyday programming jobs.
This guide proposes architectural standards for client-side web development.
While we're primarily focused on React, because it's the most popular library with the least structure, the principles are transferrable to any configuration of view-layer library or framework.
Programming tends to seem more like a trade than a science. Each tool, be it a state management library, API, or a transport-layer technology, is best suited to solve a particular set of problems. As a developer and a tradesperson, it's good to know how the tools in our toolbox are best used.
... if all you have is a hammer, everything looks like a nail.
At the end of this guide, you'll learn a standard for web development. You'll have a clear understanding of the discrete layers of concerns in a client-side app: from the view layer to various forms of state management, and how to handle interaction (app) logic.
Prerequisites
- Familiarity with at least one front-end view layer library (like React) or an opinionated framework like Angular.
- Knowledge of at least one state management approach (like React Context, Redux, Angular services, NgRx, etc).
- (optional) Knowing When CRUD & MVC Isn't Enough | Enterprise Node.js + TypeScript
- (optional) "A Treatise on State" by Jed Watson
Stay in touch!
Join 20000+ value-creating Software Essentialists getting actionable advice on how to master what matters each week. 🖖
View more in Client-Side Architecture