dwyl / dwyl/app

SPIKE: Presence - automatically display who is online

Open
#255 2 comments 4 reactions 0 assignees View on GitHub
discuss enhancement help wanted spike technical
Dominant language
Dart
Stars
152
Forks
22
PR merge metrics
No merged PRs in 30d

Description

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 ["**O**ne **T**rick **P**ony"](https://github.com/dwyl/technology-stack/issues/74)_) handling many concurrent connections effortlessly. 🚀

# _Objectives_

Our key objectives are:
+ [ ] Learn how to use Phoenix Presence in the context of a simple App where it makes sense: Chat.
+ [ ] Capture as much of the learning as possible so that we can re-use it in the @dwyl app
(_there are **many** features where **presence** is useful in our app when we add "teams"_)
+ [ ] Practice some Elm with Elm-UI and _ship_ an example that appeals to _both_ Elixir + Elm devs!

# Todo

+ [ ] _Extend_ the Phoenix Chat Example https://github.com/dwyl/phoenix-chat-example to include Auth and ***`Presence`*** so that we can see a list of the Avatars of the people who are online/offline.
+ [ ] Create a **`people`** schema and **`session`** controller similar to what we have in the [MVP](https://github.com/dwyl/app-mvp-phoenix/pull/24)
+ [ ] Add Google Auth with https://github.com/dwyl/elixir-auth-google
+ [ ] Save Profile to **`people`** table so that we can display **`person.picture`** in UI.
+ [ ] Port the UI from `JS` to `Elm` (_practice for us and a good intro to Elm for the Community_)
> We have basic Chat written in Elm: [/dwyl/hapi-socketio-redis-chat-example/elm/src/Main.elm](https://github.com/dwyl/hapi-socketio-redis-chat-example/blob/master/elm/src/Main.elm)
> Potentially useful for Phoenix<>Elm interop: https://github.com/fbonetti/elm-phoenix-socket
+ [ ] Add ***Phoenix Presence*** functionality that displays the profile of the person who is online
> There is already some code we can draw inspiration from: https://github.com/dwyl/phoenix-chat-example/pull/32
(_if possible, **merge** the PR and **temporarily break the build** to acknowledge the contribution
but we **must write tests** because the whole point of an **example** is to be **exemplary**_) ✅
+ [ ] **Write up _all_ the steps** you take in detail in a new file e.g: `google-auth-phoenix-presence.md`
The file does not have to be prosaic it can just be a list of the steps taken (_I will write it up later!_)
i.e. we aren't interested in _just_ the "_end result_" we want to know _exactly_ how it was done.
If you're in any doubt what step-by-step instructions look like, see: [/todo-list-javascript-tutorial](https://github.com/dwyl/todo-list-javascript-tutorial)
The point of a Spike1 is to _share_ the knowledge acquired with the team
(_and in our case the wider @dwyl community_)

# _Bonus Level_

+ [ ] Allow the person using the app to specify a "status", e.g: "Working on my screenplay".
+ [ ] Allow the user to select from 3 possible status:
+ "Online" (_available if you need me_)
+ "Busy" (_deep-working; only emergencies_)
+ "Offline" (_invisibility cloak_)

> _**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)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.