Given a monorepo similar
I’m interested in breaking apart the layers into their own different directories. Breaking up the layers but also still being able to use all the Redwood
tools to create components, pages etc or deploy, serve but ONLY for that directory. Running yarn redwood generate page home /
in ./apps/blog
would create that page but soley in ./apps/blog
. The same for any API directory.
Here’s what the directory structure looks currently
api
db
src
server.config.js
package.json
What I’m looking to do, currently, is more like the following where the layers are broken up in a monorepo
/project-root
/libraries
/component-library
/deployments
/packages
/shared-code
/daemon-1
/api-1
db
src
server.config.js
package.json
/api-1
... etc
/api-2
/serverless
/lambda1
/lambda2
/lambda3
/apps
/todos-example
/ecommerce
/blog
Under ./apps
would live all front ends and example websites. Under ./packages
would have, for example, our business logic and other microservices. In either ./apps
and ./packages
would be code managed both by Redwood
and other executables.
Can I … ?
My primary question is: Is it possible to generate just a Redwood
web app in ./apps/todos-example
but all the files are root level to that directory (ie: ./todo-example/src
& /todo-example/package.json
) and the same for backends. If not can I manually clean things up if needed (after running a scaffold) and Redwood
would still know how to handle a root directory for either an API
or WEB
?
If the above is true, then when I run yarn rw generate page
in ./apps/todos-example
is it smart enough to know how to run within the directory?
Futher questions but enumerated
For 20% less reading!
- Can I, or rather “How do I”, generate just the
api
orweb
layers into a directory?- Or can I only scaffold a full project then go delete happy?
- Can I use
yarn rw
to manage any given directory?- If that directory is, say, an
api
directory is it possible to change that name are there adverse effects?
- If that directory is, say, an
- Can I have multiple APIs point to the same DB?
- If so what are the best practices here? I would imagine having a single backend that handles the creation, migration & seeding and all other APIs can interact with it but do not manage the schema in any way.
- Is there anything special that needs to be handled if I were to deploy each layer separately?
`? Same for packages or serverless. Breaking apart the layers also allows separate builds and deploys which are required.
I’m interested in breaking apart the layers into different areas and each may be different Redwood
managed directory. Breaking up the layers but also still being able to use yarn redwood
as the tool to create components, pages, layouts etc but ONLY for that directory. Running yarn redwood generate page home /
in ./apps/blog
would create that page but soley in ./apps/blog
.