Remix Architecture Patterns

Rate this content
Bookmark
Software architecture serves as the blueprint for applications, and Remix architecture patterns are a key focus. Remix is a hub handler that creates Progressive Enhanced Single-Page Applications (PASPA), which work even without JavaScript. This makes Remix a versatile choice for developers. When migrating from a single-page application to Remix, developers often maintain a standalone API server while progressively integrating Remix features. Popular deployment variants include standalone Node.js environments and edge environments for geographical proximity. The backend for frontend pattern simplifies data fetching from multiple APIs, and Remix naturally supports this pattern. GraphQL can further enhance this by orchestrating and aggregating data. For real-time capabilities, Server-Sent Events (SSE) and WebSockets are viable options in Remix. Using Redis for application caching can mitigate database bottlenecks, and scalable applications can be created using edge environments.

From Author:

Remix provides amazing flexibility and can be deployed anywhere where JavaScript is running. But how does Remix fit into the bigger application landscape of an organization? Remix provides great utility, but how to best take advantage of it? What things should be handled inside of Remix, and what things are better off done elsewhere? Should we use the express adapter to add a WebSocket server or should that be a standalone microservice? How will enterprise organizations integrate Remix into their current stacks? Let’s talk architecture patterns! In this talk, I want to share my thoughts about how to best integrate Remix into a greater (enterprise) stack.

This talk has been presented at Remix Conf Europe 2022, check out the latest edition of this Tech Conference.

FAQ

Software architecture is the blueprint for an application, designed to fulfill specific requirements and solve particular problems. It involves choosing a tech stack to implement the designed architecture.

React has evolved from being just a library to also functioning as an architecture, which can be implemented by different meta frameworks according to Dan Abramov.

Remix architecture pattern involves using Remix as a hub handler running on top of a server environment, often leading to a PASPA (Progressive Enhanced Single-Page Application) that embraces the platform and enhances user interaction, even without JavaScript.

A common migration path to Remix involves moving from technologies like React Router, Next.js, Express.js, and others. Developers often start by integrating their React SPA code into Remix while maintaining a standalone API server, progressively enhancing features using Remix's capabilities.

Popular deployment variants for a Remix application include standalone Node.js environments using an ExpressJS adapter, edge environments for geographical proximity, and adding in-memory caches like Redis to improve performance and scalability.

Unlike traditional SPA architecture which separates the SPA and API server, Remix combines these elements, allowing for backend-for-frontend capabilities and seamless integration of server-side and client-side logic.

In Remix applications, GraphQL can be used to orchestrate and aggregate data from various sources, simplifying the management of APIs and enhancing the backend-for-frontend architecture.

Real-time capabilities in Remix can be implemented using WebSockets or Server-Sent Events (SSE). These technologies allow for live, dynamic user experiences by enabling continuous data flow between the server and the client.

The survey revealed that over 50% of participants use Remix professionally, with many migrating from other technologies. Despite Remix's recent release, it has gained significant traction in the professional community.

Andre Landgraf
Andre Landgraf
23 min
18 Nov, 2022

Comments

Sign in or register to post your comment.

Video Transcription

Available in Español: Patrones de Arquitectura Remix

1. Introduction to Software Architecture and Remix

Short description:

A software architecture is the blueprint for your application. React is now also an architecture that can be implemented by different meta frameworks. Today, I want to talk about Remix architecture patterns. Over 50% of the participants stated that they use Remix professionally. 50% of those who use Remix professionally migrated from React Router to Remix. Let's talk about architecture patterns.

Hey, everyone. What is a software architecture again? A software architecture is the blueprint for your application. You design an architecture to fulfill your requirements and fit to your use case and solve the problem you're having. And then you pick a text deck to implement the architecture that you just signed.

It turns out that React is now also an architecture. This is a really cool take by Dan Abramov, who was recently on Twitter reflecting about the state of React. He states that React is no longer just the library, but also an architecture that can be implemented by different meta frameworks. Really cool take, and I'm excited where this leads.

And today, I want to talk about Remix architecture patterns that is commonly used and implemented architectures with Remix. My name is Andrej. I'm a developer from Germany. I work at LinkedIn and currently live in Cupertino, California. In my free time, every Monday, I tutor aspiring developers on Meetup, and in general, I love building for the web. Before I moved to the United States, I wrote my master's thesis about API management patterns. I conducted interviews, and talked to software engineers and architects from different companies, and then identified patterns in how these companies manage their APIs. I then documented the results in a coherent and organized way. For that, I created a pattern language, and creating that pattern language was a lot of fun to me, and I learned a lot. So, I wanted to do it again, this time for Remix. I want to answer the question, how is Remix used? So, for this, I created a survey that I called The State of Remix, and I got 74 replies. Let's keep in mind that 74 replies is not enough to be statistically relevant, but it's certainly enough to analyze or identify common usage patterns. That said, I still want to showcase some of the numbers that I got out from the survey, just because they surprised me so much.

