How to structure Next.js app so that it is installable/deployable as-is, by anyone in the community? #82684
Unanswered
lancejpollard
asked this question in
Help
Replies: 1 comment 2 replies
-
A GitHub repo? they fork it, login to Vercel with Github, and deploy it? Provide sensible defaults/fallbacks, for env vars, and for those that can't be defaulted clearly print which ones are missing, give instructions on how to get them. The Vercel dashboard has a pretty nice interface to add these values. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Don't know how to concisely write the title 😂, but basically, I am thinking of making a Next.js app so that any user that is not part of my org (i.e. "anyone" in theory) can just deploy it and set some basic ENV vars in their Vercel settings. Something like that.
The thinking is, for example building a generic SQL database admin panel UI tool which connects to some PostgreSQL db on the backend let's say (wherever it's hosted). And just by deploying this pre-built Next.js app to Vercel, they get a full DB admin panel basically. You could do this for lots of things, having prebuilt apps which don't need modification other than config settings (like ENV vars).
What is the best way to architect / accomplish this?
Initial Thoughts on Solution
Initial thoughts on how to solve this are basically:
@myorg/my-prebuilt-nextjs-app
package, hosted on npmjs.com, which is a full Next.js app.Trying again...
So that would get kinda cumbersome, having to build a library package (1), and a test Next.js app (2), which imports the library, to test deploying it and whatnot.
Both of these half-considered approaches seem like they wouldn't work, or would be tedious/repetitive for each app.
Is there a way to basically just have the full Next.js app as an npm package, and just deploy that as is to any Vercel account? If so, how might you structure things at a high level?
Other Thoughts
Maybe you could just have the Next.js app as a package, such as in
@myorg/my-prebuilt-nextjs-app
, and then somehow use avercel.json
custom script to install and symlink everything, or instead of symlinks, just copy stuff around? Ah no, that wouldn't work b/c of Vercel's file-system ephemerality stuff, etc.. Also seems complicated to deal with.Or maybe, does it just require me building a
@my-org/generate-my-prebuilt-nextjs-app
, an app generator, which just creates a new Next.js app, copying the folder/file structure from a template? Also has pros/cons....Question/Goal
Just looking for a decent way to approach this, to accomplish the goal of creating an easy-to-install default UI or whatever, for a common problem, like hosting your own Prometheus analytics UI or whatever, like any of these web interface apps you usually plop under a subdomain on your site.
How might you do that? What are some ways?
Beta Was this translation helpful? Give feedback.
All reactions