Skip to content

refinedev/refine

next
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1a6c1e8

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
March 20, 2023 17:13
October 20, 2022 11:54
December 19, 2022 15:24
January 21, 2021 17:47
May 31, 2021 16:55
February 16, 2022 17:45
May 31, 2021 16:55
March 13, 2023 19:52
December 7, 2021 09:24
September 15, 2022 14:33
December 19, 2022 15:24
September 21, 2021 13:00
December 19, 2022 15:24
September 14, 2022 18:52


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 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:



👉 Refer to most popular real use case examples

👉 More refine powered different usage scenarios can be found here

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, Appwrite, Firebase, and Directus.

🌐 SSR support with Next.js or Remix

🔍 Auto-generated CRUD UIs from your API data structure

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

⌛️ Built-in CLI with time-saving features

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:

npm create refine-app@latest -- -o refine-antd

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

npm run dev

Your refine application will be accessible at http://localhost:3000:

Welcome on board


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:

import { Refine } from "@refinedev/core";
import { Layout, notificationProvider, ErrorComponent } from "@refinedev/antd";
import routerProvider, { NavigateToResource } from "@refinedev/react-router-v6";
import dataProvider from "@refinedev/simple-rest";

import { BrowserRouter, Routes, Route, Outlet } from "react-router-dom";

import { AntdInferencer } from "@refinedev/inferencer/antd";

import "@refinedev/antd/dist/reset.css";

const App: React.FC = () => {
    return (
        <BrowserRouter>
            <Refine
                routerProvider={routerProvider}
                dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
                notificationProvider={notificationProvider}
                resources={[
                    {
                        name: 'posts',
                        list: "/posts",
                        show: "/posts/show/:id",
                        create: "/posts/create",
                        edit: "/posts/edit/:id",
                        meta: { canDelete: true },
                    },
                    {
                        name: 'categories',
                        list: "/categories",
                        show: "/categories/show/:id",
                    }
                ]}
            >
                <Routes>
                    <Route
                        element={(
                            <Layout>
                                <Outlet />
                            </Layout>
                        )}
                    >
                        <Route index element={<NavigateToResource />} />
                        <Route path="posts">
                            <Route index element={<AntdInferencer />} />
                            <Route path="show/:id" element={<AntdInferencer />} />
                            <Route path="create" element={<AntdInferencer />} />
                            <Route path="edit/:id" element={<AntdInferencer />} />
                        </Route>
                        <Route path="categories">
                            <Route index element={<AntdInferencer />} />
                            <Route path="show/:id" element={<AntdInferencer />} />
                        </Route>
                        <Route path="*" element={<ErrorComponent />} />
                    </Route>
                </Routes>
            </Refine>
        </BrowserRouter>
    );
};   

export default App;

🚀 Thanks to refine Inferencer package, it guesses the configuration to use for the list, show, create, and edit pages based on the data fetched from the API and generates the pages automatically.

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

First example result


You can get the auto-generated pages codes by clicking the Show Code button on each page. Afterward, simply pass the pages to the resources array by replacing with the Inferencer components.

Next Steps

👉 Jump to Tutorial to continue your work and turn the example into a full-blown CRUD application.

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

👉 Read more on 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

👉 Refer to contribution docs for more information

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