The first one here is that over 50% of the participants stated that they use Remix professionally. This blew my mind, considering that Remix version 1 has only been released a year ago, but it's really great to see that such a big part of the community already makes money with Remix. Of those who use Remix professionally right now, 50% stated that they migrated from React Router to Remix. I thought this number would be way higher, considering the clear migration path between React Router and Remix, and also obviously the connection between the two technologies. But it turns out folks really move from all different kinds of technologies to Remix. React Single Page Applications was still the biggest source or region where people moved from, but Next.js was mentioned a lot too, Express.js, LGS, Rails, Vue, but in general there are just so many different technologies to build for the web and folks really stated they move from all different kinds of backgrounds and technologies to Remix. I think this is really cool to see, but let's talk about architecture patterns. Before Remix, or in general, we can all agree this is a big part of the industry standard right now. You have the single page application architecture, we have an SPA running on the browser on the front end and you have a standalone API server that then communicates with the SPA.

2. Introduction to Remix Architecture

Short description:

Remix is a HUP handler that runs on top of a server environment. It creates a Progressive Enhanced Single-Page Application (PASPA) that works without JavaScript and embraces the platform. However, Remix is agnostic to the database layer, allowing us to choose our own or use one of the Remix stacks. This is the first architecture pattern for creating web applications with Remix.

