Two projects (sub-domains) using the same database
I just saw the presentation Bruno did on Svelte Weekly and I have a question. Lets say I'm building a public facing website and an administration counterpart for it, first one being
Route based approach might be a solution (
mywebsite.com
and later one is admin.mywebsite.com
can we setup this scenario? Maybe in a mono-repo or just a parent-child folder structure for the projects and both sites uses same manifest project.Route based approach might be a solution (
mysite.com/admin
) if manifest doesn't support multi-project environment yet I'm sure there are projects which above use case makes more sense too.
Thank you3 Replies
Hello @Bogac, Bruno here ✌ it is a good question.
Manifest works as following:
- The admin panel is served at
/
- The API is available at /api/
If you setup the Manifest backend on admin.mywebsite.com
you will have your API available at admin.mywebsite.com/api/
. Then you can setup your Frontend (Svelte i suppose) at mywebsite.com
.
It can be a monorepo or several repos it does not matter actually as long as you have access to the backend at admin.mywebsite.com
and the frontend at mywebsite.com
(with different serve scripts if monorepo).
This repo https://github.com/mnfst/frontend-examples is a monorepo example where we are going to add several frontends (one per popular frontend framework) that connects to a single Manifest backend.GitHub
GitHub - mnfst/frontend-examples
Contribute to mnfst/frontend-examples development by creating an account on GitHub.
Now I get it, I thought I need to install/initialize manifest in the same framework app but no it doesn't have to be.
Exactely, this can be useful on some use cases but on yours I would go either monorepo with a "server" folder with manfiest in it and a "client" folder with your frontend, or 2 separate repos (depends on how you want it)