Refine.dev Framework
Refine is a headless React framework for building enterprise CRUD applications. It provides data fetching, routing, authentication, and access control out of the box while remaining UI-agnostic.
When to use
- Building admin panels, dashboards, or internal tools with React
- Need CRUD operations with various backends (REST, GraphQL, Supabase, Strapi, etc.)
- Want a headless approach with Mantine UI integration
- Setting up Vite-based React projects with data management
- Implementing authentication flows in React admin apps
Core Concepts
Refine is built around these key abstractions:
- Data Provider — adapter for your backend (REST, GraphQL, etc.)
- Resources — entities in your app (e.g.,
posts, users, products)
- Hooks —
useList, useOne, useCreate, useUpdate, useDelete, useForm, useTable
- Auth Provider — handles login, logout, permissions
- Router Provider — integrates with React Router, etc.
Quick Start (Vite)
npm create refine-app@latest
# Select: Vite, Mantine, REST API (or your backend)
Or manual setup:
npm install @refinedev/core @refinedev/mantine @refinedev/react-router @mantine/core @mantine/hooks @mantine/form @mantine/notifications
Minimal App Structure
// src/App.tsx
import { Refine } from "@refinedev/core";
import { MantineProvider } from "@mantine/core";
import routerProvider from "@refinedev/react-router";
import dataProvider from "@refinedev/simple-rest";
import { BrowserRouter, Routes, Route } from "react-router-dom";
function App() {
return (
<BrowserRouter>
<MantineProvider>
<Refine
dataProvider={dataProvider("https://api.example.com")}
routerProvider={routerProvider}
resources={[
{
name: "posts",
list: "/posts",
create: "/posts/create",
edit: "/posts/edit/:id",
show: "/posts/show/:id",
},
]}
>
<Routes>{/* Your routes here */}</Routes>
</Refine>
</MantineProvider>
</BrowserRouter>
);
}
Critical Prohibitions
- Do NOT mix multiple UI libraries (pick Mantine and stick with it)
- Do NOT bypass data provider — always use Refine hooks for data operations
- Do NOT hardcode API URLs — use data provider configuration
- Do NOT skip resource definition — all CRUD entities must be declared in
resources
- Do NOT ignore TypeScript types — Refine is fully typed, leverage it
Steps for New Feature
- Define the resource in
<Refine resources={[...]}>
- Create page components (List, Create, Edit, Show)
- Set up routes matching resource paths
- Use appropriate hooks (
useTable for lists, useForm for create/edit)
- Configure auth provider if authentication is needed
Definition of Done
References (Detailed Guides)
Core
- data-providers.md — Data provider interface, available providers, custom implementation
- resources.md — Resource definition and configuration
- routing.md — React Router integration and route patterns
Hooks
- hooks.md — All hooks: useList, useOne, useCreate, useUpdate, useDelete, useForm, useTable, useSelect
Security & Auth
- auth.md — Auth provider, access control, RBAC/ABAC, Casbin/CASL integration
UI & Components
- mantine-ui.md — Mantine components integration
- inferencer.md — Auto-generate CRUD pages from API schema
Utilities & Features
- notifications.md — Notification provider and useNotification hook
- i18n.md — Internationalization with i18nProvider
- realtime.md — LiveProvider for websocket/realtime subscriptions
Links
1---2name: refine-dev3description: Refine.dev headless React framework for CRUD apps: data providers, resources, routing, authentication, hooks, and forms.4---5
6# Refine.dev Framework
7
8Refine is a headless React framework for building enterprise CRUD applications. It provides data fetching, routing, authentication, and access control out of the box while remaining UI-agnostic.
9
10## When to use
11
12- Building admin panels, dashboards, or internal tools with React
13- Need CRUD operations with various backends (REST, GraphQL, Supabase, Strapi, etc.)
14- Want a headless approach with Mantine UI integration
15- Setting up Vite-based React projects with data management
16- Implementing authentication flows in React admin apps
17
18## Core Concepts
19
20Refine is built around these key abstractions:
21
221. **Data Provider** — adapter for your backend (REST, GraphQL, etc.)
232. **Resources** — entities in your app (e.g., `posts`, `users`, `products`)
243. **Hooks** — `useList`, `useOne`, `useCreate`, `useUpdate`, `useDelete`, `useForm`, `useTable`
254. **Auth Provider** — handles login, logout, permissions
265. **Router Provider** — integrates with React Router, etc.
27
28## Quick Start (Vite)
29
30```bash
31npm create refine-app@latest
32# Select: Vite, Mantine, REST API (or your backend)
33```
34
35Or manual setup:
36
37```bash
38npm install @refinedev/core @refinedev/mantine @refinedev/react-router @mantine/core @mantine/hooks @mantine/form @mantine/notifications
39```
40
41## Minimal App Structure
42
43```tsx
44// src/App.tsx
45import { Refine } from "@refinedev/core";
46import { MantineProvider } from "@mantine/core";
47import routerProvider from "@refinedev/react-router";
48import dataProvider from "@refinedev/simple-rest";
49import { BrowserRouter, Routes, Route } from "react-router-dom";
50
51function App() {
52 return (
53 <BrowserRouter>
54 <MantineProvider>
55 <Refine
56 dataProvider={dataProvider("https://api.example.com")}
57 routerProvider={routerProvider}
58 resources={[
59 {
60 name: "posts",
61 list: "/posts",
62 create: "/posts/create",
63 edit: "/posts/edit/:id",
64 show: "/posts/show/:id",
65 },
66 ]}
67 >
68 <Routes>{/* Your routes here */}</Routes>
69 </Refine>
70 </MantineProvider>
71 </BrowserRouter>
72 );
73}
74```
75
76## Critical Prohibitions
77
78- Do NOT mix multiple UI libraries (pick Mantine and stick with it)
79- Do NOT bypass data provider — always use Refine hooks for data operations
80- Do NOT hardcode API URLs — use data provider configuration
81- Do NOT skip resource definition — all CRUD entities must be declared in `resources`
82- Do NOT ignore TypeScript types — Refine is fully typed, leverage it
83
84## Steps for New Feature
85
861. Define the resource in `<Refine resources={[...]}>`
872. Create page components (List, Create, Edit, Show)
883. Set up routes matching resource paths
894. Use appropriate hooks (`useTable` for lists, `useForm` for create/edit)
905. Configure auth provider if authentication is needed
91
92## Definition of Done
93
94- [ ] Resource defined in Refine configuration
95- [ ] All CRUD pages implemented with proper hooks
96- [ ] Routes match resource configuration
97- [ ] TypeScript types for resource data defined
98- [ ] Error handling in place
99- [ ] Loading states handled
100
101## References (Detailed Guides)
102
103### Core
104
105- [data-providers.md](references/data-providers.md) — Data provider interface, available providers, custom implementation
106- [resources.md](references/resources.md) — Resource definition and configuration
107- [routing.md](references/routing.md) — React Router integration and route patterns
108
109### Hooks
110
111- [hooks.md](references/hooks.md) — All hooks: useList, useOne, useCreate, useUpdate, useDelete, useForm, useTable, useSelect
112
113### Security & Auth
114
115- [auth.md](references/auth.md) — Auth provider, access control, RBAC/ABAC, Casbin/CASL integration
116
117### UI & Components
118
119- [mantine-ui.md](references/mantine-ui.md) — Mantine components integration
120- [inferencer.md](references/inferencer.md) — Auto-generate CRUD pages from API schema
121
122### Utilities & Features
123
124- [notifications.md](references/notifications.md) — Notification provider and useNotification hook
125- [i18n.md](references/i18n.md) — Internationalization with i18nProvider
126- [realtime.md](references/realtime.md) — LiveProvider for websocket/realtime subscriptions
127
128## Links
129
130- Official docs: https://refine.dev/docs/
131- GitHub: https://github.com/refinedev/refine
132- Mantine integration: https://refine.dev/docs/ui-integrations/mantine/