<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="97528" data-post-id="97528">
  <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">
								<aside class="quote no-group quote-post-not-found" data-username="bulldog_in_the_dream" data-post="13" data-topic="16671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/58956e/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/domain-oriented-web-folder-structure/16671/13" rel="nofollow">Domain-oriented web folder structure</a></div>
<blockquote>
<p>Rails popularized the MVC architecture — but Rail’s version is in many ways a misreading/reconceptualization of the original proposal [1, 2].</p>
</blockquote>
</aside>
<p>To elaborate:</p>
<p>MVC has been subject to re-interpretation over the years - almost to the point of meaninglessness. The web model (<em>Server MVC</em>) goes back to the <a href="http://www.kirkdorffer.com/jspspecs/jsp092.html#model" rel="noopener nofollow ugc">JSP Model 2 Archtecture (1998)</a> - and really only has a vague resemblance to the <em>pattern</em> outlined in 1979 by Trygve Reenskaug.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/2X/f/f4e6753587b570a7dbb50055b123f461beb27e16.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/f4e6753587b570a7dbb50055b123f461beb27e16" title="model2" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/2X/f/f4e6753587b570a7dbb50055b123f461beb27e16.jpeg" alt="model2" data-base62-sha1="yWufTNEPvLiPqCBKv014b8RZw1M" width="540" height="260"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">model2</span><span class="informations">540×260 15.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p><a href="https://paulhammant.com/2015/04/29/mvc-misunderstood-for-37-years/" rel="noopener nofollow ugc">MVC: misunderstood for 37 years</a><br>
<a href="https://givan.se/mvc-past-present-and-future/" rel="noopener nofollow ugc">MVC past, present and future.</a><br>
<a href="https://mvc.givan.se/%5D" rel="noopener nofollow ugc">MVC Tree</a></p>
<p><a href="http://wiki.c2.com/?WhatsaControllerAnyway" rel="noopener nofollow ugc">Whats a Controller Anyway?</a></p>
<p><a href="https://www.amazon.com/Pattern-Oriented-Software-Architecture-System-Patterns/dp/0471958697" rel="noopener nofollow ugc">POSA1</a> gets into Trygve’s MVC and describes the distribution of responsibilities as :</p>
<p>View:</p>
<ul>
<li>Creates and initializes it’s associated controller (***)</li>
<li>Displays information to the user</li>
<li>Implements the update procedure (***)</li>
<li>Retrieves data from the model  (***)</li>
</ul>
<p>Model</p>
<ul>
<li>Provides functional core of the application</li>
<li>Registers dependent views and controllers</li>
<li>Notifies dependent components about data changes</li>
</ul>
<p>Controller</p>
<ul>
<li>Accepts user inputs as events</li>
<li>Translates events to service requests for the view</li>
<li>Implements the update procedure, if required</li>
</ul>
<p>In Server MVC the <em>View</em> looses a lot of responsibilities (***) - i.e. it is comparatively anemic leading typically to a <a href="https://martinfowler.com/eaaCatalog/pageController.html" rel="noopener nofollow ugc">Page Controller</a>.</p>
<p>Interestingly POSA1 also identifies the <em>Document-View</em> pattern as the result of combining the View and Controller into a single component. And as a matter of fact:</p>
<aside class="quote no-group">
<blockquote>
<p>… most GUI libraries and windowing systems combined the view and controller functions in a single widget, making the logical separation into view and controller less useful. <em>Later versions of Smalltalk with operating system widgets chose <strong>not to use a separate controller</strong></em>.</p>
</blockquote>
</aside>
<p><em>Objects and the Web. Alan Knight, Naci Dai (2002)</em></p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/2X/e/e4637648bc24a0edfa7667823337d31dcd522848.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/e4637648bc24a0edfa7667823337d31dcd522848" title="18%20PM" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/2X/e/e4637648bc24a0edfa7667823337d31dcd522848_2_467x600.jpeg" alt="18%20PM" data-base62-sha1="wApXv9cAOxFzjbeTkKSht9jR20o" width="467" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/2X/e/e4637648bc24a0edfa7667823337d31dcd522848_2_467x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/2X/e/e4637648bc24a0edfa7667823337d31dcd522848_2_700x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/2X/e/e4637648bc24a0edfa7667823337d31dcd522848_2_934x1200.jpeg 2x" data-dominant-color="EFEBE9"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">18%20PM</span><span class="informations">1118×1434 95.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>POSA1 further lists under MVC <em>liabilities</em>:</p>
<aside class="quote no-group">
<blockquote>
<p><em>Intimate connection between view and controller.</em> Controller and view are separate but closely-related components, which hinders their individual reuse. It is unlikely that a view would be used without its controller, or vice-versa, with the exception of read-only views that share a controller that ignores all input.</p>
</blockquote>
</aside>
<p><strong>Point</strong>: in many situations the controller and view are so closely related they may as well be considered belonging to the same component.</p>
<p><strong>Counterpoint</strong>: What about an implementation style where <strong><em>most</em></strong> pages are composed of <em>fragment markup</em> rather than all-in-one <em>page markup</em>, most likely because you are reusing “widget skins”? In OO this would be approached with Presentation-Abstraction-Control (PAC)/Hierarchical MVC (HMVC) but in Server MVC you tend to be stuck with controllers that operate at page granularity - which <em>doesn’t</em> match the granularity of your fragment markup.</p>
<p>So depending on the implementation style one can argue both ways - and once again we arrive at the universally dreaded “it depends” (<em>on the details</em>).</p>
<p>As far as I can tell the default organization under (<code>?_web</code>) inside a Phoenix project is favouring making reuse of fragment markup between page controllers as easy as possible (whether or not there are significant opportunities for reuse (or legitimate DRY)).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97528" data-batch-url="/posts/batch_likers">
                        10
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-97528" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97528"
                     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="97583" data-post-id="97583">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="sasajuric" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/120/991_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  sasajuric
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Elixir In Action</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="bulldog_in_the_dream" data-post="13" data-topic="16671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/b/58956e/48.png" class="avatar"><a href="https://forum.elixirforum.com/t/domain-oriented-web-folder-structure/16671/13" rel="nofollow">Domain-oriented web folder structure</a></div>
<blockquote>
<p>A feature based folder structure simply divides the web context into smaller sub-contexts, still within the context of the web/presentation. The web part is still just as much focused on being the delivery mechanism.</p>
</blockquote>
</aside>
<p>I think this is a very good argument!</p>
<p>The question is is it better to have e.g. UserController and TaskController in the same folder, or would it be better to have UserController, UserView, and corresponding templates in the same folder? I currently can’t see much benefits of the former approach, and I can confirm that I’m occasionally annoyed by the current folder structure when working on the web part. I frequently find I need to navigate between separate folders, which is a bit distracting.</p>
<p>In my experience, most often I need to make changes to all the three aspects of a single entity (e.g. a User), so it seems that grouping per entity would work better for the most cases I’ve seen.</p>
<p>Personally, I’ll think about trying out the alternative approach in my next project.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97583" data-batch-url="/posts/batch_likers">
                        19
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-97583" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97583"
                     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="97588" data-post-id="97588">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Crowdhailer" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Crowdhailer/120/2438_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Crowdhailer
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Creator of Raxx</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-post-not-found" data-username="sasajuric" data-post="16" data-topic="16671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/domain-oriented-web-folder-structure/16671/16" rel="nofollow">Domain-oriented web folder structure</a></div>
<blockquote>
<p>Personally, I’ll think about trying out the alternative approach in my next project.</p>
</blockquote>
</aside>
<p>Will be keen to hear your thoughts.<br>
I have a project set up like this e.g.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">www
- sign_up.ex
- sign_up.html.eex
</code></pre>
<p>The <code>.ex</code> file contains a module that handles both the GET and POST action, so serving the sign up page and the action of signing up are co located. It has worked very well for us and allowed us to discover larger bounded contexts as  needed</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="97588" data-batch-url="/posts/batch_likers">
                        5
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-97588" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="97588"
                     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="99776" data-post-id="99776">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hi everyone,</p>
