refinedev/refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.

34,510 stars TypeScript 9 components

14 hidden assumptions · 7-stage pipeline · 9 components

Like any codebase, this fullstack makes assumptions it never checks — most are routine. The ones worth your attention are below.

Meta-framework that handles CRUD boilerplate for React apps with authentication, routing, and data providers

The framework operates as a provider-consumer system where the core package provides authentication, routing, and data management hooks, UI packages consume these hooks to render components, data providers abstract backend APIs into a common interface, and development tools generate or transform code. Data flows from backend APIs through data providers to core hooks, then to UI components for rendering.

Under the hood, the system uses 3 feedback loops, 3 data pools, 4 control points to manage its runtime behavior.

A 9-component fullstack. 6773 files analyzed. Data flows through 7 distinct pipeline stages.

Hidden Assumptions

Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".

Worth your attention first

If either payload.ids or params.ids is not an array (e.g., string, null, object), the .map() and .includes() calls will throw TypeError at runtime, causing live subscriptions to crash

Worth your attention first

If Ably delivers malformed messages without a type field, types.includes(message.data.type) throws TypeError, breaking live data synchronization for all subscribers on that channel

Worth your attention first

If auth provider returns null, undefined, or an object without redirectTo, the component may attempt to redirect to undefined URL or fail to redirect at all, leaving users in broken authentication state

Show everything (11 more)
Ordering

Assumes mutation status transitions follow idle → pending → success/error sequence, but switch statement has no validation of status values

If this fails: If mutation library provides unexpected status values (e.g., 'loading', 'cancelled', null), component falls back to idle state, hiding actual save progress from users and causing confusion about data persistence

packages/core/src/components/autoSaveIndicator/index.tsx:AutoSaveIndicator
Resource

Assumes telemetryHook() can always execute successfully during postAction hook, but provides no error handling

If this fails: If telemetry service is down, network is offline, or user has restrictive firewall, unhandled telemetry errors could crash CLI commands after successful completion, making tools appear unreliable

packages/cli/src/cli.ts:bootstrap
Environment

Assumes isGitClean.sync() will only throw errors for 'Not a git repository', but catches all errors and treats them as clean repository

If this fails: If git command fails due to permissions, corruption, or missing git binary, codemod proceeds thinking repo is clean, potentially overwriting uncommitted changes in broken git repositories

packages/codemod/src/index.ts:checkGitStatus
Scale

Assumes breadcrumb arrays will be reasonably small (minItems=2 default), but has no upper limit check on breadcrumbs.length

If this fails: For deeply nested routes with 50+ breadcrumb levels, component renders massive breadcrumb trail that breaks UI layout and makes navigation unusable, with no truncation or overflow handling

packages/antd/src/components/breadcrumb/index.tsx:Breadcrumb
Domain

Assumes event.channel is a valid Ably channel name following Ably's naming conventions (no validation of channel name format)

If this fails: If application passes invalid channel names with spaces, special characters, or exceeding length limits, Ably SDK throws errors that propagate to UI, breaking live data publishing for affected resources

packages/ably/src/index.ts:liveProvider.publish
Temporal

Assumes channelInstance from subscribe return value is still valid when unsubscribe is called, but channels can be detached or garbage collected

If this fails: If channel becomes detached between subscribe/unsubscribe calls, channelInstance.unsubscribe() may fail silently or throw, leaving ghost event listeners that continue consuming memory and processing irrelevant events

packages/ably/src/index.ts:liveProvider.unsubscribe
Contract

Assumes useIsAuthenticated hook always returns data object with authenticated property, but destructures data directly without null checks

If this fails: If auth provider hook returns null/undefined instead of {authenticated: boolean}, component crashes with 'Cannot destructure property authenticated of undefined', breaking route protection entirely

packages/core/src/components/authenticated/index.tsx:useIsAuthenticated
Shape

Assumes matchResourceFromRoute always returns object with found property, but accesses rootRouteResource.found without null checking rootRouteResource

If this fails: If route matching fails and returns null, accessing rootRouteResource.found throws TypeError, preventing breadcrumb rendering and potentially crashing the entire navigation component

