remix-run/remix
Build Better Websites. Create modern, resilient user experiences with web fundamentals.
Modular web framework built on Web APIs with composable packages
HTTP requests flow through middleware chains, with context passed between layers and responses transformed on the way back
Under the hood, the system uses 2 feedback loops, 2 data pools, 3 control points to manage its runtime behavior.
Structural Verdict
A 10-component fullstack with 1 connections. 864 files analyzed. Minimal connections — components operate mostly in isolation.
How Data Flows Through the System
HTTP requests flow through middleware chains, with context passed between layers and responses transformed on the way back
- Request Parsing — Incoming HTTP requests parsed into Web API Request objects
- Middleware Processing — Request flows through composable middleware chain (auth, CORS, compression)
- Route Matching — URL patterns matched against registered routes using route-pattern
- Handler Execution — Route handlers execute with access to request context and middleware state
- Response Processing — Responses flow back through middleware for compression, headers, cookies
System Behavior
How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.
Data Pools
Request context storage for async execution
User session data with pluggable backends
Feedback Loops
- OAuth State Verification (retry, balancing) — Trigger: OAuth callback with invalid state. Action: Reject request and clear transaction. Exit: Valid state parameter received.
- CSRF Token Rotation (cache-invalidation, balancing) — Trigger: Token validation failure. Action: Generate new token and store in session. Exit: Valid token submitted.
Delays & Async Processing
- OAuth Authorization Flow (async-processing, ~user-dependent) — User redirected to provider and back
- Compression Processing (async-processing, ~response-size-dependent) — Response buffered and compressed before sending
Control Points
- Compression Threshold (threshold) — Controls: Minimum response size for compression. Default: 1024 bytes
- CORS Origin Validation (runtime-toggle) — Controls: Dynamic origin allow/deny decisions
- Auth Scheme Selection (feature-flag) — Controls: Which authentication methods to attempt
Package Structure
This monorepo contains 8 packages:
Main framework package that re-exports all other packages for easy consumption
Core HTTP router built on Web APIs with middleware support
React-like component system for building user interfaces
OAuth and credential-based authentication with multiple provider support
Type-safe data validation implementing Standard Schema v1 specification
Database-agnostic query builder with pagination and filtering
Type-safe session management with pluggable storage backends
Middleware for storing request context in AsyncLocalStorage
Technology Stack
Primary language with strict typing
Foundation using Request, Response, URL, AsyncLocalStorage
Interoperable validation specification
Primary runtime with async_hooks support
Alternative JavaScript runtime
Package manager with workspace support
Fast TypeScript linter
Code formatting
Key Components
- createRouter (function) — Creates HTTP routers with middleware support built on Web APIs
packages/fetch-router/src/index.ts - asyncContext (function) — Middleware that stores request context in AsyncLocalStorage for access anywhere
packages/async-context-middleware/src/lib/async-context.ts - auth (middleware) — Authentication middleware that validates requests and stores auth state
packages/auth-middleware/src/lib/auth.ts - Schema (class) — Type-safe data validation compatible with Standard Schema v1 spec
packages/data-schema/src/lib/schema.ts - Component (class) — Base component class providing React-like lifecycle and state management
packages/component/src/index.ts - createOAuthProvider (function) — Creates OAuth providers for third-party authentication flows
packages/auth/src/lib/provider.ts - DataTable (class) — Database-agnostic query builder with pagination and filtering
packages/data-table/src/index.ts - Session (class) — Type-safe session management with pluggable storage backends
packages/session/src/index.ts - cors (middleware) — CORS middleware with dynamic origin validation and preflight handling
packages/cors-middleware/src/lib/cors.ts - compression (middleware) — Automatic response compression with Brotli, gzip, and deflate support
packages/compression-middleware/src/lib/compression.ts
Configuration
cspell.yml (yaml)
version(string, unknown) — default: 0.2language(string, unknown) — default: enwords(array, unknown) — default: accentunder,actiontype,activedescendant,aftertoggle,arcrole,Arcrole,autocorrect,backlink,bbox,biblioentry,biblioref,Booleanish,braillelabel,brailleroledescription,closedby,closerequest,colcount,colindex,colindextext,columnalign,columnlines,columnspacing,columnspan,commandfor,contenteditable,contentinfo,controlslist,denomalign,describedby,desync,disableremoteplayback,displaystyle,DOMCSS,dropeffect,elementtiming,enterkeyhint,exportparts,fetchpriority,fixpoint,flowto,focusin,focusout,fontstyle,fontweight,formaction,formenctype,formmethod,formnovalidate,formtarget,FOUC,framespacing,glossref,haspopup,healthcheck,horiz,hsba,inlist,inputmode,itemprop,itemref,itemscope,itemtype,jsxs,keybind,keyshortcuts,keyup,labelledby,largeop,linethickness,lquote,lspace,maction,mathbackground,mathcolor,mathsize,mathvariant,maxlength,maxsize,menclose,menuitemcheckbox,menuitemradio,merror,mfenced,mfrac,Microdata,minsize,Mmulti,mmultiscripts,movablelimits,mpadded,mpath,mphantom,mprescripts,mroot,mrow,mspace,msqrt,mstyle,msub,msubsup,msup,mtable,mtext,multiselectable,munder,munderover,noteref,novalidate,numalign,outerclick,pagebreak,pagelist,panose,playsinline,pointerdown,pointerenter,pointerleave,pointermove,pointerup,popovertarget,popovertargetaction,posinset,pullquote,referrerpolicy,renderable,roledescription,roletype,rowalign,rowcount,rowindex,rowindextext,rowlines,rowspacing,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,sectionhead,setsize,Signalish,spinbutton,statusline,stemh,stemv,subscriptshift,Subsup,superscriptshift,SVGM,treegrid,treeitems,unitless,unkeyed,valuenow,valuetext,vdom,visibilitychange,vnode,VNODE,vnodes,voffset,wmode,xlinkignorePaths(array, unknown) — default: node_modules/**,dist/**,build/**,pnpm-lock.yaml
pnpm-workspace.yaml (yaml)
catalog.@types/node(string, unknown) — default: ^24.6.0catalog.@typescript/native-preview(string, unknown) — default: 7.0.0-dev.20251125.1catalog.playwright(string, unknown) — default: ^1.53.1catalog.tsx(string, unknown) — default: ^4.20.6catalog.typescript(string, unknown) — default: ^5.9.3packages(array, unknown) — default: demos/*,docs,packages/*,packages/fetch-router/demos/*,packages/form-data-parser/demos/*,packages/component/demos,packages/component/bench,packages/component/bench/frameworks/*,packages/lazy-file/scripts,packages/multipart-parser/bench,packages/multipart-parser/demos/*,packages/node-fetch-server/bench,packages/node-fetch-server/demos/*,packages/route-pattern/bench,packages/static-middleware/demos/*,packages/tar-parser/bench,scriptsshellEmulator(boolean, unknown) — default: true
Explore the interactive analysis
See the full architecture map, data flow, and code patterns visualization.
Analyze on CodeSeaRelated Fullstack Repositories
Frequently Asked Questions
What is remix used for?
Modular web framework built on Web APIs with composable packages remix-run/remix is a 10-component fullstack written in TypeScript. Minimal connections — components operate mostly in isolation. The codebase contains 864 files.
How is remix architected?
remix is organized into 5 architecture layers: Core Runtime, Middleware, Data Layer, Components, and 1 more. Minimal connections — components operate mostly in isolation. This layered structure keeps concerns separated and modules independent.
How does data flow through remix?
Data moves through 5 stages: Request Parsing → Middleware Processing → Route Matching → Handler Execution → Response Processing. HTTP requests flow through middleware chains, with context passed between layers and responses transformed on the way back This pipeline design reflects a complex multi-stage processing system.
What technologies does remix use?
The core stack includes TypeScript (Primary language with strict typing), Web APIs (Foundation using Request, Response, URL, AsyncLocalStorage), Standard Schema v1 (Interoperable validation specification), Node.js (Primary runtime with async_hooks support), Bun (Alternative JavaScript runtime), PNPM (Package manager with workspace support), and 2 more. A focused set of dependencies that keeps the build manageable.
What system dynamics does remix have?
remix exhibits 2 data pools (AsyncLocalStorage, Session Storage), 2 feedback loops, 3 control points, 2 delays. The feedback loops handle retry and cache-invalidation. These runtime behaviors shape how the system responds to load, failures, and configuration changes.
What design patterns does remix use?
5 design patterns detected: Middleware Chain, Context Keys, Standard Schema, Provider Pattern, Web API First.
Analyzed on March 31, 2026 by CodeSea. Written by Karolina Sarna.