0.0.0 • Published 1 month ago

refinejs-repo v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

Awesome OpenSSF Best Practices npm version npm.io Contributor Covenant

Discord Twitter Follow

how-refine-works

What is Refine?

Refine is a meta React framework that enables the rapid✨ development of a wide range of web applications.

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

Refine's internal hooks and components simplify the development process and eliminate 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, providers, and more. Since business logic and the UI are completely decoupled, you can customize the UI without constraints.

It means that 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 UI to get you started quickly. These libraries are a set of components that are nicely integrated with the 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 on different platforms like React Native, Electron, Next.js, Remix, etc. without any extra setup steps.

⚡ Try Refine

Refine's browser-based app scaffolder enables you to build a Refine app through an interactive, step-by-step process in your browser.

You have the freedom to select your preferred libraries and frameworks, and the tool generates a ready-to-download boilerplate code. This feature not only lets you preview and tweak your project on the fly but also accelerates the overall development workflow.

Use cases

Refine 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 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, Supabase, Hasura, Appwrite, Nestjs-Query, Firebase, Sanity, 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

💻 Refine Devtools - dive deeper into your app and provide useful insights

✅ Full test coverage

Quick Start

There are two ways to create a Refine app: either by using the create refine-app CLI tool or the browser-based app scaffolder.

To quickly start a Refine project with Ant Design as the default UI framework, run the following command.

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

Note: The command above uses pre-set options for ease. For a different tech stack, simply run:

npm create refine-app@latest

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

