Skip to content

Latest commit

 

History

History
158 lines (98 loc) · 2.61 KB

Etherchat.md

File metadata and controls

158 lines (98 loc) · 2.61 KB

footer: Steve Freeman - @[email protected] - github.com/loteks

Etherchat

Adventures in Irritation Driven Development h/t to Eddie Lay




I have over 500 logins stored in 1Password. Only maybe twenty of them are for banks or paid services where a user account is actually necessary.




In many cases I simply wanted to look at something and then never visited that website again, leaving behind a useless account linked to my email.




This project questions this design assumption and explores an alternative approach.




What features do users expect from user accounts?

  • privacy - my chats are my own
  • sharing - sharing is my choice



How are these features provided by existing services that don't have user accounts?




How can we provide these features in Phoenix LiveView?

  • privacy - a random string generator for new pages
  • sharing - Phoenix PubSub



Controller code to generate a random page

def home(conn, _params) do
    chat = MnemonicSlugs.generate_slug(3)
    redirect(conn, to: "/#{chat}")
end



Then put the live page first in the router

live("/:chat", ChatLive)
get("/", PageController, :home)



Code to allow the user to create a new random page

push_navigate(socket, to: "/", replace: true)



Code to allow the user to create a custom page

new_page = URI.encode_www_form(custom)
push_navigate(socket, to: "/#{new_page}", replace: true)



This project, powered by ChatGPT, is designed as an AI coding assistant with Phoenix PubSub providing real-time sharing for pair programming.




And having no requirement for user accounts makes using it friction free.




Advantages and disadvantages of Phoenix LiveView




Phoenix PubSub makes real-time sharing relatively simple, 3 lines of code, where similar functionality in Etherpad requires more complex crdts.




The static front page of an Etherpad site helps to make the intended usage clear to the user. The LiveView single page architecture requires more attention to UI design.




Project site -> https://etherchat.net

Project repo -> github.com/loteks/etherchat

Etherpad demo -> https://indiepad.net




Many thanks to Brooklin and all my Cohort peeps :)