Fork me on GitHub
#polylith
<
2021-09-19
>
ivangalbans15:09:21

hi everyone in a polylith architecture is it considered bad practice to have two projects that use the same database? I was thinking of having bases/rest-api and bases/graphql-api and a project for each one where the database is the same WDYT ?

2
furkan3ayraktar16:09:43

That is totally good. We have more than two projects that use the same database.

ivangalbans16:09:41

great, thanks a lot

👍 2
ivangalbans17:09:19

hi again 🙂 when I create a component with poly create component name:name, the resources directory is the only one that is not created with top-namespace, should it be created with the same src and test structure ?

$ poly info

Warning 205: Non top namespace name was found in name.
resources/name/config.clj --> no top-namespace (throw Warning 205) src/{top-namespace}/name/interface.clj --> top-namespace test/{top-namespace}/name/interface_test.clj --> top-namespace if I modify it to the same src and test structure using the top-namespace the warning disappears

2
tengstrand18:09:55

The rule is to not put source code (files ending with .cljor .cljc) in the resources directory. The only exception is described in https://github.com/polyfy/polylith/issues/129 issue. I would recommend you putting the config.clj under the src directory. To make sure files under resources don’t collide with other resources directories, they are put under a sub directory, e.g. resources/invoicer where invoicer in this example is the component’s interface name.

ivangalbans18:09:00

got it - thanks a lot gratitude

👍 2