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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Writing my master’s thesis, where I implemented a Phoenix API, connecting geospatial data and a Vue.js frontend.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200591" 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/what-elixir-related-stuff-are-you-doing/113/553">Post #552</a>
	                </div>
	            </div>
              <div id="likers-container-200591" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200591"
                     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 #552"></div>
  </section>
</div>
    <div class="postbit" id="200776" data-post-id="200776">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What kind of information are you looking for? I’m looking to adopt LiveView soon.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200776" 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/what-elixir-related-stuff-are-you-doing/113/554">Post #553</a>
	                </div>
	            </div>
              <div id="likers-container-200776" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200776"
                     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 #553"></div>
  </section>
</div>
    <div class="postbit" id="200779" data-post-id="200779">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey! Several basic things like authenthication, the transition between classic Phoenix templates and LiveView, the routing and redirects between these. Also regarding questions like ,When to use LiveView"?</p>
<p>Do you have a special project you want to migrate?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200779" 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/what-elixir-related-stuff-are-you-doing/113/555">Post #554</a>
	                </div>
	            </div>
              <div id="likers-container-200779" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200779"
                     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 #554"></div>
  </section>
</div>
    <div class="postbit" id="200782" data-post-id="200782">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>No project I want to migrate. It seems painful to leave the well trodden frontend world so far - all for my company’s work. Heh, trying to push a full stack Elixir microservice (both FE and BE).</p>
<p>When you find your answers, it’d be great to have your solutions shared. <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>
<p>Though from an outsider’s perspective, routing between LiveView and really HTML views should simply rely on anchor links - they’re all HTML pages at its simplest. But if you mean maintaining state between routing, I don’t know either.</p>
<p>When to use LiveView? I’d probably consider using LiveView for any pages that require user input to work: forms, interactions with lists and charts, etc.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200782" 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/what-elixir-related-stuff-are-you-doing/113/556">Post #555</a>
	                </div>
	            </div>
              <div id="likers-container-200782" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200782"
                     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 #555"></div>
  </section>
</div>
    <div class="postbit" id="200783" data-post-id="200783">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah I had problems to maintain the state between LiveView and clasic Phoenix templates since you use a socket in LiveView. I’m doing some babysteps to get a better understanding of these connections.</p>
<p>The question when to use LiveView is for me as Phoenix beginner harder than I thought. At first I used LiveView everywhere but my code became a mess and I had problems with the authenthication in LiveView because it was impossible to use the logged in user on my socket connection. LiveView is perfect for dynamic changes on your page. So you’re right about the interactions on the page. Forms can be in classic Phoenix but some things that really confused me was something like: Should my navigation panel be a LiveView? It’s somethings hard to determine the side effects when you use a LiveView instead of a clasic Phoenix template.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200783" 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/what-elixir-related-stuff-are-you-doing/113/557">Post #556</a>
	                </div>
	            </div>
              <div id="likers-container-200783" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200783"
                     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 #556"></div>
  </section>
</div>
    <div class="postbit" id="200788" data-post-id="200788">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="marius95" data-post="557" data-topic="113">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/m/d2c977/48.png" class="avatar"> marius95:</div>
<blockquote>
<p>I had problems with the authenthication in LiveView because it was impossible to use the logged in user on my socket connection</p>
</blockquote>
</aside>
<p>Can you be more specific ? I’ve been rewriting a large app made with NodeJS + VueJS and didn’t ran into much issues with that, it was actually easy to get it going (and i’m using LiveView almost everywhere, replacing the vast majority of what my Vue components where doing, but that depend on your needs for sure).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200788" 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/what-elixir-related-stuff-are-you-doing/113/558">Post #557</a>
	                </div>
	            </div>
              <div id="likers-container-200788" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200788"
                     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 #557"></div>
  </section>
</div>
    <div class="postbit" id="200790" data-post-id="200790">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey! Yes of course <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>
<p>So my initial problem was to get the currently logged in user inside LiveView. I use Pow for the authentication stuff and the Pow templates are classic Phoenix templates. Since my project was 100% LiveView I hadn’t any controllers. Therefore I couldn’t retrieve the user from the current conn object. The function I had to use was:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Pow.Plug.current_user(conn)
</code></pre>
<p>So I rewrote a major part of my project in order to use the classic Phoenix MVC pattern with Phoenix templates and only use LiveView where I have to. Basically I call live_render inside the Phoenix template whenever I have to render a LiveView.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="200790" 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/what-elixir-related-stuff-are-you-doing/113/559">Post #558</a>
	                </div>
	            </div>
              <div id="likers-container-200790" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200790"
                     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 #558"></div>
  </section>