<p>As a beginner trying to figure things out, I’m also a bit puzzled by this topic. I come from Django and one of the nice things about it is that it allows to divide a project into apps that can be plugged into different projects. That allows developers to build projects by combining existing packaged apps along with their own apps. Each app bundles a data access layer (models), a web request handling layer (views) and templates. It’s a quite practical approach that has allowed a thriving ecosystem of reusable apps. I’m wondering how we could achieve similar re-usability of web projects “chunks” in Phoenix. Clearly in Django the goal of isolating the web from domain logic isn’t as strong as in Phoenix though. Because of my background, this is a concern that still seems a bit theoretical to me. I’m not judging because I’m still trying to figure things out (and certainly don’t want to add more negativity to this thread). I just thought my perspective might bring something to the debate since I understand the majority of Phoenix users tend to come from Rails.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="99776" data-batch-url="/posts/batch_likers">
                        6
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-99776" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="99776"
                     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="99843" data-post-id="99843">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Welcome!</p>
<p>I have a limited experience with Django (so a lot of what I’ll say is probably wrong) but I think it tracks with what you’re describing. Django tends to create vertical slices of functionality with its apps. That means that you can get something out of the box that encompasses the entire functionality from views to the database. Rails supported something similar in what they called engines and some libraries took advantage of them. Some people loved them but my impression around the community was that people generally didn’t use them other then by happenstance in the libraries they pulled in. The trend was for people to divide much more functionality “horizontally”. I think that trend continues in Phoenix and elixir and finding the right way to further divide those horizontals is a lot of what this conversation is about from what I can tell.</p>
<p>While there are a bunch of different ways to create re-usable bits in elixir, if you’re talking about re-usability in phoenix specifically than its important to understand that despite providing configuration for a lot of things, phoenix itself is a way to handle requests (with plug underneath), a way to render views and channels. So if you want to provide functionality for phoenix one of the easiest ways is to provide Plugs that can be added into your existing pipelines. If you want to provide a larger vertical slice of functionality then it requires more manual steps for the end user. ExAdmin might be a good example of that: <a href="https://github.com/smpallen99/ex_admin" class="inline-onebox" rel="noopener nofollow ugc">GitHub - smpallen99/ex_admin: ExAdmin is an auto administration package for Elixir and the Phoenix Framework · GitHub</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="99843" 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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-99843" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="99843"
                     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 #18"></div>
  </section>
