refine README

项目的 README,来自 github.com/refinedev/refine。合并为一个 markdown 文件:README.md。

refine logo

Home Page | Documentation | Examples | Discord | Blog | Refine


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

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

Refine CORE also powers Refine's purpose built AI agent.

Awesome OpenSSF Best Practices npm version Contributor Covenant

Discord Twitter Follow


how-refine-works

What is Refine CORE?

Refine CORE 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 CORE's 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 CORE's headless architecture enables the building of highly customizable applications by decoupling business logic from UI and routing. This allows integration with:

⚡ Try Refine CORE

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

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

Or you can create a new project on your browser:


You can also try Refine's AI agent for free to create projects:

Quick Start

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

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

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={
              <ThemedLayout>
                <Outlet />
              </ThemedLayout>
            }
          >
            <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",
        display: "flex",
        renderCell: ({ value }) =>
          isLoading
            ? "Loading..."
            : categories?.data?.find((item) => item.id === value?.id)?.title,
      },
      {
        field: "createdAt",
        flex: 1,
        headerName: "Created at",
        display: "flex",
        renderCell: ({ value }) => <DateField value={value} />,
      },
    ],
    [categories?.data, isLoading],
  );

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

The result will look like this:

Refine CORE + Material UI Example

Use cases

Refine CORE 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 CORE from scratch:

Key Features

Learning Refine CORE

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 CORE is a community-driven project, and your contributions continually improve it.


License

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

refine (refinedev/refine)

正在搜索数据库…

36.1K ·GitHub
这是什么?Refine 是一个开源的 React 框架,用于构建内部工具、管理后台、仪表盘和 B2B 应用,灵活性很高。
这是 UI 组件库,还是无头框架?Refine 是无头框架:它提供用于数据获取、路由、身份验证和 CRUD 操作的 Hooks 与逻辑,但不自带预构建的界面,因此你需要搭配 Ant Design、Material UI、Mantine 或自己的组件使用。
我该如何启动一个新的 refine 项目?该项目的 monorepo 中包含一个 create-refine-app 命令行工具包,用于搭建新项目;之后,你可以用所选的 UI 库和数据提供方来构建页面。
使用 refine 必须连接特定的后端吗?不需要特定的后端。refine 支持多种数据提供方,包括 REST、GraphQL 和 NestJS,因此几乎可以连接任何 API。
无头方式有什么缺点?由于 refine 不自带 UI,你必须先自行接入 UI 组件库,才能得到可用的界面;此外,要参与该仓库本身的贡献,还需要 Node.js 18+ 和 pnpm 9+,其 monorepo 由 lerna 管理。
哪些 UI 框架可以接入 refine?由于采用无头设计,refine 可以与 Ant Design、Material UI、Mantine、Chakra UI,或完全自定义的组件配合,负责视觉呈现层。
refine 会自动为我生成 CRUD 页面吗?refine 的核心 Hooks 和路由围绕 CRUD 操作构建,因此你可以快速为每个资源接好列表、创建、编辑和详情页面,无需从零编写这些逻辑。
我可以把 refine 和 Next.js 或 NestJS 后端一起用吗?可以。refine 对 Next.js(前端)以及作为后端数据源的 NestJS(包括 NestJs Query/CRUD)都有一流的支持和示例。
refine 免费使用吗?是的,refine 完全开源,并以 MIT 许可证发布。
有哪些类似的项目?react-admin, appsmith, amis, twenty, gentelella, amplication, umi, filament
作者
refinedev
大小
7.9 GB
星标
36.1K
时长
5年
提交 · 90 天