Hi there, I'm keen to try out serverless stack, ju...
# help
d
Hi there, I'm keen to try out serverless stack, just wondering what the best approach is when you have multiple packages in a monorepo. For example we often have a setup where we have multiple apis in the same monorepo and they have their own sets of dependencies, the structure might look like:
Copy code
- packages
	- api1
		- src
			- index.ts
		- package.json
		- node_modules
	- api2
		- src
			- index.ts
		- package.json
		- node_modules
would you have a single install of serverless stack at the root? Or a separate one in each package? Is there an example of working with a monorepo like this?
t
tldr keep a single serverless app at the root
if it becomes a problem because you want to deploy the services independently, then make separate ones
d
Brilliant, thanks! I think our use-case calls for a little more separation between services than that example but it looks like a really good starting point.
o
we do multiple stacks so the structure it’s just copies of that Dax posted:
Copy code
- stack1/
  - sst.json
  - resources/ (has sst stsaks)
  - services/ (has lambda handlers)
- stack2/
  - sst.json
  - resources/ (has sst stsaks)
  - services/ (has lambda handlers)
Each folder inside services is its own package (with lerna workspaces + yarn). One thing I had to do to deploy with SEED was to have lerna consider each stack folder a workspace, but have both
stack1
and
services/service1
as yarn workspaces. Otherwise changes in service1 wouldn’t trigger a deploy in stack1