# Nextjs with Forest Admin example

**URL:** <https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931>\
**Category:** Help me!\
**Created:** [September 9, 2020, 5:16am UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931 "2020-09-09T05:16:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![errolgreen](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/errolgreen/32/754_2.png) [@errolgreen](https://community.forestadmin.com/u/errolgreen)\
**Post date:** [September 9, 2020, 5:16am UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931/1 "2020-09-09T05:16:18Z")

</div>

My backend is hosted on Vercel using NextJS framework. I was wondering if anybody has used Forest Admin with NextJS and whether or not it would be possible given that the some of the public routes such as `/routes/session` are dynamically loaded during runtime.

Is there any examples that anybody could point me too?

---

<div class="post-metadata">

**Author:** ![anon37102731](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@anon37102731](https://community.forestadmin.com/u/anon37102731)\
**Post date:** [September 9, 2020, 8:45am UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931/2 "2020-09-09T08:45:57Z")

</div>

Hi @errolgreen,

Welcome to the ForestAdmin community and thank you for reaching out!

By design ForestAdmin is built to generate a standalone backend application, hosted on your end, that directly communicate with your database, thus it should not go through your NextJS app.

If you have more questions about ForestAdmin architecture, maybe this article could help you get an overlook of it: [https://medium.com/forest-admin/a-deep-dive-into-forest-admins-architecture-and-its-benefits-for-the-developers-who-trust-it-1d49212fb4b](https://medium.com/forest-admin/a-deep-dive-into-forest-admins-architecture-and-its-benefits-for-the-developers-who-trust-it-1d49212fb4b).

I hope I’ve been of any help!

---

<div class="post-metadata">

**Author:** ![jckw](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jckw/32/7073_2.png) [@jckw](https://community.forestadmin.com/u/jckw)\
**Post date:** [June 17, 2024, 1:39pm UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931/3 "2024-06-17T13:39:13Z")

</div>

Is this still the case? I think it should be possible. Nextjs supports dynamic API routes, and @forestadmin/agent seems to basically be adding a bunch of route to whatever server is chosen.

It seems feasible to make this work with NextJS’s API stuff now (not sure that was the case in 2020)

---

<div class="post-metadata">

**Author:** ![morganperre](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/morganperre/32/1296_2.png) [@morganperre](https://community.forestadmin.com/u/morganperre)\
**Post date:** [June 21, 2024, 9:13am UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931/4 "2024-06-21T09:13:13Z")

</div>

Hello @jckw,

> [@jckw](#):
>
> Is this still the case? I think it should be possible. Nextjs supports dynamic API routes, and @forestadmin/agent seems to basically be adding a bunch of route to whatever server is chosen.

This answer was made a long time ago.

Today we do have a native integration to NextJS.

> **[On NestJS | Node.js Developer Guide](https://docs.forestadmin.com/developer-guide-agents-nodejs/getting-started/install/expose-an-http-endpoint/using-nest)**

And one of our contributor even created a NextJS native module.

> [@NestJS native module](https://community.forestadmin.com/t/nestjs-native-module/7119):
>
> Hey there, I couldn’t find the right place to discuss it, but to avoid having to do again and again a manual integration each time I want to use Forest with NestJS, i’ve created a nestjs-first module. I’ll continue maintaining it for a while since I use it on big production projects. It is available here [GitHub - Segfaultd/nestjs-forest: NestJS module for the Forest Admin agent](https://github.com/Segfaultd/nestjs-forest) Feel free to make any issue / PR / comment slight_smile

Kind regards,  
Morgan

---

<div class="post-metadata">

**Author:** ![Jeremy\_Fuhrmann](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/jeremy_fuhrmann/32/7583_2.png) [@Jeremy\_Fuhrmann](https://community.forestadmin.com/u/Jeremy_Fuhrmann)\
**Post date:** [November 28, 2024, 11:06pm UTC](https://community.forestadmin.com/t/nextjs-with-forest-admin-example/931/5 "2024-11-28T23:06:41Z")

</div>

Hi Forest community!

I have also the same use case, I use the `API routes` from NextJS for my app backend. So my api routes are served as serverless functions by Vercel, so I don’t have a classic backend server up and running all the time. So I was wondering if Forest Admin is compatible with this config.  
I can create api routes to handle actions in forest admin panel, like smart actions, but how could I init the agent, and make the `.forestadmin-schema.json` and all the config visible to Forest ?

(The last answer mentioned NestJS instead of NextJS, which are very different 😉 )

Thanks for your help!
