diff --git a/.changeset/khaki-timers-travel.md b/.changeset/khaki-timers-travel.md
new file mode 100644
index 000000000000..a783582aa3b5
--- /dev/null
+++ b/.changeset/khaki-timers-travel.md
@@ -0,0 +1,80 @@
+---
+"@pankod/refine-nextjs-router": major
+---
+
+- Bumped Next.js to 13
+- Added support for experimental `appDir` option in `next.config.js` to allow for the latest Next.js features.
+
+
+## `pages` directory
+
+Current support for `pages` directory has not changed and will continue to work as before. It will be supported as long as `Next.js` continues to support and prompts it as the stable way of working with `Next.js`.
+
+## `appDir` option
+
+`appDir` option is a new experimental feature in `Next.js` that introduces a bunch of new features. It is currently in beta and is not stable. It is not recommended to use it in production. But can be used alongside the current `pages` directory support.
+
+To use `appDir` option, you need to add it to your `next.config.js` file.
+
+```js
+// next.config.js
+module.exports = {
+ /* ... */
+ experimental: {
+ appDir: true,
+ },
+};
+```
+
+## Using `appDir` with **refine**
+
+We've needed to make some changes to the `@pankod/refine-nextjs-router` to make it work with the current structure of the `app` directory feature. To make sure these do not break the current support for `pages` directory, we've added a new exports at the sub path `@pankod/refine-nextjs-router/app` that can be used with the `appDir` option.
+
+**Note**
+
+To make optional catch-all routes to work with the `app` directory, you need to define them as directories unlike the option of defining them as files with `pages` directory.
+
+You need to use `NextRouteComponent` from `@pankod/refine-nextjs-router/app` instead of `NextRouteComponent` from `@pankod/refine-nextjs-router` when using `appDir` option.
+
+Inside your `layout` file, you need to bind `params` to `routerProvider` to make sure `@pankod/refine-nextjs-router` can work properly with the new structure.
+
+```tsx
+// app/[[...refine]]/layout.tsx
+"use client";
+
+import routerProvider from "@pankod/refine-nextjs-router/app";
+
+const Layout = ({ children, params }) => {
+ return (
+
+ {children}
+
+ );
+};
+```
+
+**Warning**
+
+Please note that, unlike the `routerProvider` from the `@pankod/refine-nextjs-router`, `routerProvider` from `@pankod/refine-nextjs-router/app` is a function and you need to bind `params` to make it work properly.
+
+```tsx
+// app/[[...refine]]/page.tsx
+
+"use client";
+
+import { NextRouteComponent } from "@pankod/refine-nextjs-router/app";
+
+export default NextRouteComponent;
+
+```
+
+**Warning**
+
+You need to add `"use client";` directive to both `layout.tsx` and `page.tsx` inside `app/[[...refine]]` directory.
+
+**Warning**
+
+`checkAuthentication` does not work with `appDir`. We're aiming to release a substitute for it using middleware but for now its not included in this release.
\ No newline at end of file
diff --git a/documentation/docs/advanced-tutorials/ssr/nextjs.md b/documentation/docs/advanced-tutorials/ssr/nextjs.md
index a0b3d7a14158..52cab47e2db8 100644
--- a/documentation/docs/advanced-tutorials/ssr/nextjs.md
+++ b/documentation/docs/advanced-tutorials/ssr/nextjs.md
@@ -396,9 +396,86 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
`parseTableParams` parses the query string and returns query parameters([refer here for their interfaces][interfaces]). They can be directly used for `dataProvider` methods that accepts them.
+## `appDir` Support
+
+Next.js introduced a new way of defining pages within the `app/` directory. _This new directory has support for layouts, nested routes, and uses Server Components by default._ To learn more about the feature check out [Next.js Beta docs](https://beta.nextjs.org/docs/upgrade-guide)
+
+**refine** also follows this feature and provides a way to use `appDir` with your **refine** apps.
+
+:::caution
+
+`app/` is currently in beta and is **not recommended** for production use in Next.js. In **refine**, we're providing the `app/` support as experimental and not recommended for production use.
+
+:::
+
+To start using `app/` with **refine**, you need to set create the **refine** routes in your `/app` directory with the following convention:
+
+```bash
+
+your-project
+└── app
+ └── [[...refine]]
+ ├── layout.tsx
+ └── page.tsx
+
+```
+
+**Initializing `` in `layout.tsx`**
+
+```tsx title="app/[[...refine]]/layout.tsx"
+"use client";
+
+import routerProvider from "@pankod/refine-nextjs-router/app";
+
+export default function RefineLayout({
+ children,
+ params,
+}: {
+ children: React.ReactNode;
+ params: Record<"refine", string[]>;
+}) {
+ return (
+
+ {children}
+
+ );
+}
+```
+
+We need to bind the `params` to the `routerProvider` and call it to initialize the `routerProvider`. This is because the `params` are not available via hooks for **refine** to use.
+
+**Creating `page.tsx`**
+
+```tsx title="app/[[...refine]]/page.tsx"
+"use client";
+
+import { NextRouteComponent } from "@pankod/refine-nextjs-router/app";
+
+export default NextRouteComponent;
+```
+
+Note that we're importing `NextRouteComponent` from `@pankod/refine-nextjs-router/app` instead of `@pankod/refine-nextjs-router`. This is because we're using the `app/` directory and we need to import the `app` version of the `NextRouteComponent`.
+
+:::note
+`"use client";` is a directive that instructs Next.js to opt-out from Server Components. This is because **refine** and dependencies are not yet compatible with Server Components. Thats why we're using it in both `layout.tsx` and `page.tsx` files.
+:::
+
+:::note
+`checkAuthentication` does not work with `app/` directory. You need to handle the authentication your views while using `app/` directory.
+
+**refine** aims to provide a middleware for `app/` directory to substitue `checkAuthentication` but it's not available yet.
+:::
+
+:::info
+You can find the `app/` directory example with **refine** in [examples/nextjs/appdir](https://github.com/refinedev/refine/tree/next/examples/remix/antd)
+:::
+
## Live StackBlitz Example
-
diff --git a/documentation/docs/examples/next-js/appdir.md b/documentation/docs/examples/next-js/appdir.md
new file mode 100644
index 000000000000..04d85cb82df0
--- /dev/null
+++ b/documentation/docs/examples/next-js/appdir.md
@@ -0,0 +1,16 @@
+---
+id: nextjs-appdir
+title: With `app/` Directory
+example-tags: [next.js,router-provider,antd,experimental]
+---
+
+**refine** allows you to use the `app/` structure in your Next.js apps. To learn more about the `app/` directory, check out [Next.js beta docs](https://beta.nextjs.org/docs/upgrade-guide). In this example you will find how to use the `app/` directory with refine.
+
+[Refer to the refine Next.js documentation for more information. →](/docs/advanced-tutorials/ssr/nextjs.md)
+
+[View Next.js with `app/` Example Source](https://github.com/refinedev/refine/tree/master/examples/nextjs/appdir)
+
+
diff --git a/documentation/docs/examples/next-js/next-js.md b/documentation/docs/examples/next-js/next-js.md
index 1a19e4c08693..b4836a6cfb87 100644
--- a/documentation/docs/examples/next-js/next-js.md
+++ b/documentation/docs/examples/next-js/next-js.md
@@ -8,9 +8,9 @@ example-tags: [next.js,router-provider,antd]
[Refer to the refine Next.js documentation for more information. →](/docs/advanced-tutorials/ssr/nextjs.md)
-[View Next.js Example Source](https://github.com/refinedev/refine/tree/master/examples/refine-next)
+[View Next.js Example Source](https://github.com/refinedev/refine/tree/master/examples/nextjs/base)
-
diff --git a/documentation/sidebars.js b/documentation/sidebars.js
index afab593f60b7..2538a8e45d63 100644
--- a/documentation/sidebars.js
+++ b/documentation/sidebars.js
@@ -825,7 +825,10 @@ module.exports = {
{
type: "category",
label: "Next.js",
- items: ["examples/next-js/nextjs"],
+ items: [
+ "examples/next-js/nextjs",
+ "examples/next-js/nextjs-appdir",
+ ],
},
{
type: "category",
diff --git a/examples/blog/ecommerce/package.json b/examples/blog/ecommerce/package.json
index d7ac08d3c7a1..c5230ecad86c 100644
--- a/examples/blog/ecommerce/package.json
+++ b/examples/blog/ecommerce/package.json
@@ -19,7 +19,7 @@
"@pankod/refine-strapi-v4": "^3.39.0",
"axios": "^0.26.1",
"framer-motion": "^7.5.3",
- "next": "^12.1.6",
+ "next": "^13.0.6",
"next-compose-plugins": "^2.2.1",
"nookies": "^2.5.2",
"react": "^18.0.0",
diff --git a/examples/blog/next-refine-pwa/package.json b/examples/blog/next-refine-pwa/package.json
index 8913c273e5f4..0d2aa877e0d2 100644
--- a/examples/blog/next-refine-pwa/package.json
+++ b/examples/blog/next-refine-pwa/package.json
@@ -12,7 +12,7 @@
"@pankod/refine-core": "^3.90.4",
"@pankod/refine-nextjs-router": "^3.38.0",
"@pankod/refine-simple-rest": "^3.37.4",
- "next": "^12.1.6",
+ "next": "^13.0.6",
"next-compose-plugins": "^2.2.1",
"react": "^18.0.0",
"react-dom": "^18.0.0"
diff --git a/examples/fineFoods/client/package.json b/examples/fineFoods/client/package.json
index ac84b236d26d..0a18b66d4c22 100644
--- a/examples/fineFoods/client/package.json
+++ b/examples/fineFoods/client/package.json
@@ -15,7 +15,7 @@
"@pankod/refine-simple-rest": "^3.37.4",
"gsap": "^3.8.0",
"js-confetti": "^0.9.0",
- "next": "^12.1.6",
+ "next": "^13.0.6",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
diff --git a/examples/i18n/nextjs/package.json b/examples/i18n/nextjs/package.json
index 842275138d04..08c40a17eaf0 100644
--- a/examples/i18n/nextjs/package.json
+++ b/examples/i18n/nextjs/package.json
@@ -13,7 +13,7 @@
"@pankod/refine-core": "^3.90.4",
"@pankod/refine-nextjs-router": "^3.38.0",
"@pankod/refine-simple-rest": "^3.37.4",
- "next": "^12.1.6",
+ "next": "^13.0.6",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^8.9.0",
"nookies": "^2.5.2",
diff --git a/examples/refine-next/.gitattributes b/examples/nextjs/appdir/.gitattributes
similarity index 100%
rename from examples/refine-next/.gitattributes
rename to examples/nextjs/appdir/.gitattributes
diff --git a/examples/refine-next/.gitignore b/examples/nextjs/appdir/.gitignore
similarity index 100%
rename from examples/refine-next/.gitignore
rename to examples/nextjs/appdir/.gitignore
diff --git a/examples/refine-next/LICENSE b/examples/nextjs/appdir/LICENSE
similarity index 100%
rename from examples/refine-next/LICENSE
rename to examples/nextjs/appdir/LICENSE
diff --git a/examples/refine-next/README.MD b/examples/nextjs/appdir/README.MD
similarity index 100%
rename from examples/refine-next/README.MD
rename to examples/nextjs/appdir/README.MD
diff --git a/examples/nextjs/appdir/app/[[...refine]]/layout.tsx b/examples/nextjs/appdir/app/[[...refine]]/layout.tsx
new file mode 100644
index 000000000000..3461eaf4f7fb
--- /dev/null
+++ b/examples/nextjs/appdir/app/[[...refine]]/layout.tsx
@@ -0,0 +1,64 @@
+"use client";
+
+import React from "react";
+
+import { Refine } from "@pankod/refine-core";
+import {
+ notificationProvider,
+ Layout,
+ ErrorComponent,
+ AuthPage,
+} from "@pankod/refine-antd";
+import dataProvider from "@pankod/refine-simple-rest";
+import routerProvider from "@pankod/refine-nextjs-router/app";
+import "@pankod/refine-antd/dist/styles.min.css";
+
+import "@styles/global.css";
+
+import { authProvider } from "src/authProvider";
+import { API_URL } from "../../src/constants";
+
+import { PostList, PostCreate, PostEdit, PostShow } from "@components";
+
+export default function RefineLayout({
+ children,
+ params,
+}: {
+ children: React.ReactNode;
+ params: Record<"refine", string[]>;
+}) {
+ return (
+ (
+
+ )}
+ Layout={Layout}
+ catchAll={}
+ >
+ {children}
+
+ );
+}
diff --git a/examples/nextjs/appdir/app/[[...refine]]/page.tsx b/examples/nextjs/appdir/app/[[...refine]]/page.tsx
new file mode 100644
index 000000000000..1f5b182ea9b8
--- /dev/null
+++ b/examples/nextjs/appdir/app/[[...refine]]/page.tsx
@@ -0,0 +1,5 @@
+"use client";
+
+import { NextRouteComponent } from "@pankod/refine-nextjs-router/app";
+
+export default NextRouteComponent;
diff --git a/examples/nextjs/appdir/app/layout.tsx b/examples/nextjs/appdir/app/layout.tsx
new file mode 100644
index 000000000000..e28eaf552a1f
--- /dev/null
+++ b/examples/nextjs/appdir/app/layout.tsx
@@ -0,0 +1,11 @@
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode;
+}) {
+ return (
+
+
{children}
+
+ );
+}
diff --git a/examples/refine-next/next-env.d.ts b/examples/nextjs/appdir/next-env.d.ts
similarity index 100%
rename from examples/refine-next/next-env.d.ts
rename to examples/nextjs/appdir/next-env.d.ts
diff --git a/examples/nextjs/appdir/next.config.js b/examples/nextjs/appdir/next.config.js
new file mode 100644
index 000000000000..18c8a851d1ab
--- /dev/null
+++ b/examples/nextjs/appdir/next.config.js
@@ -0,0 +1,10 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+ swcMinify: true,
+ experimental: {
+ appDir: true,
+ },
+};
+
+module.exports = nextConfig;
diff --git a/examples/nextjs/appdir/package.json b/examples/nextjs/appdir/package.json
new file mode 100644
index 000000000000..1e80e302ee6b
--- /dev/null
+++ b/examples/nextjs/appdir/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "refine-nextjs-appdir",
+ "version": "3.25.0",
+ "private": true,
+ "scripts": {
+ "start": "NODE_OPTIONS=--max_old_space_size=4096 PORT=3002 next dev",
+ "build": "next build",
+ "start:prod": "next start",
+ "lint": "eslint '**/*.{js,jsx,ts,tsx}'"
+ },
+ "dependencies": {
+ "@pankod/refine-antd": "^3.64.2",
+ "@pankod/refine-core": "^3.90.4",
+ "@pankod/refine-nextjs-router": "^3.38.0",
+ "@pankod/refine-simple-rest": "^3.37.4",
+ "next": "^13.0.6",
+ "nookies": "^2.5.2",
+ "react": "^18.0.0",
+ "react-dom": "^18.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "^12.20.11",
+ "@types/react": "^18.0.0",
+ "@types/react-dom": "^18.0.0",
+ "@typescript-eslint/parser": "^5.38.1",
+ "typescript": "^4.7.4"
+ }
+}
diff --git a/examples/refine-next/public/icons/github-icon.svg b/examples/nextjs/appdir/public/icons/github-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/github-icon.svg
rename to examples/nextjs/appdir/public/icons/github-icon.svg
diff --git a/examples/refine-next/public/icons/linkedin-icon.svg b/examples/nextjs/appdir/public/icons/linkedin-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/linkedin-icon.svg
rename to examples/nextjs/appdir/public/icons/linkedin-icon.svg
diff --git a/examples/refine-next/public/icons/nextjs-icon.svg b/examples/nextjs/appdir/public/icons/nextjs-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/nextjs-icon.svg
rename to examples/nextjs/appdir/public/icons/nextjs-icon.svg
diff --git a/examples/refine-next/public/icons/pankod-icon.svg b/examples/nextjs/appdir/public/icons/pankod-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/pankod-icon.svg
rename to examples/nextjs/appdir/public/icons/pankod-icon.svg
diff --git a/examples/refine-next/public/icons/twitter-icon.svg b/examples/nextjs/appdir/public/icons/twitter-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/twitter-icon.svg
rename to examples/nextjs/appdir/public/icons/twitter-icon.svg
diff --git a/examples/refine-next/public/icons/youtube-icon.svg b/examples/nextjs/appdir/public/icons/youtube-icon.svg
similarity index 100%
rename from examples/refine-next/public/icons/youtube-icon.svg
rename to examples/nextjs/appdir/public/icons/youtube-icon.svg
diff --git a/examples/refine-next/public/meta.json b/examples/nextjs/appdir/public/meta.json
similarity index 100%
rename from examples/refine-next/public/meta.json
rename to examples/nextjs/appdir/public/meta.json
diff --git a/examples/nextjs/appdir/src/authProvider.ts b/examples/nextjs/appdir/src/authProvider.ts
new file mode 100644
index 000000000000..dc2c87e394df
--- /dev/null
+++ b/examples/nextjs/appdir/src/authProvider.ts
@@ -0,0 +1,73 @@
+import { AuthProvider } from "@pankod/refine-core";
+import nookies from "nookies";
+
+const mockUsers = [
+ {
+ email: "admin@refine.dev",
+ roles: ["admin"],
+ },
+ {
+ email: "editor@refine.dev",
+ roles: ["editor"],
+ },
+];
+
+export const authProvider: AuthProvider = {
+ login: ({ email }) => {
+ // Suppose we actually send a request to the back end here.
+ const user = mockUsers.find((item) => item.email === email);
+
+ if (user) {
+ nookies.set(null, "auth", JSON.stringify(user), {
+ maxAge: 30 * 24 * 60 * 60,
+ path: "/",
+ });
+ return Promise.resolve();
+ }
+
+ return Promise.reject();
+ },
+ logout: () => {
+ nookies.destroy(null, "auth");
+ return Promise.resolve();
+ },
+ checkError: (error) => {
+ if (error && error.statusCode === 401) {
+ return Promise.reject();
+ }
+
+ return Promise.resolve();
+ },
+ checkAuth: (ctx) => {
+ if (ctx) {
+ if (ctx.cookies?.get?.("auth")) {
+ return Promise.resolve();
+ } else {
+ return Promise.reject();
+ }
+ } else {
+ const cookies = nookies.get(null);
+ if (cookies.auth) {
+ return Promise.resolve();
+ } else {
+ return Promise.reject();
+ }
+ }
+ },
+ getPermissions: () => {
+ const auth = nookies.get()["auth"];
+ if (auth) {
+ const parsedUser = JSON.parse(auth);
+ return Promise.resolve(parsedUser.roles);
+ }
+ return Promise.reject();
+ },
+ getUserIdentity: () => {
+ const auth = nookies.get()["auth"];
+ if (auth) {
+ const parsedUser = JSON.parse(auth);
+ return Promise.resolve(parsedUser.username ?? parsedUser.email);
+ }
+ return Promise.reject();
+ },
+};
diff --git a/examples/refine-next/src/components/index.ts b/examples/nextjs/appdir/src/components/index.ts
similarity index 100%
rename from examples/refine-next/src/components/index.ts
rename to examples/nextjs/appdir/src/components/index.ts
diff --git a/examples/refine-next/src/components/posts/create.tsx b/examples/nextjs/appdir/src/components/posts/create.tsx
similarity index 100%
rename from examples/refine-next/src/components/posts/create.tsx
rename to examples/nextjs/appdir/src/components/posts/create.tsx
diff --git a/examples/refine-next/src/components/posts/edit.tsx b/examples/nextjs/appdir/src/components/posts/edit.tsx
similarity index 100%
rename from examples/refine-next/src/components/posts/edit.tsx
rename to examples/nextjs/appdir/src/components/posts/edit.tsx
diff --git a/examples/refine-next/src/components/posts/index.ts b/examples/nextjs/appdir/src/components/posts/index.ts
similarity index 100%
rename from examples/refine-next/src/components/posts/index.ts
rename to examples/nextjs/appdir/src/components/posts/index.ts
diff --git a/examples/refine-next/src/components/posts/list.tsx b/examples/nextjs/appdir/src/components/posts/list.tsx
similarity index 100%
rename from examples/refine-next/src/components/posts/list.tsx
rename to examples/nextjs/appdir/src/components/posts/list.tsx
diff --git a/examples/refine-next/src/components/posts/show.tsx b/examples/nextjs/appdir/src/components/posts/show.tsx
similarity index 100%
rename from examples/refine-next/src/components/posts/show.tsx
rename to examples/nextjs/appdir/src/components/posts/show.tsx
diff --git a/examples/refine-next/src/constants.ts b/examples/nextjs/appdir/src/constants.ts
similarity index 100%
rename from examples/refine-next/src/constants.ts
rename to examples/nextjs/appdir/src/constants.ts
diff --git a/examples/refine-next/src/interfaces/index.ts b/examples/nextjs/appdir/src/interfaces/index.ts
similarity index 100%
rename from examples/refine-next/src/interfaces/index.ts
rename to examples/nextjs/appdir/src/interfaces/index.ts
diff --git a/examples/refine-next/src/styles/global.css b/examples/nextjs/appdir/src/styles/global.css
similarity index 100%
rename from examples/refine-next/src/styles/global.css
rename to examples/nextjs/appdir/src/styles/global.css
diff --git a/examples/nextjs/appdir/tsconfig.json b/examples/nextjs/appdir/tsconfig.json
new file mode 100644
index 000000000000..e46ab227ab7b
--- /dev/null
+++ b/examples/nextjs/appdir/tsconfig.json
@@ -0,0 +1,57 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": [
+ "dom",
+ "dom.iterable",
+ "esnext"
+ ],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "baseUrl": ".",
+ "paths": {
+ "@components/*": [
+ "src/components/*"
+ ],
+ "@components": [
+ "src/components"
+ ],
+ "@styles/*": [
+ "src/styles/*"
+ ],
+ "@styles": [
+ "src/styles"
+ ],
+ "@public/*": [
+ "public/*"
+ ],
+ "@public": [
+ "public"
+ ]
+ },
+ "incremental": true,
+ "plugins": [
+ {
+ "name": "next"
+ }
+ ]
+ },
+ "include": [
+ "next-env.d.ts",
+ "**/*.ts",
+ "**/*.tsx",
+ ".next/types/**/*.ts"
+ ],
+ "exclude": [
+ "node_modules"
+ ]
+}
diff --git a/examples/nextjs/base/.gitattributes b/examples/nextjs/base/.gitattributes
new file mode 100644
index 000000000000..176a458f94e0
--- /dev/null
+++ b/examples/nextjs/base/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/examples/nextjs/base/.gitignore b/examples/nextjs/base/.gitignore
new file mode 100644
index 000000000000..c340a29f40d2
--- /dev/null
+++ b/examples/nextjs/base/.gitignore
@@ -0,0 +1,8 @@
+# npm
+node_modules
+# next.js build files
+.next
+# environment variables
+.env
+.env.*
+!.env.example
\ No newline at end of file
diff --git a/examples/nextjs/base/LICENSE b/examples/nextjs/base/LICENSE
new file mode 100644
index 000000000000..80f82954b75f
--- /dev/null
+++ b/examples/nextjs/base/LICENSE
@@ -0,0 +1,19 @@
+The MIT License (MIT)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+n
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/examples/nextjs/base/README.MD b/examples/nextjs/base/README.MD
new file mode 100644
index 000000000000..244db6011f0b
--- /dev/null
+++ b/examples/nextjs/base/README.MD
@@ -0,0 +1,52 @@
+# refine-next
+
+
+This project was generated with [superplate](https://github.com/pankod/superplate).
+
+## Getting Started
+
+superplate is a Next.js all-in-one project generator. Create your project with the tools you need without spending hours on setting them up.
+
+## Available Scripts
+
+### Running the development server.
+
+```bash
+ npm run dev
+```
+
+### Building for production.
+
+```bash
+ npm run build
+```
+
+### Running the production server.
+
+```bash
+ npm run start
+```
+
+## Learn More
+
+To learn more about **superplate**, please check out the [Documentation](https://github.com/pankod/superplate).
+
+
+### **CSS / styled-jsx**
+
+Next.js comes with built-in support for CSS and styled-jsx. Styled-jsx is full, scoped and component-friendly CSS support for JSX (rendered on the server or the client).
+
+[Go To Documentation](https://github.com/vercel/styled-jsx)
+
+
+### **ESLint**
+
+A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
+
+[Go To Documentation](https://eslint.org/docs/user-guide/getting-started)
+
+
+
+## License
+
+MIT
diff --git a/examples/nextjs/base/next-env.d.ts b/examples/nextjs/base/next-env.d.ts
new file mode 100644
index 000000000000..4f11a03dc6cc
--- /dev/null
+++ b/examples/nextjs/base/next-env.d.ts
@@ -0,0 +1,5 @@
+///
+///
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/examples/refine-next/package.json b/examples/nextjs/base/package.json
similarity index 92%
rename from examples/refine-next/package.json
rename to examples/nextjs/base/package.json
index 4600a0ba0956..198ff38bc878 100644
--- a/examples/refine-next/package.json
+++ b/examples/nextjs/base/package.json
@@ -1,5 +1,5 @@
{
- "name": "refine-next",
+ "name": "refine-nextjs-base",
"version": "3.25.0",
"private": true,
"scripts": {
@@ -13,7 +13,7 @@
"@pankod/refine-core": "^3.90.4",
"@pankod/refine-nextjs-router": "^3.38.0",
"@pankod/refine-simple-rest": "^3.37.4",
- "next": "^12.1.6",
+ "next": "^13.0.6",
"nookies": "^2.5.2",
"react": "^18.0.0",
"react-dom": "^18.0.0"
diff --git a/examples/refine-next/pages/[[...refine]].tsx b/examples/nextjs/base/pages/[[...refine]].tsx
similarity index 100%
rename from examples/refine-next/pages/[[...refine]].tsx
rename to examples/nextjs/base/pages/[[...refine]].tsx
diff --git a/examples/refine-next/pages/_app.tsx b/examples/nextjs/base/pages/_app.tsx
similarity index 100%
rename from examples/refine-next/pages/_app.tsx
rename to examples/nextjs/base/pages/_app.tsx
diff --git a/examples/refine-next/pages/_document.tsx b/examples/nextjs/base/pages/_document.tsx
similarity index 100%
rename from examples/refine-next/pages/_document.tsx
rename to examples/nextjs/base/pages/_document.tsx
diff --git a/examples/refine-next/pages/users/index.tsx b/examples/nextjs/base/pages/users/index.tsx
similarity index 100%
rename from examples/refine-next/pages/users/index.tsx
rename to examples/nextjs/base/pages/users/index.tsx
diff --git a/examples/nextjs/base/public/icons/github-icon.svg b/examples/nextjs/base/public/icons/github-icon.svg
new file mode 100644
index 000000000000..1f8321854755
--- /dev/null
+++ b/examples/nextjs/base/public/icons/github-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/nextjs/base/public/icons/linkedin-icon.svg b/examples/nextjs/base/public/icons/linkedin-icon.svg
new file mode 100644
index 000000000000..17baff160537
--- /dev/null
+++ b/examples/nextjs/base/public/icons/linkedin-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/nextjs/base/public/icons/nextjs-icon.svg b/examples/nextjs/base/public/icons/nextjs-icon.svg
new file mode 100644
index 000000000000..6f04d140b3a6
--- /dev/null
+++ b/examples/nextjs/base/public/icons/nextjs-icon.svg
@@ -0,0 +1,6 @@
+
+
diff --git a/examples/nextjs/base/public/icons/pankod-icon.svg b/examples/nextjs/base/public/icons/pankod-icon.svg
new file mode 100644
index 000000000000..36e3e97daba3
--- /dev/null
+++ b/examples/nextjs/base/public/icons/pankod-icon.svg
@@ -0,0 +1,33 @@
+
+
\ No newline at end of file
diff --git a/examples/nextjs/base/public/icons/twitter-icon.svg b/examples/nextjs/base/public/icons/twitter-icon.svg
new file mode 100644
index 000000000000..08022b6888fd
--- /dev/null
+++ b/examples/nextjs/base/public/icons/twitter-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/nextjs/base/public/icons/youtube-icon.svg b/examples/nextjs/base/public/icons/youtube-icon.svg
new file mode 100644
index 000000000000..b9403e9982dd
--- /dev/null
+++ b/examples/nextjs/base/public/icons/youtube-icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/nextjs/base/public/meta.json b/examples/nextjs/base/public/meta.json
new file mode 100644
index 000000000000..fce9e68e7ccf
--- /dev/null
+++ b/examples/nextjs/base/public/meta.json
@@ -0,0 +1,15 @@
+{
+ "name": "refine-next",
+ "plugins": [
+ {
+ "name": "CSS / styled-jsx",
+ "description": "Next.js comes with built-in support for CSS and styled-jsx. Styled-jsx is full, scoped and component-friendly CSS support for JSX (rendered on the server or the client).",
+ "url": "https://github.com/vercel/styled-jsx"
+ },
+ {
+ "name": "ESLint",
+ "description": "A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.",
+ "url": "https://eslint.org/docs/user-guide/getting-started"
+ }
+ ]
+}
diff --git a/examples/refine-next/src/authProvider.ts b/examples/nextjs/base/src/authProvider.ts
similarity index 100%
rename from examples/refine-next/src/authProvider.ts
rename to examples/nextjs/base/src/authProvider.ts
diff --git a/examples/nextjs/base/src/components/index.ts b/examples/nextjs/base/src/components/index.ts
new file mode 100644
index 000000000000..4f89127aa97d
--- /dev/null
+++ b/examples/nextjs/base/src/components/index.ts
@@ -0,0 +1 @@
+export * from "./posts";
diff --git a/examples/nextjs/base/src/components/posts/create.tsx b/examples/nextjs/base/src/components/posts/create.tsx
new file mode 100644
index 000000000000..d2f2df7c4733
--- /dev/null
+++ b/examples/nextjs/base/src/components/posts/create.tsx
@@ -0,0 +1,48 @@
+import {
+ useForm,
+ useSelect,
+ Create,
+ Form,
+ Select,
+ Input,
+} from "@pankod/refine-antd";
+import { IPost } from "src/interfaces";
+
+export const PostCreate: React.FC = () => {
+ const { formProps, saveButtonProps } = useForm();
+
+ const { selectProps: categorySelectProps } = useSelect({
+ resource: "categories",
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/examples/nextjs/base/src/components/posts/edit.tsx b/examples/nextjs/base/src/components/posts/edit.tsx
new file mode 100644
index 000000000000..270c8f3444e4
--- /dev/null
+++ b/examples/nextjs/base/src/components/posts/edit.tsx
@@ -0,0 +1,49 @@
+import {
+ useForm,
+ useSelect,
+ Edit,
+ Form,
+ Input,
+ Select,
+} from "@pankod/refine-antd";
+import { IPost } from "src/interfaces";
+
+export const PostEdit: React.FC = () => {
+ const { formProps, saveButtonProps, queryResult } = useForm();
+
+ const { selectProps: categorySelectProps } = useSelect({
+ resource: "categories",
+ defaultValue: queryResult?.data?.data?.category.id,
+ });
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/examples/nextjs/base/src/components/posts/index.ts b/examples/nextjs/base/src/components/posts/index.ts
new file mode 100644
index 000000000000..ad928d13bc11
--- /dev/null
+++ b/examples/nextjs/base/src/components/posts/index.ts
@@ -0,0 +1,4 @@
+export * from "./list";
+export * from "./edit";
+export * from "./create";
+export * from "./show";
diff --git a/examples/nextjs/base/src/components/posts/list.tsx b/examples/nextjs/base/src/components/posts/list.tsx
new file mode 100644
index 000000000000..c90f692bea1d
--- /dev/null
+++ b/examples/nextjs/base/src/components/posts/list.tsx
@@ -0,0 +1,54 @@
+import { GetListResponse } from "@pankod/refine-core";
+import {
+ useTable,
+ List,
+ Table,
+ Space,
+ EditButton,
+ ShowButton,
+ DeleteButton,
+} from "@pankod/refine-antd";
+import type { IResourceComponentsProps } from "@pankod/refine-core";
+import { IPost } from "../../interfaces";
+
+export const PostList: React.FC<
+ IResourceComponentsProps>
+> = ({ initialData }) => {
+ const { tableProps } = useTable({
+ queryOptions: {
+ initialData,
+ },
+ });
+
+ return (
+
+