import { Refine } from "@refinedev/core";
import {
  useNotificationProvider,
  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={useNotificationProvider}
        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;

🚀 The Refine Inferencer package automatically generates list, show, create, and edit pages by guessing configurations from API data. We've used it here for a quick, clear start, but you can also choose to code your pages from scratch instead of using the Inferencer feature.

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 the Learn the Basics page to get informed about the fundamental concepts.

👉 Read more on Advanced Tutorials for different usage scenarios.

👉 See the real-life CRM Application project built using Refine.

👉 Play with interactive examples.

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 ♥️

License

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

JSONStreamabababbrevacorn-globalsacornacorn-walkaggregate-erroradd-streamagent-baseagentkeepaliveansi-regexansi-stylesaprobaajvare-we-there-yetansi-escapesansi-colorsanymatcharcharray-differarray-unionargargparsearray-buffer-byte-lengtharrifyarray-ifyarray.prototype.flatarraybuffer.prototype.sliceasapasn1asynckitat-least-nodeassert-plusastral-regexasyncaxiosavailable-typed-arraysaws-sign2aws4b4ababel-jestbabel-plugin-istanbulbalanced-matchbabel-plugin-jest-hoistbabel-preset-current-node-syntaxbabel-preset-jestbase64-jsbcrypt-pbkdfbetter-path-resolvebefore-after-hookblbin-linksbrace-expansionbracesbinary-extensionsblob-utilbluebirdbreakwordbrowserslistbs-loggerbserbufferbuffer-crc32buffer-frombuiltinsbyte-sizecacachecachedircallsitescall-bindcamelcase-keyschalkcamelcasecaniuse-litecaselesschar-regexchownrci-infochardetcheck-more-typesclean-stackcli-cursorcli-spinnerschokidarcittycjs-module-lexercli-table3cliuicloneclone-deepcli-truncatecli-widthclipboardycluster-key-slotcmd-shimcocollect-v8-coveragecolorcolor-convertcolor-supportcombined-streamcolumnifycolor-namecolor-stringcolorettecommanderconcat-mapcommon-ancestor-pathcommon-tagscompare-funcconsole-control-stringsconcat-streamconsolaconfig-chainconventional-changelog-angularconventional-changelog-conventionalcommitsconventional-changelog-coreconventional-changelog-preset-loaderconventional-changelog-writerconventional-commits-filterconventional-commits-parserconventional-recommended-bumpcosmiconfigconvert-source-mapcore-util-iscross-spawncookie-escosmiconfig-typescript-loadercreate-requirecssfiltercssomcsstypecssstylecsv-generatecsvcsv-parsecsv-stringifydargsdashdashdata-urlsdataloaderdebugdate-fnsdateformatdayjsdebuglogdedentdecompress-responsedecamelizedecimal.jsdecamelize-keysdefaultsdeep-extenddefine-lazy-propdeep-isdeepmergedelegatesdelayed-streamdefine-data-propertydefine-propertiesdefudenquedetect-indentdetect-libcdepddeprecationdestrdetect-newlinedir-globdezalgodot-propdiffduplexerdiff-sequencesdomexceptiondotenvecc-jsbnemoji-regexejsend-of-streamelectron-to-chromiumemitteryencodingenquirerentitieserror-exenv-pathsenvinfoerr-codees-abstractescaladees-set-tostringtagesprimaes-shim-unscopableses-to-primitiveescodegenesutilseventemitter3execaestraverseetagexiteventemitter2executableexpand-templateexpectextendextendable-errorexternal-editorextract-zipfast-globextsprintffast-deep-equalfast-equalsfast-json-stable-stringifyfastqfast-fifofiguresfd-slicerfill-rangefast-levenshteinfb-watchmanflatfollow-redirectsfilelistfind-upfind-yarn-workspace-root2fs-extrafs.realpathfor-eachforever-agentfs-minipassgaugefunction-bindget-caller-filefunctions-have-namesfunction.prototype.namegensyncget-intrinsicget-package-typeget-own-enumerable-property-symbolsget-pkg-repoget-portget-streamget-stdinget-port-pleaseget-symbol-descriptiongetpassgetosgit-raw-commitsgit-hooks-listgit-remote-origin-urlgit-semver-tagsgit-url-parseglobglob-parentgit-upgithub-from-packagegitconfiglocalglobbyglobal-dirsglobalthisglobalyzergraceful-fsglobrexgopdgrapheme-splitterhandlebarshas-flagh3hard-rejectionhashas-bigintshas-property-descriptorshas-protohas-unicodehas-tostringtaghas-symbolshasownhosted-git-infohtml-encoding-snifferhttp-cache-semanticshtml-escaperhttp-shutdownhttp-proxy-agenthttp-signaturehttps-proxy-agenthuman-idignorehuman-signalshumanize-msiconv-liteieee754import-localimurmurhashindent-stringignore-walkinflightinheritsimage-metaimport-freshinfer-owneriniinit-package-jsoninquirerioredisinternal-slotipis-arrayishipxiron-webcryptois-bigintis-array-bufferis-ciis-binary-pathis-boolean-objectis-extglobis-dockeris-fullwidth-code-pointis-callableis-date-objectis-globis-core-moduleis-generator-fnis-numberis-installed-globallyis-interactiveis-objis-lambdais-plain-objis-negative-zerois-number-objectis-path-insideis-potential-custom-element-nameis-plain-objectis-promiseis-regexis-streamis-regexpis-shared-array-bufferis-sshis-stringis-typedarrayis-subdiris-text-pathis-symbolis-typed-arrayis-wslis-unicode-supportedisexeisobjectis-weakrefis-windowsisarrayisstreamistanbul-lib-coverageistanbul-lib-instrumentistanbul-lib-reportistanbul-lib-source-mapsistanbul-reportsjakejest-circusjest-changed-filesjest-clijest-configjest-docblockjest-diffjest-eachjest-environment-nodejest-get-typejest-haste-mapjest-matcher-utilsjest-leak-detectorjest-mockjest-message-utiljest-regex-utiljest-pnp-resolverjest-resolvejest-resolve-dependenciesjest-runnerjest-runtimejest-utiljest-snapshotjest-watcherjest-validatejs-tokensjs-yamljitijest-workerjoijsbnjson-parse-even-better-errorsjsdomjsescjson-parse-better-errorsjson-schemajson-schema-traversejsonc-parserjson-stringify-nicejsonfilejson-stringify-safejson5kind-ofjsonparsejsprimjust-diffjust-diff-applylazy-asskleurlines-and-columnslevenlibnpmaccesslibnpmpublishload-json-filelisthenlistr2load-yaml-filelocate-pathlodashlodash.defaultslodash.isargumentslodash.ismatchlodash.memoizelodash.startcaselru-cachelodash.oncemake-dirlog-updatelog-symbolsloose-envifymake-errormake-fetch-happenmerge-streammerge2micromatchmakeerrormap-objmime-dbmime-typesmimic-fnmimic-responsemicro-memoizemeowminimistminimatchminipassmimemin-indentminimist-optionsminipass-collectminipass-json-streamminipass-fetchminipass-flushminizlibmkdirpmkdirp-classicminipass-pipelineminipass-sizedmixmemkdirp-infer-ownermllymsmoizemultimatchmodify-valuesmrimurmurhashmute-streamnatural-comparenapi-build-utilsnegotiatornetstatsneo-asyncnode-abinode-fetch-nativenode-addon-apinode-fetchnode-gyp-buildnode-gypnode-forgenode-int64form-datanode-releasesnode-machine-idnode-stream-zipnormalize-pathnoptnpm-package-argnpm-install-checksnpm-bundlednpm-normalize-package-binnpm-run-pathnpm-packlistnpmlognx-cloudnxnpm-pick-manifestnpm-registry-fetchnwsapiobject-inspectonceonetimeobject-keysopenobject.assignofetchoraos-tmpdirp-finallyospathp-mapoutdentp-filterp-limitp-queuep-locatep-timeoutp-tryp-pipep-map-seriesp-reducep-waterfallpacoteparse-jsonparent-moduleparse-conflict-jsonpath-existspath-is-absoluteparse-pathpath-keypath-typeparse5parse-urlpathepicomatchpath-parsepifypendpkg-dirpicocolorsperformance-nowprebuild-installpiratespkg-typesplease-upgrade-nodepreferred-pmpretty-bytesproc-logpretty-formatprocess-nextick-argsprocesspromise-call-limitpromise-inflightpromise-all-reject-latepromise-retrypromptspromzardproxy-from-envproto-listpumpprotocolspseudomappslpunycodequeue-microtaskqquerystringifyqsqueue-tickquick-lruradix3react-isrcreadread-package-jsonread-cmd-shimread-package-json-fastreadable-streamread-pkgread-pkg-upread-yaml-filereaddir-scoped-modulesreaddirpredentredis-errorsregenerator-runtimerequire-directoryredis-parserregexp-treeresolve-cwdrequest-progressrequire-main-filenamerequires-portrestore-cursorresolve-fromfs-constantsresolve-globalrimrafresolve.exportsrun-parallelretryrun-asyncsafe-bufferrfdcrxjssafe-array-concatsafe-regex-testsafer-buffersaxessemverschedulerset-blockingregexp.prototype.flagsselective-whitespacesharpshallow-cloneshebang-commandshebang-regexsemver-compareset-function-lengthsignal-exitsimple-concatsimple-getset-function-nameslashside-channelshell-quotesimple-swizzlesisteransislice-ansismart-buffersort-keyssmartwrapsockssocks-proxy-agentsource-mapsort-object-keyssource-map-supportspawn-commandspawndamnitspdx-correctspdx-exceptionsspdx-license-idsspdx-expression-parsesplitsplit2sprintf-jssshpkstack-utilsssristd-envstandard-as-callbackstream-transformstring-widthstreamxstring-lengthstring-argvstring.prototype.trimstring.prototype.trimendstrip-ansistrip-bomstring.prototype.trimstartstrip-final-newlinestrip-json-commentsstrong-log-transformerstring_decodersupports-colorstringify-objectstrip-indenttar-streamsupports-preserve-symlinks-flagsymbol-treetartar-fstemp-dirthroughterm-sizetext-extensionstest-excludethrottleittiny-globto-regex-rangethrough2tmptmplto-fast-propertiestough-cookietokenize-whitespacets-nodetslibtreeversetunnel-agenttree-killtrim-newlinestty-tabletweetnacltyped-array-buffertype-detecttyped-array-byte-lengthtyped-array-byte-offsettypedarray-to-buffertyped-array-lengthtypedarrayufouglify-jsunbox-primitiveuncryptouniversalifyunenvunique-filenameunique-sluguniversal-user-agentupathunstorageuntildifyuntunupdate-browserslist-dbuqrutil-deprecateuri-jsurl-parseurlpattern-polyfillv8-compile-cacheuuidv8-compile-cache-libv8-to-istanbulvalidate-npm-package-namevalidate-npm-package-licenseverrorwcwidthw3c-xmlserializerwhichwalk-up-pathwalkerwhatwg-encodingwhatwg-mimetypewhich-boxed-primitivewhich-modulewhich-pmwhich-typed-arraywide-alignwrappywrite-file-atomicwrite-json-filewrite-pkgword-wrapxml-name-validatorwrap-ansiwswordwrapy18nyallistxmlcharsyargs-parseryargsxssxtendyamlreusifyynyauzlyocto-queuenormalize-package-data
0.0.0

1 month ago

0.1.0

2 years ago