MCPcopy
hub / github.com/refinedev/refine

github.com/refinedev/refine @1.0.0 sqlite

repository ↗ · DeepWiki ↗ · release 1.0.0 ↗ · compare 2 versions
7,119 symbols 29,591 edges 6,731 files 55 documented · 1%
README

refine logo

<a href="https://refine.dev">Home Page</a> |
<a href="https://refine.dev/docs/">Documentation</a> |
<a href="https://refine.dev/examples/">Examples</a> |
<a href="https://discord.gg/refine">Discord</a> |
<a href="https://refine.dev/blog/">Blog</a>

The sweet spot between the low/no code and “starting from scratch” for CRUD-heavy applications.

Refine is as an open source, React meta-framework for enterprise. It provides a headless solution for everything from admin panels to dashboards and internal tools.

Awesome OpenSSF Best Practices npm version Contributor Covenant

Discord Twitter Follow

how-refine-works

What is Refine?

Refine is a React meta-framework for CRUD-heavy web applications. It addresses a wide range of enterprise use cases including internal tools, admin panels, dashboards and B2B apps.

Refine's core hooks and components streamline the development process by offering industry-standard solutions for crucial aspects of a project, including authentication, access control, routing, networking, state management, and i18n.

Refine's headless architecture enables the building of highly customizable applications by decoupling business logic from UI and routing. This allows integration with:

  • Any custom designs or UI frameworks like TailwindCSS, along with built-in support for Ant Design, Material UI, Mantine, and Chakra UI.

  • Various platforms, including Next.js, Remix, React Native, Electron, etc., by a simple routing interface without the need for additional setup steps.

⚡ Try Refine

Start a new project with Refine in seconds using the following command:

npm create refine-app@latest my-refine-app

Or you can create a new project on your browser:

Quick Start

Here's Refine in action, the below code is an example of a simple CRUD application using Refine + React Router + Material UI:

import React from "react";
import { Refine, useMany } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/mui";
import dataProvider from "@refinedev/simple-rest";
import routerProvider from "@refinedev/react-router-v6";
import { BrowserRouter, Outlet, Route, Routes } from "react-router-dom";

import CssBaseline from "@mui/material/CssBaseline";

export default function App() {
  return (
    <BrowserRouter>
      <CssBaseline />
      <Refine
        dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
        routerProvider={routerProvider}
        resources={[
          {
            name: "products",
            list: "/products",
          },
        ]}
      >
        <Routes>
          <Route
            element={
              <ThemedLayoutV2>
                <Outlet />
              </ThemedLayoutV2>
            }
          >
            <Route path="/products">
              <Route index element={<ProductList />} />
            </Route>
          </Route>
        </Routes>
      </Refine>
    </BrowserRouter>
  );
}

// src/pages/products/list.tsx

import { List, useDataGrid, DateField } from "@refinedev/mui";
import { DataGrid, GridColDef } from "@mui/x-data-grid";

export const ProductList = () => {
  const { dataGridProps } = useDataGrid();

  const { data: categories, isLoading } = useMany({
    resource: "categories",
    ids:
      dataGridProps?.rows?.map((item) => item?.category?.id).filter(Boolean) ??
      [],
    queryOptions: {
      enabled: !!dataGridProps?.rows,
    },
  });

  const columns = React.useMemo<GridColDef[]>(
    () => [
      { field: "id", headerName: "ID", type: "number" },
      { field: "name", flex: 1, headerName: "Name" },
      {
        field: "category",
        flex: 1,
        headerName: "Category",
        renderCell: ({ value }) =>
          isLoading
            ? "Loading..."
            : categories?.data?.find((item) => item.id === value?.id)?.title,
      },
      {
        field: "createdAt",
        flex: 1,
        headerName: "Created at",
        renderCell: ({ value }) => <DateField value={value} />,
      },
    ],
    [categories?.data, isLoading],
  );

  return (
    <List>
      <DataGrid {...dataGridProps} columns={columns} autoHeight />
    </List>
  );
};

The result will look like this:

Refine + Material UI Example

Use cases

Refine shines on data-intensive⚡ enterprise B2B applications like admin panels, dashboards and internal tools. Thanks to the built-in SSR support, it can also power customer-facing applications like storefronts.

You can take a look at some live examples that can be built using Refine from scratch:

