Skip to content

Build your React-based CRUD applications, without constraints.

License

Notifications You must be signed in to change notification settings

mertcanaltin/refine

ย 
ย 

Repository files navigation



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

cover-image


how-refine-works

What is refine?

refine is a versatile React framework that enables the rapidโœจ development of a wide range of web applications.

From internal tools, admin panels, B2B apps and dashboards, it serves as a comprehensive solution for building any type of CRUD applications.

refine's internal hooks and components simplifies the development process and eliminates the repetitive tasks by providing industry-standard solutions for crucial aspects of a project, including 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 limited to a set of pre-styled components, refine provides collections of helper hooks,ย componentsย andย providers and more. Since business logic and UI are completely decoupled, you can customize UI without constraints.

It means, refine just works seamlessly with any custom designs or UI frameworks. Thanks to it's headless architecture, you can use popular CSS frameworks like TailwindCSS or even create your own styles from scratch.

refine also provides integrations with Ant Design, Material UI, Mantine, and Chakra UIto get you started quickly. These libraries are set of components which are nicely integrated with headless @refinedev/core package.

Headless in Routing

For the routing, refine's headless approach shines too. It doesn't tie you to a single routing method or library. Instead, it offers a simple routing interface with built-in integrations for popular libraries.

This means you can use refine seamlessly in different platforms like React Native, Electron, Next.js, Remix etc. without any extra steps for the setup.

๐Ÿ”ฅ Try refine

refine's Browser-based app scaffolder lets you create refine app by making step-by-step selections directly in your browser

You can choose the libraries and frameworks you want to work with, and the tool will generate a downloadable boilerplate code for you.

This allows you yo preview, modify, and download project immediately, thereby streamlining the development process.


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 CLI tool or using browser-based app scaffolder.

For this example we'll use CLI tool. Simply, run the following command to create a new refine project configured with Ant Design 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:5173:

Welcome on board


Let's consume a public fake REST API and add two resources (blog_posts, categories) to our project. Replace the contents of src/App.tsx with the following code:

import { Refine } from "@refinedev/core";
import {
    notificationProvider,
    ErrorComponent,
    ThemedLayout,
} 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: "blog_posts",
                        list: "/blog-posts",
                        show: "/blog-posts/show/:id",
                        create: "/blog-posts/create",
                        edit: "/blog-posts/edit/:id",
                        meta: { canDelete: true },
                    },
                    {
                        name: "categories",
                        list: "/categories",
                        show: "/categories/show/:id",
                    },
                ]}
            >
                <Routes>
                    <Route
                        element={
                            <ThemedLayout>
                                <Outlet />
                            </ThemedLayout>
                        }
                    >
                        <Route index element={<NavigateToResource />} />
                        <Route path="blog-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 blog_posts & category data:

First example result


You can get the auto-generated page codes by clicking the Show Code button on each page. Afterward, simply pass the pages to the resources array by replacing them 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

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

About

Build your React-based CRUD applications, without constraints.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 97.0%
  • JavaScript 2.9%
  • CSS 0.1%
  • Handlebars 0.0%
  • Smarty 0.0%
  • Dockerfile 0.0%