dwyl / app

Clear your mind. Organise your life. Ignore distractions. Focus on what matters.
http://dwyl.github.io/app/
147 stars 22 forks source link

SPIKE: Presence - automatically display who is online #255

Open nelsonic opened 4 years ago

nelsonic commented 4 years ago

We do not yet have any collaborative or team features in our App (as we're focussing on the solo experience) however we hypothesize that capturing thoughts, securely sharing them with relevant people (e.g: team or family members) and collaborating on getting things done are the "killer features" that people/teams/orgs will be willing to pay for if we build great UX.

In fact one of our main reasons for selecting Elixir/Phoenix for building the backend of our App(s) is because OTP (Erlang's "One Trick Pony") handling many concurrent connections effortlessly. πŸš€

Objectives

Our key objectives are:

Todo

Bonus Level

Note: We cannot afford this Spike to drag on for very long, we just want to prove that it works. Please ensure you estimate the work even if it means creating a new label e.g T2d πŸ™„

1https://en.wikipedia.org/wiki/Spike_(software_development)

SimonLab commented 4 years ago

Add new Elm project to Phoenix

image

We should now have a elm.json file and a src folder in assets where our Elm code will be added

Compile Elm to js using Webpack

Phoenix is already using Webpack to create one javascript containing all the code imported in assets/js/app.js

There is a specific webpack loader for Elm: https://github.com/elm-community/elm-webpack-loader that we can use in our Phoenix project to compile and bundle the Elm application

      {
        test: /\.elm$/,
        exclude: [/elm-stuff/, /node_modules/],
        use: {
          loader: 'elm-webpack-loader',
          options: {
            optimize: true
          }
        }

Create the Elm application

To test that Elm is working well with Phoenix and webpack we can create a simple application:

main = text "This is Elm text!"

- Import the Elm application in `/assets/js/app.js`:

```js
// import Elm application
import { Elm } from "../src/Main.elm";

var app = Elm.Main.init({
  node: document.getElementById('elm-app')
})
nelsonic commented 2 years ago

https://github.com/dwyl/phoenix-liveview-chat-example#14-presence