</div>
    <div class="postbit" id="200809" data-post-id="200809">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ah yeah ! I’ve read when i started about Pow issues with LiveView. I don’t think it’s been fixed yet (not fully anyway, but there’s an issue thread on the Github repo explaining how to make it work i believe).</p>
<p>Personally, i started by implementing my own system, based on Chris (McCord) “<a href="https://pragprog.com/titles/phoenix14/programming-phoenix-1-4/" class="inline-onebox" rel="noopener nofollow ugc">Programming Phoenix 1.4: Productive |&gt; Reliable |&gt; Fast by Chris McCord, Bruce Tate and José Valim</a>” book. What quite easy to make it work with LiveView (there’s a chapter about LiveView in the book, can’t remember if it talks about authentication…).</p>
<p>Following that, i started using the phx.gen.auth (<a href="https://github.com/aaronrenner/phx_gen_auth" class="inline-onebox" rel="noopener nofollow ugc">GitHub - aaronrenner/phx_gen_auth: An authentication system generator for Phoenix 1.5 applications. · GitHub</a>) project, which if i’m not mistaken, will be included in the next phoenix release (1.6). That’s a generator that adds everything you need for it to work (with every file being well documented so you can adapt to your need).</p>
<p>With that said, if you need some of the bells and whistle of Pow, you might be stuck for the moment. Though i’ve implemented my own permissions / role-based system on top of phx.gen.auth without issues, it was really simple (and well adapted to both my app and my mindset, something i’m rather picky about). So you might want to take a look at doing some of those things yourself, it’s usually not difficult, and i’ve learned a lot about it (Elixir, Phoenix, LiveView…) doing it this way.</p>
<p>To be noted that <a class="mention" href="/u/mikeclark" rel="nofollow">@mikeclark</a> (and his wife)  have a LiveView course who just came out and has a part (over there → <a href="https://pragmaticstudio.com/phoenix-liveview" class="inline-onebox" rel="noopener nofollow ugc">LiveView Course | The Pragmatic Studio</a>) explaining how to handle authentication with LiveView. I haven’t yet bought that one, but i’ve got some of their other courses, always great, cannot recommend enough <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" 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="200809" 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/what-elixir-related-stuff-are-you-doing/113/560">Post #559</a>
	                </div>
	            </div>
              <div id="likers-container-200809" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200809"
                     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 #559"></div>
  </section>
</div>
    <div class="postbit" id="200811" data-post-id="200811">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here’s what I use:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def get_user(socket, %{"token_auth" =&gt; signed_token}, config) do
    conn = struct!(Plug.Conn, secret_key_base: socket.endpoint.config(:secret_key_base))
    salt = Atom.to_string(Pow.Plug.Session)

    with {:ok, token} &lt;- Pow.Plug.verify_token(conn, salt, signed_token, config),
         {user, _metadata} &lt;- CredentialsCache.get([backend: @pow_store_backend], token) do
      user
    else
      _any -&gt; nil
    end
  end

  def get_user(_, _, _), do: nil
</code></pre>
<p>I call this from a <code>mount_defaults</code> function that is called in all the LiveViews’s <code>mount</code> callback.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def mount_defaults(socket, session) do
    socket
    |&gt; assign(:current_user, Credentials.get_user(socket, session))
  end
</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="200811" 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/what-elixir-related-stuff-are-you-doing/113/561">Post #560</a>
	                </div>
	            </div>
              <div id="likers-container-200811" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200811"
                     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 #560"></div>
  </section>
</div>
    <div class="postbit" id="200813" data-post-id="200813">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hey yeah I know these resources. I’ve bought every pragmatic programmer Elixir book + the ebooks and I read almost everyday in them. Especially Programming Ecto and Phoenix <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p>
<p>I really liked how well tested and the functionality of Pow so I tried to use it. I’m also using a role based system. With the gained knowledge from the last months, I would definitely change a few things but this is always the case <img src="https://forum.elixirforum.com/images/emoji/apple/smiley.png?v=15" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20"></p>
<p>I really enjoy <a class="mention" href="/u/mikeclark" rel="nofollow">@mikeclark</a> and his wifes work. I bought the Elixir course bundle last november and they were awesome. I’m currently working through the LiveView Pro Course and I’m at the testing path. Then I’ll throw an eye on their authenthication <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="200813" 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/what-elixir-related-stuff-are-you-doing/113/562">Post #561</a>
	                </div>
	            </div>
              <div id="likers-container-200813" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="200813"
                     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 #561"></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/113/load_more?page=56">Load more posts (367 remaining)</a>
</div></template></turbo-stream>