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?
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.
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)
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 )