</div>
    <div class="postbit" id="99896" data-post-id="99896">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="khaledh" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/khaledh/120/23108_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  khaledh
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Given the diversity of opinion in this thread, I don’t think there will be one <em>right</em> way of organizing code in a web context. Preference and background (django, rails, ddd, etc) will play a role in how people organize their code.</p>
<p>My understanding is that the philosophy of Elixir and Phoenix is to build a small core that can be customized for various scenarios and use cases. While the default code organization of Phoenix is oriented towards how it separates concerns (controllers, views, templates, channels), it’s still possible to transpose it to be domain-oriented. However, there a couple of issues that I found doing this: a) it’s not quite obvious how to do it, and b) the changes required felt more like a work-around rather than a supported, well-documented change.</p>
<p>I still think that a domain-oriented code organization, even in the web part of a project, is more favorable for a lot of users. The main reason is this:</p>
<aside class="quote no-group quote-post-not-found" data-username="sasajuric" data-post="16" data-topic="16671">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/sasajuric/48/991_2.png" class="avatar"><a href="https://forum.elixirforum.com/t/domain-oriented-web-folder-structure/16671/16" rel="nofollow">Domain-oriented web folder structure</a></div>
<blockquote>
<p>In my experience, most often I need to make changes to all the three aspects of a single entity (e.g. a User), so it seems that grouping per entity would work better for the most cases I’ve seen.</p>
</blockquote>
</aside>
<p>In my experience, making a change usually involves touching multiple related files across the controller and templates of the same domain (and sometimes adding/changing a function in the view). But with Phoenix’s default organization I have to keep multiple folders open in my editor and it’s quite distracting to find the files I need to change, especially when template file names look identical in most cases (index.eex, edit.eex, show.eex, etc). With domain-oriented folders I can expand one folder and make all the changes I need there.</p>
<p>To draw an analogy, imagine I’m also building a CLI for my app, and I’m using a CLI framework that by default organizes code like this:</p>
<pre><code>lib
├── app
│   ├── users
│   │   └── ...
│   └── tasks
│       └── ...
│
└── app_cli
	├── commands
	│   ├── user_command.ex
	│   └── task_command.ex
	├── args
	│   ├── user
	│   │   ├── create.ex
	│   │   ├── list.ex
	│   │   ├── show.ex
	│   │   └── update.ex
	│   └── task
	│       ├── create.ex
	│       ├── list.ex
	│       ├── show.ex
	│       └── update.ex
	└── formatters
		├── user_formatter.ex
		└── task_formatter.ex
