Coder Social home page Coder Social logo

luisgcastillo40so / refine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from refinedev/refine

0.0 0.0 0.0 981.21 MB

Build your React-based CRUD applications, without constraints.

Home Page: https://refine.dev

License: MIT License

Shell 0.01% JavaScript 0.64% TypeScript 99.12% CSS 0.11% Smarty 0.06% Dockerfile 0.01% Less 0.06%

refine's Introduction


Build your React-based CRUD applications, without constraints.
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

Maintainability Test Coverage npm version npm Contributor Covenant

What is refine?

refine is a React-based framework for the rapid ✨ development of web applications. It eliminates the 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 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 your UI components and business logic, so they never keep you from customizing your UI or coding your own flow.

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

Use cases

refine shines on data-intensive applications like admin panels, dashboards and internal tools. Thanks to built-in SSR support, refine can also power customer-facing applications like storefronts.

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 using the superplate project starter tool. Run the following command to create a new refine project configured with Ant Design System as the default UI framework:

npx superplate-cli --preset refine-antd my-project

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, useMany } from "@pankod/refine-core";
import {
    useTable,
    List,
    Table,
    DateField,
    Layout,
    ReadyPage,
    notificationProvider,
    ErrorComponent,
} from "@pankod/refine-antd";
import routerProvider from "@pankod/refine-react-router-v6";
import dataProvider from "@pankod/refine-simple-rest";

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

const App: React.FC = () => {
    return (
        <Refine
            routerProvider={routerProvider}
            dataProvider={dataProvider("https://api.fake-rest.refine.dev")}
            resources={[{ name: "posts", list: PostList }]}
            Layout={Layout}
            ReadyPage={ReadyPage}
            notificationProvider={notificationProvider}
            catchAll={<ErrorComponent />}
        />
    );
};

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

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

    const { data, isLoading } = useMany<ICategory>({
        resource: "categories",
        ids: categoryIds,
        queryOptions: {
            enabled: categoryIds.length > 0,
        },
    });

    return (
        <List>
            <Table<IPost> {...tableProps} rowKey="id">
                <Table.Column dataIndex="title" title="title" />
                <Table.Column
                    dataIndex={["category", "id"]}
                    title="category"
                    render={(value: number) => {
                        if (isLoading) {
                            return "loading...";
                        }

                        return data?.data.find(
                            (item: ICategory) => item.id === value,
                        )?.title;
                    }}
                />
                <Table.Column
                    dataIndex="createdAt"
                    title="createdAt"
                    render={(value) => <DateField format="LLL" value={value} />}
                />
            </Table>
        </List>
    );
};

export default App;

interface IPost {
  title: string;
  createdAt: string;
  category: { id: number };
}

interface ICategory {
  id: number;
  title: string;
}

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 use refine in a pure headless way.

👉 Visit Learn the Basics Page to get informed about the fundemental 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 pankod/refine

Contribution

If you have a bug to report, do not hesitate to file an issue.

If you are willing to fix an issue or propose a feature, all PRs with clear explanations are welcome and encouraged.

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

License

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

refine's People

Contributors

omeraplak avatar salihozdemir avatar refine-bot avatar github-actions[bot] avatar necatiozmen avatar yildirayunlu avatar umutzd avatar doguhanozgurakca avatar aliemir avatar biskuvit avatar mlhekinci avatar ozkalai avatar mhrrmk avatar burcukaragozzz avatar snyk-bot avatar alicanerdurmaz avatar drcivan avatar dependabot[bot] avatar nrikiji avatar weisisheng avatar rassie avatar fspijkerman avatar lukassos avatar bastian avatar albcunha avatar tspvivek avatar smparekh avatar workatease avatar narayanpromax avatar kailashchoudhary11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.