Similar site on multiple URLs

Hypothetically speaking. I need to build a page for a client. I really want to use NextJS for it. The client wants 4 website. One main website, and 3 "sub"-websites that will be hosted on the different url. Sub-websites should be basically the same as the main websites but with different news sections, logos and some elements. I want to have one codebase and one database for everything. Having one database should be no problem, but can I do it with only one codebase as the url will be different for every website? Are there any suggestions on how should I approach it? Also, I should allow the client to edit quite a few stuff on the page. Should I just go with headless CMS (any recommendation) or I'm I better of building it myself?
2 Replies
Pod
Pod2y ago
You can use a monorepo and make a application for each of the sites, use a tool like lerna, turbo, etc to manage dependencies, then you can deploy each site separately to each subdomain. That also allows you to have a shared ui package.
thescotsmav
thescotsmav2y ago
Could also likely use nextjs middleware to rewrite different domains pointed at the same deployment to folders in /pages ? Maybe
Want results from more Discord servers?
Add your server