Next.js Discord

Discord Forum

Online app but local CMS

Unanswered
Rhinelander posted this in #help-forum
Open in Discord
RhinelanderOP
Hey quick and simple question. I want to host my next.js app on Vercel but I want my Strapi CMS to be local so that I don't pay extra. Is that possible if let say I turn off strapi server or even turn off my PC? If possible how would I achieve that?

23 Replies

@Rhinelander Hey quick and simple question. I want to host my next.js app on Vercel but I want my Strapi CMS to be local so that I don't pay extra. Is that possible if let say I turn off strapi server or even turn off my PC? If possible how would I achieve that?
yes you can build the site with SSG which mean the content is generated on build time. so the site will still show your page even your CMS is off.
however, when you udpate the data in cms you will have to build the site again
by default, its ssg with next 14 app router
RhinelanderOP
Thanks but do you think its worth it or should i just host cms on raleway
well depend on your use case, if the content is not update very often, hosting the cms locally should be fine
RhinelanderOP
Well i would upload stuff 3 times per day. And if anything changes... new update or something i would change old posts...
so you still need to have the local website to run and be available from the internet
meaning running your own server
What could be viable is doing a static export (which is different from SSG)
but sadly it is not feature-complete in Next 13
Next 14 I mean
it still lacks supports for dynamic routes
so
my recommendation would be to self-host your Strapi on a free render instance and call it a day
on render.com
@Eric Burel so you still need to have the local website to run and be available from the internet
I think op would like to host the frontend on vercel and self host the CMS. it should be fine if the site is fully static generated right?
@Ray I think op would like to host the frontend on vercel and self host the CMS. it should be fine if the site is fully static generated right?
Yeah I get what you mean, if OP can open their computer to the Internet, and make sure the PC is on when they rebuild why not
however be careful to not enable any kind of revalidation
also double-check that it works ok: I've seen dull bugs where static pages were actually revalidated later on
meaning, in theory it should work, but in real life if it doesn't you'll have to send a bug ticket to Vercel or Next (I can't link to those specific bugs right now and they might have been fixed since but just so you know this stuff may happen)
it's safer to use a host that can stay dormant but still be able to wake up on demand like a free Render.com instance, I don't know if cloud host have such offers
(however the build may timeout by the time they wake so that's also risky...)
OP question is very interesting though