Next.js 
Create a Next.js Project 
To create a new Next.js project, run the following command:
npx -y create-next-app@latest remult-nextjsWhen prompted, use these answers:
✔ Would you like to use TypeScript? ... Yes
✔ Would you like to use ESLint? ... No
✔ Would you like to use Tailwind CSS? ... No
✔ Would you like to use `src/` directory? ... Yes
✔ Would you like to use App Router? (recommended) ... Yes
✔ Would you like to customize the default import alias? ... NoAfterward, navigate into the newly created project folder:
cd remult-nextjsInstall Remult 
Install the latest version of Remult:
npm install remultBootstrap Remult in the Backend 
Remult is bootstrapped in a Next.js app by creating a catch-all dynamic API route. This route will pass API requests to an object created using the remultApi function.
- Create an API file - In the - src/directory, create a file called- api.tswith the following code to set up Remult:ts- // src/api.ts import { remultApi } from 'remult/remult-next' export const api = remultApi({})
- Create the API Route - In the - src/app/apidirectory, create a- [...remult]subdirectory. Inside that directory, create a- route.tsfile with the following code:ts- // src/app/api/[...remult]/route.ts import { api } from '../../../api' export const { POST, PUT, DELETE, GET } = api
This file serves as a catch-all route for the Next.js API, handling all API requests by routing them through Remult.
Enable TypeScript Decorators 
To enable the use of decorators in your Next.js app, modify the tsconfig.json file. Add the following entry under the compilerOptions section:
// tsconfig.json
{
  ...
  "compilerOptions": {
    ...
    "experimentalDecorators": true // add this line
    ...
  }
}Run the App 
To start the development server, open a terminal and run the following command:
npm run devYour Next.js app is now running with Remult integrated and listening for API requests.