So this is the industry standard right now. How does Remix compare to that? When you use MPX grade Remix to bootstrap on your Remix application and you just pick the basics, you end up with this. And this is a server environment, right? Remix is a HUP handler that runs on top of a server environment. And if you bootstrap a Remix application, it comes with a server environment, which is already kind of scaffolded for you. And on that server environment, you have a web server on which the HUP handler runs. That was a mouthful. And that kind of creates this PASPA application. And PASPA is this term that stands for Progressive Enhanced Single-Page Application, coined by Kenzie Dodds to kind of promote that the application that is created by Remix does so much more than an SPA. It even works without JavaScript. It uses the platform, embraces the platform, emulates the browser's default behaviors JavaScript if JavaScript is enabled, and does so many more things for you. So this is why we all love Remix. But if you compare it to the SPA architecture, we see that the database layer is still missing. And here, Remix is agnostic, so we have to just pick a database ourselves or we choose one of Remix stacks and it'll come for free for us. Obviously, this is also optional. You don't always need a database layer. You can also have a CMS instead. But then, either way, what we have here is our first architecture pattern. This is where we all get started with Remix and it's a system architecture that we can use to create for the web.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Building Better Websites with Remix
React Summit Remote Edition 2021React Summit Remote Edition 2021
33 min
Building Better Websites with Remix
Top Content
Remix is a web framework built on React Router that focuses on web fundamentals, accessibility, performance, and flexibility. It delivers real HTML and SEO benefits, and allows for automatic updating of meta tags and styles. It provides features like login functionality, session management, and error handling. Remix is a server-rendered framework that can enhance sites with JavaScript but doesn't require it for basic functionality. It aims to create quality HTML-driven documents and is flexible for use with different web technologies and stacks.
Don't Solve Problems, Eliminate Them
React Advanced Conference 2021React Advanced Conference 2021
39 min
Don't Solve Problems, Eliminate Them
Top Content
Kent C. Dodds discusses the concept of problem elimination rather than just problem-solving. He introduces the idea of a problem tree and the importance of avoiding creating solutions prematurely. Kent uses examples like Tesla's electric engine and Remix framework to illustrate the benefits of problem elimination. He emphasizes the value of trade-offs and taking the easier path, as well as the need to constantly re-evaluate and change approaches to eliminate problems.
Scaling Up with Remix and Micro Frontends
Remix Conf Europe 2022Remix Conf Europe 2022
23 min
Scaling Up with Remix and Micro Frontends
Top Content
This talk discusses the usage of Microfrontends in Remix and introduces the Tiny Frontend library. Kazoo, a used car buying platform, follows a domain-driven design approach and encountered issues with granular slicing. Tiny Frontend aims to solve the slicing problem and promotes type safety and compatibility of shared dependencies. The speaker demonstrates how Tiny Frontend works with server-side rendering and how Remix can consume and update components without redeploying the app. The talk also explores the usage of micro frontends and the future support for Webpack Module Federation in Remix.
Full Stack Components
Remix Conf Europe 2022Remix Conf Europe 2022
37 min
Full Stack Components
Top Content
RemixConf EU discussed full stack components and their benefits, such as marrying the backend and UI in the same file. The talk demonstrated the implementation of a combo box with search functionality using Remix and the Downshift library. It also highlighted the ease of creating resource routes in Remix and the importance of code organization and maintainability in full stack components. The speaker expressed gratitude towards the audience and discussed the future of Remix, including its acquisition by Shopify and the potential for collaboration with Hydrogen.
Understanding React’s Fiber Architecture
React Advanced Conference 2022React Advanced Conference 2022
29 min
Understanding React’s Fiber Architecture
Top Content
This Talk explores React's internal jargon, specifically fiber, which is an internal unit of work for rendering and committing. Fibers facilitate efficient updates to elements and play a crucial role in the reconciliation process. The work loop, complete work, and commit phase are essential steps in the rendering process. Understanding React's internals can help with optimizing code and pull request reviews. React 18 introduces the work loop sync and async functions for concurrent features and prioritization. Fiber brings benefits like async rendering and the ability to discard work-in-progress trees, improving user experience.
Debugging JS
React Summit 2023React Summit 2023
24 min
Debugging JS
Top Content
Watch video: Debugging JS
Debugging JavaScript is a crucial skill that is often overlooked in the industry. It is important to understand the problem, reproduce the issue, and identify the root cause. Having a variety of debugging tools and techniques, such as console methods and graphical debuggers, is beneficial. Replay is a time-traveling debugger for JavaScript that allows users to record and inspect bugs. It works with Redux, plain React, and even minified code with the help of source maps.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Remix Fundamentals
React Summit 2022React Summit 2022
136 min
Remix Fundamentals
Top Content
Featured WorkshopFree
Kent C. Dodds
Kent C. Dodds
Building modern web applications is riddled with complexity And that's only if you bother to deal with the problems
Tired of wiring up onSubmit to backend APIs and making sure your client-side cache stays up-to-date? Wouldn't it be cool to be able to use the global nature of CSS to your benefit, rather than find tools or conventions to avoid or work around it? And how would you like nested layouts with intelligent and performance optimized data management that just works™?
Remix solves some of these problems, and completely eliminates the rest. You don't even have to think about server cache management or global CSS namespace clashes. It's not that Remix has APIs to avoid these problems, they simply don't exist when you're using Remix. Oh, and you don't need that huge complex graphql client when you're using Remix. They've got you covered. Ready to build faster apps faster?
At the end of this workshop, you'll know how to:- Create Remix Routes- Style Remix applications- Load data in Remix loaders- Mutate data with forms and actions
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
JSNation 2023JSNation 2023
174 min
Developing Dynamic Blogs with SvelteKit & Storyblok: A Hands-on Workshop
Top Content
Featured WorkshopFree
Alba Silvente Fuentes
Roberto Butti
2 authors
This SvelteKit workshop explores the integration of 3rd party services, such as Storyblok, in a SvelteKit project. Participants will learn how to create a SvelteKit project, leverage Svelte components, and connect to external APIs. The workshop covers important concepts including SSR, CSR, static site generation, and deploying the application using adapters. By the end of the workshop, attendees will have a solid understanding of building SvelteKit applications with API integrations and be prepared for deployment.
Master JavaScript Patterns
JSNation 2024JSNation 2024
145 min
Master JavaScript Patterns
Featured Workshop
Adrian Hajdin
Adrian Hajdin
During this workshop, participants will review the essential JavaScript patterns that every developer should know. Through hands-on exercises, real-world examples, and interactive discussions, attendees will deepen their understanding of best practices for organizing code, solving common challenges, and designing scalable architectures. By the end of the workshop, participants will gain newfound confidence in their ability to write high-quality JavaScript code that stands the test of time.
Points Covered:
1. Introduction to JavaScript Patterns2. Foundational Patterns3. Object Creation Patterns4. Behavioral Patterns5. Architectural Patterns6. Hands-On Exercises and Case Studies
How It Will Help Developers:
- Gain a deep understanding of JavaScript patterns and their applications in real-world scenarios- Learn best practices for organizing code, solving common challenges, and designing scalable architectures- Enhance problem-solving skills and code readability- Improve collaboration and communication within development teams- Accelerate career growth and opportunities for advancement in the software industry
Back to the Roots With Remix
React Summit 2023React Summit 2023
106 min
Back to the Roots With Remix
Featured Workshop
Alex Korzhikov
Pavlik Kiselev
2 authors
The modern web would be different without rich client-side applications supported by powerful frameworks: React, Angular, Vue, Lit, and many others. These frameworks rely on client-side JavaScript, which is their core. However, there are other approaches to rendering. One of them (quite old, by the way) is server-side rendering entirely without JavaScript. Let's find out if this is a good idea and how Remix can help us with it?
Prerequisites- Good understanding of JavaScript or TypeScript- It would help to have experience with React, Redux, Node.js and writing FrontEnd and BackEnd applications- Preinstall Node.js, npm- We prefer to use VSCode, but also cloud IDEs such as codesandbox (other IDEs are also ok)
How to Solve Real-World Problems with Remix
Remix Conf Europe 2022Remix Conf Europe 2022
195 min
How to Solve Real-World Problems with Remix
Featured Workshop
Michael Carter
Michael Carter
- Errors? How to render and log your server and client errorsa - When to return errors vs throwb - Setup logging service like Sentry, LogRocket, and Bugsnag- Forms? How to validate and handle multi-page formsa - Use zod to validate form data in your actionb - Step through multi-page forms without losing data- Stuck? How to patch bugs or missing features in Remix so you can move ona - Use patch-package to quickly fix your Remix installb - Show tool for managing multiple patches and cherry-pick open PRs- Users? How to handle multi-tenant apps with Prismaa - Determine tenant by host or by userb - Multiple database or single database/multiple schemasc - Ensures tenant data always separate from others