Key Features

  • Refine Devtools - dive deeper into your app and provide useful insights
  • Connectors for 15+ backend services including REST API, GraphQL, NestJs CRUD, Airtable, Strapi, Strapi v4, Supabase, Hasura, Appwrite, Nestjs-Query, Firebase, Sanity, and Directus.
  • SSR support with Next.js & Remix and Advanced routing with any router library of your choice
  • Auto-generation of CRUD UIs based on your API data structure
  • Perfect state management & mutations with React Query
  • Providers for seamless authentication and access control flows
  • Out-of-the-box support for live / real-time applications
  • Easy audit logs & document versioning

Learning Refine

  • Navigate to the Tutorial on building comprehensive CRUD application guides you through each step of the process.
  • Visit the Guides & Concepts to get informed about the fundamental concepts.
  • Read more on Advanced Tutorials for different usage scenarios.

Contribution

Refer to the contribution docs for more information.

If you have any doubts related to the project or want to discuss something, then join our Discord server.

Contributors ♥️ Thanks

We extend our gratitude to all our numerous contributors who create plugins, assist with issues and pull requests, and respond to questions on Discord and GitHub Discussions.

Refine is a community-driven project, and your contributions continually improve it.

License

Licensed under the MIT License, Copyright © 2021-present Refinedev

Extension points exported contracts — how you extend this code

Session (Interface)
* Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context
examples/with-nextjs-next-auth/types/next-auth.d.ts
ITestWrapperProps (Interface)
(no doc)
packages/chakra-ui/test/index.tsx
ITestWrapperProps (Interface)
(no doc)
packages/antd/test/index.tsx
ITestWrapperProps (Interface)
(no doc)
packages/inferencer/test/index.tsx
MessageType (Interface)
(no doc)
packages/ably/src/index.ts
ITestWrapperProps (Interface)
(no doc)
packages/core/test/index.tsx
ILoginResponse (Interface)
(no doc)
packages/strapi/src/helpers/auth.ts
Store (Interface)
(no doc)
packages/cli/src/update-notifier/index.tsx

Core symbols most depended-on inside this repo

clsx
called by 1667
documentation/src/theme/BlogPostItem/index.js
get
called by 1426
packages/core/src/definitions/helpers/keys/index.ts
TestWrapper
called by 833
packages/core/test/index.tsx
translate
called by 391
packages/core/src/hooks/i18n/useTranslate.ts
accessor
called by 329
packages/inferencer/src/utilities/accessor/index.ts
useSelect
called by 228
packages/antd/src/hooks/fields/useSelect/index.ts
clsx
called by 228
documentation/src/components/blog/author-card/index.js
useForm
called by 222
packages/antd/src/hooks/form/useForm.ts

Shape

Function 6,136
Interface 769
Method 145
Class 56
Enum 13

Languages

TypeScript100%

Modules by API surface

examples/blog-next-refine-pwa/public/workbox-eac1af49.js81 symbols
cypress/support/index.d.ts74 symbols
packages/core/src/definitions/helpers/keys/index.ts49 symbols
packages/core/src/contexts/data/types.ts26 symbols
packages/cli/src/utils/package/index.ts19 symbols
examples/finefoods-material-ui/src/interfaces/index.d.ts19 symbols
examples/finefoods-antd/src/interfaces/index.d.ts19 symbols
documentation/plugins/docgen.js19 symbols
examples/store/src/lib/context/cart.tsx18 symbols
documentation/plugins/docgen.ts17 symbols
packages/core/src/hooks/navigation/index.ts15 symbols
packages/core/src/contexts/auth/index.tsx14 symbols

Dependencies from manifests, versioned

@aliemir/dom-to-fiber-utils0.4.0 · 1×
@aliemir/react-live4.0.0 · 1×
@ant-design/charts1.2.0 · 1×
@ant-design/cssinjs1.17.2 · 1×
@ant-design/graphs1.2.7 · 1×
@ant-design/icons5.0.1 · 1×
@ant-design/nextjs-registry1.0.0 · 1×
@ant-design/plots1.2.5 · 1×
@ant-design/pro-layout7.17.12 · 1×
@ant-design/use-emotion-css1.0.4 · 1×
@arethetypeswrong/cli0.15.3 · 1×
@auth0/auth0-react1.5.0 · 1×

Datastores touched

PropertyCollection · 1 repos
UserCollection · 1 repos
(mongodb)Database · 1 repos
usersDatabase · 1 repos

For agents

$ claude mcp add refine \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact