<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="23883" data-post-id="23883">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="gdub01" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/gdub01/120/3939_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  gdub01
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks! This is awesome to hear how you’re doing it with graphql.</p>
<p>So instead of the web app forwarding all requests to /api to the graphql app schema, you have 2 ports open, one for web, one for the graphql app?</p>
<p>I was thinking about 1 phoenix app for web concerns. But it seems there’s actually 2 concerns: displaying presentation layer… and routing with plugs/processing: webhooks, api, oauth, static content/spa routes.</p>
<p>Sounds like you’ll have 1 graphql app for the api, 1 web app for static content, 1 to be built for webhooks. And you may/may not build one for oauth. So you’ll have 3+ ports open I guess?</p>
<p>Out of curiousity, do your graphql resolvers check permissions, or do your services?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="23883" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-23883" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="23883"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="23885" data-post-id="23885">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hlx" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hlx/120/2572_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hlx
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The <code>web</code> app is an Phoenix app that will handle the backend and the storefront. I might split it up into 2 separate apps but I’ll figure that out later.</p>
<p>The <code>api</code> app will handle all the api traffic and like <code>web</code> will use the <code>core</code> app for the persistence, lookup and other domain logic.</p>
<p>Webhooks will be built later but most likely will be a separate app with Plug and Cowboy.</p>
<p>Regarding ports, I’m using NGiNX to reverse proxy multiple domains to the apps.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">server {
  listen       80;
  server_name  myapp.com;

  location / {
    proxy_pass http://127.0.0.1:5000;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
  }
}
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="23885" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-23885" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="23885"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="23895" data-post-id="23895">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="peerreynders" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/120/5826_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  peerreynders
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Pardon my ignorance but is there a technical reason for for adopting this type of organization:</p>
<pre><code>inventory
        ├── authorizers
        │   ├── collection_authorizer.ex
        │   ├── permalink_authorizer.ex
        │   ├── variant_authorizer.ex
        │   └── product_authorizer.ex
        ├── models
        │   ├── collection.ex
        │   ├── image.ex
        │   ├── permalink.ex
        │   ├── price.ex
        │   ├── product.ex
        │   ├── stock.ex
        │   └── variant.ex
        ├── repositories
        │   ├── collection_repository.ex
        │   ├── permalink_repository.ex
        │   ├── variant_repository.ex
        │   └── product_repository.ex
        ├── uploaders
        │   └── image_uploader.ex
        ├── collection_service.ex
        │── permalink_service.ex
        │── variant_service.ex
        └── product_service.ex
</code></pre>
<p>rather than something like this</p>
<pre><code>inventory
        ├── collection_service
        │   ├── collection.ex
        │   ├── collection_authorizer.ex
        │   ├── collection_repository.ex
        │   └── collection_service.ex
        │── permalink_service
        │   ├── permalink.ex
        │   ├── permalink_authorizer.ex
        │   ├── variant_repository.ex
        │   └── permalink_service.ex
        │── variant_service
        │   ├── variant.ex
        │   ├── variant_authorizer.ex
        │   ├── variant_repository.ex
        │   └── variant_service.ex
        └── product_service
            ├── product.ex
            ├── product_authorizer.ex
            ├── product_repository.ex
            └── product_service.ex
