Multi Projects vs. one Project

Hello!
I have a nuxt PWA consuming an API to display several information.
There are about 600 Subdomains which get connected to the PWA displaying different information with the same “template”.
I’m struggeling if it is better to create

  1. one project (connected with one subdomain) for each subdomain and using an environment variable to tell the API which data do display
    or
  2. to have only one project (connected all subdomains) and using the subdomain of the uri to tell the API which data to diplay

My thoughts:

  • having one project for each subdomain could be better for performance? (each subdomain has it own “hosting environment”?)
  • commiting a change would result in 600 parallel builds if I have one project for each subdomain - is that a problem?
  • having to change anything in the vercel configuration would need to do it 600 times if I have 600 projects (I guess that this does not happen very often?)

Any one with experience to use the same Code on such an amount of sites here? Any ideas?

Thank you

Christian

Hi, @ce-toco3com!

I’ll leave this open for the rest of the community to tune in.

Personally, I would recommend going with a single project for all subdomains mostly because it’s easier. My thoughts:

  1. Managing a single codebase is significantly easier than managing 600 separate projects. Saved time and reduce the chances of errors when making updates.
  2. Having 600 parallel builds for every change is likely to cause issues with your CI/CD pipeline
  3. As you mentioned, having to change Vercel (or any other platform) configuration 600 times would be extremely time-consuming and error-prone.
  4. While having separate projects might seem better for performance, a well-architected single project can perform just as well, if not better. You can use code splitting and lazy loading to ensure that only the necessary code is loaded for each subdomain.
  5. If you need to add more subdomains in the future, it’s much easier to do so with a single project than to create and configure new projects each time.

I’d also recommend asking in the Nuxt Community in case they have any ideas!

1 Like