packages/chakra-ui/src/components/breadcrumb/index.tsx:matchResourceFromRoute
Resource

Assumes jscodeshift executable and transformer files exist at computed paths, but only checks require.resolve for jscodeshift binary

If this fails: If transformer files are missing from dist/transformations directory after build, transformation fails with cryptic 'module not found' errors instead of helpful messages, leaving developers unable to run migrations

packages/codemod/src/index.ts:runTransform
Ordering

Assumes availableIntegrations.find() will return integration object with runTransformer method, but doesn't validate the method exists before calling

If this fails: If integration definition is incomplete or malformed, integration.runTransformer() throws 'is not a function' error, causing add command to fail after user selection without clear indication of configuration issue

packages/cli/src/commands/add/index.ts:addCommandAction
Environment

Assumes printAnnouncements() async function will always resolve successfully, but calls await without error handling

If this fails: If announcement service is unreachable or returns malformed data, dev command fails to start due to unhandled promise rejection, blocking local development when announcement feature should be non-critical

packages/cli/src/cli.ts:printAnnouncements

Open the standalone hidden-assumptions report for refine →

How Data Flows Through the System

The framework operates as a provider-consumer system where the core package provides authentication, routing, and data management hooks, UI packages consume these hooks to render components, data providers abstract backend APIs into a common interface, and development tools generate or transform code. Data flows from backend APIs through data providers to core hooks, then to UI components for rendering.

  1. Authentication Check — The Authenticated component uses useIsAuthenticated hook to query the active auth provider, checking if user credentials are valid and determining redirect behavior [AuthenticatedProps → Authentication status]
  2. Route Protection — Based on authentication status, the component either renders children content, shows fallback UI, or redirects to login page using the router provider [Authentication status → Conditional rendering]
  3. Real-time Subscription — Live providers like Ably create channel subscriptions, filter incoming events by type and resource IDs, then invoke callbacks to update React components [Channel subscriptions → LiveEvent]
  4. Form Auto-save — Form mutations trigger auto-save operations, updating the AutoSaveIndicator component with success, error, loading, or idle status based on mutation state [Form mutation status → AutoSaveIndicatorProps]
  5. Project Scaffolding — CLI commands check GitHub for example availability, download and extract project files, initialize git repository, and install dependencies using detected package manager [Command arguments → Project files]
  6. Code Transformation — Codemod tools parse source files, apply jscodeshift transformations for version migrations or pattern updates, then write modified code back to filesystem [Source files → Modified code]
  7. Data Provider Integration — Data providers like Airtable translate Refine's standard CRUD interface into backend-specific API calls, handling filtering, sorting, and pagination [Query parameters → Normalized data]

Data Models

The data structures that flow between stages — the contracts that hold the system together.

LiveEvent packages/ably/src/index.ts
interface with type: string, channel: string, payload?: { ids?: string[] } representing real-time data change notifications
Created when backend data changes, published to Ably channels, filtered by event type and IDs, then delivered to React components via callbacks
AutoSaveIndicatorProps packages/core/src/components/autoSaveIndicator/index.tsx
interface with status: 'success'|'error'|'pending'|'idle', data?, error?, elements?: { success, error, loading, idle } React nodes
Updated by form mutation status, rendered as visual feedback to users about save state
AuthenticatedProps packages/core/src/components/authenticated/index.tsx
interface with key: React.Key, redirectOnFail?: string | true, fallback?: ReactNode, loading?: ReactNode, children?: ReactNode, params?: any
Consumed by Authenticated component, triggers auth provider check, conditionally renders children or redirects based on authentication status
BreadcrumbProps packages/antd/src/components/breadcrumb/index.tsx
RefineBreadcrumbProps<AntdBreadcrumbProps> with breadcrumbProps?, showHome?: boolean, hideIcons?: boolean, meta?, minItems?: number
Generated from current route and resource configuration, rendered as navigation trail in UI

System Behavior

How the system operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