</code></pre>
<p>This is of course hypothetical, but it’s not far-fetched. Even though the CLI framework knows where to find things in a more predictable way, it made my life harder by making me spend more effort when I need to change the command/args/formatter in a single domain. I’d organize the CLI code like this instead:</p>
<pre><code> lib
├── app
│   ├── users
│   │   └── ...
│   └── tasks
│       └── ...
│
└── app_cli
	├── users
	│   ├── user_command.ex
	│   ├── user_formatter.ex
	│   └── args
	│       ├── create.ex
	│       ├── list.ex
	│       ├── show.ex
	│       └── update.ex
	└── tasks
		├── task_command.ex
		├── task_formatter.ex
		└── args
			├── create.ex
			├── list.ex
			├── show.ex
			└── update.ex
</code></pre>
<p>Again, that’s just how I’d organize my code. I can expand one folder and focus on it when I’m making changes. Other domains can remain collapsed, keeping distraction low.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="99896" data-batch-url="/posts/batch_likers">
                        8
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-99896" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="99896"
                     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 #19"></div>
  </section>
</div>
    <div class="postbit" id="99999" data-post-id="99999">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I usually find the arguments for co-locating controllers/views/templates quite intriging, but at least for html templates I often don‘t work with a 1:1 mapping of controllers to views, but I have multiple controllers using some sometimes shared view modules, which would be harder to do if files are supposed to be in the same folder. I can see that being different for plain json api projects, though.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="99999" data-batch-url="/posts/batch_likers">
                        1
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-99999" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="99999"
                     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 #20"></div>
  </section>
</div>
    <div class="postbit" id="216056" data-post-id="216056">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Atomic design might be a solution for shared views: <a href="https://medium.com/@janelle.wg/atomic-design-pattern-how-to-structure-your-react-application-2bb4d9ca5f97" rel="noopener nofollow ugc">https://medium.com/@janelle.wg/atomic-design-pattern-how-to-structure-your-react-application-2bb4d9ca5f97</a></p>
<p>Personally I favor vertical slicing; although I usually need one ‘shared’ folder for not 1-on-1 mappings.</p>
<p>With Phoenix I too was surprised the web app was structured very different from the context based data app. Although it might have benefits, it does not seem to make the framework easier to grasp for newcomers (imho cognitive load is much higher) and some veterans also seem to like vertical slicing.</p>
<p>Next projec….nah have to finish some others first <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="216056" 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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-216056" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="216056"
                     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 #21"></div>
  </section>
</div>
    <div class="postbit" id="216058" data-post-id="216058">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>My only dog in this show it this. Theres a level of annoyance when opening up lib &gt; app folder only to find a huge list of files and a huge list of folder, I would rather in that one context have the <code>foo.ex</code> file live in the <code>foo</code> folder if only to make it easier to navigate to its related sub folder and files. I got a little ostracized at my last job pushing that agenda once.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="216058" data-batch-url="/posts/batch_likers">
                        1
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-216058" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="216058"
                     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 #22"></div>
  </section>
</div>
    <div class="postbit" id="217047" data-post-id="217047">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have to agree: as a newcomer to Phoenix, the default folder structure is quite overwhelming coming from something like Django where all apps (contexts) are cleanly separated with distinctive folders.</p>
<p>It reduces cognitive load. I might actually hack together a similar folder structure with my Phoenix app…</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="217047" data-batch-url="/posts/batch_likers">
                        1
                      </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/discussion-about-domain-orientated-folder-structures-in-phoenix/17190/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-217047" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="217047"
                     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 #23"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/17190/load_more?page=3">Load more posts (4 remaining)</a>
</div></template></turbo-stream>