</code></pre>
<p>Seems the organizing principle is to put “like” things into the same place rather than “putting everything to deal with subject area X” into the same place. One of the starting points described by the article that I linked to earlier - <a href="http://blog.carbonfive.com/2016/11/01/bring-clarity-to-your-monolith-with-bounded-contexts/" rel="noopener nofollow ugc">Bring clarity to your monolith with Bounded Contexts</a> - is to “<em>Invert folder structures into a flat domain-oriented grouping</em>”.</p>
<p>The organizing principle of “putting like things into the same place” that ultimately is responsible for “a Rails app always looking like a Rails app” (and not communicating the actual <em>intent</em> behind the web app) is what inspired <a href="https://youtu.be/hALFGQNeEnU" rel="noopener nofollow ugc">Architecture: The Lost Years (Ruby Midwest 2011 Keynote)</a>. That type of organization is rarely helpful in revealing the emerging (context) boundaries as the application matures (Evans, DDD p.48: “<em>…crucial discoveries always emerge during the design/implementation effort</em>”).</p>
<p>FYI: for anyone interested: <a href="http://domainlanguage.com/ddd/reference/" rel="noopener nofollow ugc">Eric Evans: DDD Reference (PDF 2011)</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="23895" data-batch-url="/posts/batch_likers">
                        9
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-23895" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="23895"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="23896" data-post-id="23896">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hlx" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hlx/120/2572_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hlx
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s a matter of preference I guess. I’ll take a look at the links, thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="23896" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-23896" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="23896"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="24160" data-post-id="24160">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="pedroassumpcao" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pedroassumpcao/120/996_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  pedroassumpcao
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I like this approach a lot and I have similar situation with separation between Core (finishing), API (in parity with core) and Web (still to be done). It really helps the design phase not just implementation or maintenance.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24160" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-24160" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24160"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="24500" data-post-id="24500">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="StevenXL" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/StevenXL/120/886_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  StevenXL
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for putting all these resources together in one post.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="24500" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-24500" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="24500"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="28784" data-post-id="28784">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="hlx" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hlx/120/2572_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  hlx
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’m trying a similar approach to the one you suggested and I’m liking it so far</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">.
├── apps
│   ├── core
│   │   ├── README.md
│   │   ├── config
│   │   │   ├── config.exs
│   │   │   ├── dev.exs
│   │   │   ├── prod.exs
│   │   │   └── test.exs
│   │   ├── lib
│   │   │   ├── core
│   │   │   │   ├── account
│   │   │   │   │   ├── organization
│   │   │   │   │   │   ├── organization.ex
│   │   │   │   │   │   ├── organization_authorizer.ex
│   │   │   │   │   │   ├── organization_repository.ex
│   │   │   │   │   │   └── organization_service.ex
│   │   │   │   │   ├── sales_channel
│   │   │   │   │   │   ├── sales_channel.ex
│   │   │   │   │   │   ├── sales_channel_authorizer.ex
│   │   │   │   │   │   ├── sales_channel_repository.ex
│   │   │   │   │   │   └── sales_channel_service.ex
│   │   │   │   │   ├── shop
│   │   │   │   │   │   ├── shop.ex
│   │   │   │   │   │   ├── shop_authorizer.ex
│   │   │   │   │   │   ├── shop_repository.ex
│   │   │   │   │   │   └── shop_service.ex
│   │   │   │   │   └── user
│   │   │   │   │       ├── user.ex
│   │   │   │   │       ├── user_authorizer.ex
│   │   │   │   │       ├── user_repository.ex
│   │   │   │   │       └── user_service.ex
│   │   │   │   ├── inventory
│   │   │   │   │   ├── collection
│   │   │   │   │   │   ├── collection.ex
│   │   │   │   │   │   ├── collection_authorizer.ex
│   │   │   │   │   │   ├── collection_repository.ex
│   │   │   │   │   │   └── collection_service.ex
│   │   │   │   │   └── product
│   │   │   │   │       ├── product.ex
│   │   │   │   │       ├── product_authorizer.ex
│   │   │   │   │       ├── product_repository.ex
│   │   │   │   │       └── product_service.ex
│   │   │   │   ├── application.ex
│   │   │   │   ├── publisher.ex
│   │   │   │   └── repo.ex
│   │   │   └── core.ex
│   │   ├── mix.exs
│   │   ├── priv
│   │   │   └── repo
│   │   │       ├── migrations
│   │   │       │   └── ( ... )
│   │   │       └── seeds.exs
│   │   └── test
│   │       ├── account
│   │       │   ├── organization
│   │       │   │   ├── organization_authorizer_test.exs
│   │       │   │   ├── organization_repository_test.exs
│   │       │   │   └── organization_test.exs
│   │       │   ├── sales_channel
│   │       │   │   ├── sales_channel_authorizer_test.exs
│   │       │   │   ├── sales_channel_repository_test.exs
│   │       │   │   └── sales_channel_test.exs
│   │       │   ├── shop
│   │       │   │   ├── shop_authorizer_test.exs
│   │       │   │   ├── shop_repository_test.exs
│   │       │   │   └── shop_test.exs
│   │       │   └── user
│   │       │       ├── user_authorizer_test.exs
│   │       │       ├── user_repository_test.exs
│   │       │       └── user_test.exs
│   │       ├── inventory
│   │       │   ├── collection
│   │       │   │   ├── collection_authorizer_test.exs
│   │       │   │   ├── collection_repository_test.exs
│   │       │   │   └── collection_test.exs
│   │       │   └── product
│   │       │       ├── product_authorizer_test.exs
│   │       │       ├── product_repository_test.exs
│   │       │       └── product_test.exs
│   │       ├── support
│   │       │   ├── entity_case.ex
│   │       │   ├── factories
│   │       │   │   ├── account
│   │       │   │   │   ├── organization_factory.ex
│   │       │   │   │   ├── sales_channel_factory.ex
│   │       │   │   │   ├── shop_factory.ex
│   │       │   │   │   └── user_factory.ex
│   │       │   │   └── inventory
│   │       │   │       ├── collection_factory.ex
│   │       │   │       └── product_factory.ex
│   │       │   ├── factory.ex
│   │       │   └── repository_case.ex
│   │       └── test_helper.exs
│   └── web
│   └── api
├── config
│   └── config.exs
├── mix.exs
├── mix.lock
└── pbcopy
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="28784" data-batch-url="/posts/batch_likers">
                        4
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-28784" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="28784"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="144207" data-post-id="144207">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="atal421" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  atal421
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/hlx" rel="nofollow">@hlx</a> it’s been some time since your response. how are you liking this design choice? <a class="mention" href="/u/peerreynders" rel="nofollow">@peerreynders</a> do you have any code on github we could take a closer look at? (first impression is: looks amazing)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="144207" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/domain-driven-design-diagram-for-umbrella-app/3620/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-144207" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="144207"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>