GitHub Repository Cache (file-store)
Temporary downloaded example projects before extraction to local filesystem
Authentication State (state-store)
Cached user authentication status and redirect information from auth providers
Live Event Channels (queue)
Ably real-time channels accumulating data change events filtered by type and resource IDs

Feedback Loops

Delays

Control Points

Technology Stack

React (framework)
Core UI library providing hooks, components, and context for the framework architecture
TypeScript (runtime)
Primary language providing type safety across all packages and ensuring API contract consistency
Lerna (build)
Monorepo management tool coordinating package builds, dependencies, and publishing workflows
Biome (build)
Code formatting and linting tool ensuring consistent style across all packages
Commander.js (library)
CLI framework in the cli package for parsing commands and orchestrating development workflows
jscodeshift (build)
AST transformation engine in codemod package for automated code migrations between versions
Ably (library)
Real-time messaging platform providing live data synchronization in the ably package
Ant Design (library)
UI component library providing pre-built components in the antd integration package
Chakra UI (library)
UI component library providing accessible components in the chakra-ui integration package
Cypress (testing)
E2E testing framework for validating example applications and integration workflows

Key Components

Package Structure

core (library)
Headless core providing hooks, components, and context providers for authentication, data management, routing, and form handling
cli (tooling)
Command-line tool for scaffolding projects, adding resources/providers, running dev servers, and managing updates
create-refine-app (tooling)
Project scaffolding tool that downloads example projects from GitHub and sets up development environment
antd (library)
Ant Design UI integration providing pre-built components like breadcrumbs, forms, tables, and auto-save indicators
chakra-ui (library)
Chakra UI integration providing pre-built components with consistent theming and accessibility
airtable (library)
Data provider for Airtable API with filtering, sorting, and formula generation utilities
appwrite (library)
Data and live providers for Appwrite backend-as-a-service with real-time subscriptions
ably (library)
Live provider for Ably real-time messaging with channel subscriptions and event filtering
codemod (tooling)
Code transformation tool using jscodeshift to migrate between Refine versions and update patterns
devtools (tooling)
Development panel and provider for debugging Refine applications with runtime inspection

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Fullstack Repositories

Frequently Asked Questions

What is refine used for?

Meta-framework that handles CRUD boilerplate for React apps with authentication, routing, and data providers refinedev/refine is a 9-component fullstack written in TypeScript. Data flows through 7 distinct pipeline stages. The codebase contains 6773 files.

How is refine architected?

refine is organized into 5 architecture layers: Core Framework, UI Integrations, Data Providers, Development Tools, and 1 more. Data flows through 7 distinct pipeline stages. This layered structure keeps concerns separated and modules independent.

How does data flow through refine?

Data moves through 7 stages: Authentication Check → Route Protection → Real-time Subscription → Form Auto-save → Project Scaffolding → .... The framework operates as a provider-consumer system where the core package provides authentication, routing, and data management hooks, UI packages consume these hooks to render components, data providers abstract backend APIs into a common interface, and development tools generate or transform code. Data flows from backend APIs through data providers to core hooks, then to UI components for rendering. This pipeline design reflects a complex multi-stage processing system.

What technologies does refine use?

The core stack includes React (Core UI library providing hooks, components, and context for the framework architecture), TypeScript (Primary language providing type safety across all packages and ensuring API contract consistency), Lerna (Monorepo management tool coordinating package builds, dependencies, and publishing workflows), Biome (Code formatting and linting tool ensuring consistent style across all packages), Commander.js (CLI framework in the cli package for parsing commands and orchestrating development workflows), jscodeshift (AST transformation engine in codemod package for automated code migrations between versions), and 4 more. This broad technology surface reflects a mature project with many integration points.

What system dynamics does refine have?

refine exhibits 3 data pools (GitHub Repository Cache, Authentication State), 3 feedback loops, 4 control points, 3 delays. The feedback loops handle auto-scale and retry. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does refine use?

5 design patterns detected: Provider Pattern, Hooks Composition, Conditional Rendering Gateway, Headless UI Architecture, Code Generation and Transformation.

Analyzed on April 20, 2026 by CodeSea. Written by .