1

I have a scenario where I would like to use NextJS to build an application that would be deployed on a mikrotik router board.

In this case I need to have both backend and frontend served via the Router Board.

I understand, the awesomeness of NextJS and how APIs and FrontEnd code can be shipped from same code base similar to how PHP works.

My question now is it possible for me to generate all codes(Backend and FrontEnd) built via NextJS and deploy all of it locally on any OS of my choice without going through Vercel.

My primary concern is that I do not want any sensitive code being made visible to the user from their Client Browsers. Sensitive codes should only be served from the NextJS Backend Server.

Is this possible?

Thanks in anticipation for your inputs.

ololo
  • 1,326
  • 2
  • 14
  • 47

1 Answers1

0

My question now is it possible for me to generate all codes(Backend and FrontEnd) built via NextJS and deploy all of it locally on any OS of my choice without going through Vercel.

Not 100% sure about any OS, but yes. You can deploy it on any platform which supports Node.js (I haven't tried to build Next.js on Deno, so I have no clue about it) I deploy my own site, on VPS locally, without using Vercel. And use next build also on a remote server, but gitlab or github actions also could do it.

Sensitive codes should only be served from the NextJS Backend Server.

Yes, that's the point of Next.js and possible via getServerSideProps But you don't need the backend next.js exactly. Just make a backend with REST api or GraphQL which will serve all the page requests from front-end Next.js.

AlexZeDim
  • 3,520
  • 2
  • 28
  • 64