Refine

Build your React-based CRUD applications, without constraints.

README



Home Page | Discord | Examples | Blog | Documentation | Roadmap
Build your React-based CRUD applications, without constraints.
An open source, headless web application framework developed with flexibility in mind.



Discord Twitter Follow

refine - 100% open source React framework to build web apps 3x faster | Product Hunt



Awesome Maintainability Test Coverage npm version npm undefined Contributor Covenant




how-works-refine





What is refine?

refine is a React-based framework for the rapid ✨ development of web applications.
It eliminates repetitive tasks demanded by CRUD operations and provides industry standard solutions for critical parts like authentication, access control, routing, networking, state management, and i18n.

refine is headless by design, thereby offering unlimited styling and customization options.

What do you mean by "headless" ?

Instead of being a limited set of pre-styled components, refine is a collection of helper hooks, components, and providers. They are all decoupled from UI components and business logic, so that they never keep you from customizing your UI or coding your own flow.

refine seamlessly works with any custom design or UI framework that you favor. For convenience, it ships with ready-made integrations for Ant Design System, Material UI, Mantine, and Chakra UI.

Use cases

refine shines on data-intensive⚡ applications like admin panels, dashboards and internal tools. Thanks to the built-in SSR support, refine 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:









[👉 More refine powered different usage scenarios can be found here](https://refine.dev/docs/examples/)




Key Features


⚙️ Zero-config, one-minute setup with a single CLI command

🔌 Connectors for 15+ backend services including REST API, GraphQL, NestJs CRUD, Airtable, Strapi, Strapi v4, Strapi GraphQL, Supabase, Hasura, Nhost, Appwrite, Firebase, Directus and Altogic

🌐 SSR support with Next.js or Remix

⚛ Perfect state management & mutations with React Query

🔀 Advanced routing with any router library of your choice

🔐 Providers for seamless authentication and access control flows

⚡ Out-of-the-box support for live / real-time applications

📄 Easy audit logs & document versioning

💬 Support for any i18n framework

💪 Future-proof, robust architecture

✅ Full test coverage

Quick Start


The fastest way to get started with refine is by using the create refine-app project starter tool.
Run the following command to create a new refine project configured with  Ant Design System as the default UI framework:

  1. ```
  2. npm create refine-app -- --preset refine-antd my-project
  3. ```

Once the setup is complete, navigate to the project folder and start your project with:

  1. ```
  2. npm run dev
  3. ```

Your refine application will be accessible at http://localhost:3000:
![Welcome on board](https://github.com/refinedev/refine/blob/master/documentation/static/img/welcome-on-board.png?raw=true)
Let's consume a public fake REST API and add two resources (posts, categories) to our project. Replace the contents of src/App.tsx with the following code:

  1. ```tsx title="src/App.tsx"

  2. import { Refine, useMany } from "@pankod/refine-core";
  3. import {
  4.     useTable,
  5.     List,
  6.     Table,
  7.     DateField,
  8.     Layout,
  9.     ReadyPage,
  10.     notificationProvider,
  11.     ErrorComponent,
  12. } from "@pankod/refine-antd";
  13. import routerProvider from "@pankod/refine-react-router-v6";
  14. import dataProvider from "@pankod/refine-simple-rest";

  15. import "@pankod/refine-antd/dist/styles.min.css";

  16. const App: React.FC = () => {
  17.     return (
  18.         <Refine
  19.             routerProvider={routerProvider}
  20.             dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
  21.             resources={[{ name: "posts", list: PostList }]}
  22.             Layout={Layout}
  23.             ReadyPage={ReadyPage}
  24.             notificationProvider={notificationProvider}
  25.             catchAll={<ErrorComponent />}
  26.         />
  27.     );
  28. };

  29. export const PostList: React.FC = () => {
  30.     const { tableProps } = useTable<IPost>();

  31.     const categoryIds =
  32.         tableProps?.dataSource?.map((item) => item.category.id) ?? [];

  33.     const { data, isLoading } = useMany<ICategory>({
  34.         resource: "categories",
  35.         ids: categoryIds,
  36.         queryOptions: {
  37.             enabled: categoryIds.length > 0,
  38.         },
  39.     });

  40.     return (
  41.         <List>
  42.             <Table<IPost> {...tableProps} rowKey="id">
  43.                 <Table.Column dataIndex="title" title="title" />
  44.                 <Table.Column
  45.                     dataIndex={["category", "id"]}
  46.                     title="category"
  47.                     render={(value: number) => {
  48.                         if (isLoading) {
  49.                             return "loading...";
  50.                         }

  51.                         return data?.data.find(
  52.                             (item: ICategory) => item.id === value,
  53.                         )?.title;
  54.                     }}
  55.                 />
  56.                 <Table.Column
  57.                     dataIndex="createdAt"
  58.                     title="createdAt"
  59.                     render={(value) => <DateField format="LLL" value={value} />}
  60.                 />
  61.             </Table>
  62.         </List>
  63.     );
  64. };

  65. export default App;

  66. interface IPost {
  67.   title: string;
  68.   createdAt: string;
  69.   category: { id: number };
  70. }

  71. interface ICategory {
  72.   id: number;
  73.   title: string;
  74. }
  75. ```

Now, you should see the output as a table populated with post & category data:
First example result

Next Steps


👉 Jump to Refine<>Ant Design Tutorial to continue your work and turn the example into a full-blown CRUD application.

👉 Check out the Refine<>Tailwind Tutorial to learn how to userefine in a pure headless way.

👉 Visit Learn the Basics Page to get informed about the fundamental concepts.

👉 Read more on [Advanced Tutorials
](https://refine.dev/docs/advanced-tutorials/) for different usage scenarios.

👉 See the real-life Finefoods Demo project.

👉 Play with interactive Examples

Roadmap

You can find refine's Public Roadmap here!

Stargazers

Stargazers repo roster for refinedev/refine

Contribution







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


Our ♥️ Contributors



License


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