Published on July 25, 2023

Thinking About Architecture in Frontend

3 min read

Frontend architecture is the backbone of any web application. It sets the stage for how users interact with your website. A well-designed frontend architecture can mean the difference between a frustrating user experience and a seamless one.

There are many opinions on the internet about how to architect certain types of applications. However, few of these opinions address the process of thinking about architecture and the factors to consider.

This post is framework-agnostic ⚠️

Here are some important things to keep in mind while architecting an application.

The long-term goals

When you’re designing your frontend architecture, think about how it will scale and evolve in the future. Make sure it’s easy to add new features and functionality without breaking the existing code (initial features in the case of a new application).

Thinking about long term goals

As your application grows and changes, you will need to be able to adapt your frontend architecture accordingly. There are many ways this can be achieved, such as by having separation of concerns, writing modular code, testing, or having a defined API for cross-communication.

Start simple

Don’t try to build the perfect frontend architecture all at once.

Thinking about the long term doesn’t mean that we have to handle all possible future situations before starting development. Changes will occur in tandem with evolving business requirements.

So start with a simple, well-structured foundation, and then add features and functionality as needed. This will make it easier to manage your project and its changes.

The objective is to enable everyone to make minimal adjustments, which may involve not just code but also mental models, without necessitating rewrites. Rewrites are costly for any business.

The Business

Talking about the business, the stakeholder of primary importance is the customer itself (the one who generates cash flow). And so, it is important that the architecture provide value to the customer.

There is little to no benefit to the customer if the FE architecture is optimized for build efficiency and not for rendering or loading efficiency. Therefore, understanding the needs of the customer and using the right tools for that particular job is more important.

Go with the basics

Don’t try to reinvent the wheel. Use tools that you know and understand, and that have a large community support. This will make it easier for you to build your application and troubleshoot any problems that you encounter.

Consider the team’s capabilities as well, in order to achieve optimal output. Relearning new technology is not only time-consuming but, also requires a lot of time to master the best practices.

I hope that these aspects have provided you with a fresh perspective on how to think through a front-end architecture. Thank you for taking the time to read and explore these insights!

🎉 Interested in Frontend or Indie-hacking?

I talk about the latest in frontend, along with my experience in building various (Indie) side-projects