Git Product home page Git Product logo

flick's Introduction

Flick

Still frame from the movie Election, the character Tracy Flick is holding up a cupcake with the lettering "Pick Flick" across the icing.

Flick is an in-progress side project that aims to provide a simple web app, built using Elixir and Phoenix LiveView, that will to provide a tools to build and capture ranked voting.

Specifically this project is being constructed to help the Elixir Book Club pick books.

Standard Phoenix Info

To start your Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

Ready to run in production? Please check our deployment guides.

Learn more

flick's People

Contributors

zorn avatar

Stargazers

Kotaro Fujita avatar

Watchers

 avatar  avatar

flick's Issues

Research interest in alterantive UI for ranked voting.

I built out the vote UI using a more standard top-down form, and I think that works pretty well.

When I researched ranked voting, I found this UI, which might make more sense, but I'm just going to capture this idea here for future consideration.

Ranked-Choice-Voting-How-to-fill-in-ballot-646205267

Inline editing of `weight` should have red outlined input when invalid.

When a user is editing the weight and an invalid value is present, we should render the input with a red outline.

Right now, it does not work like this because we are avoiding the CoreComponents input component due to that having spacing expectations that do not make sense here.

Screenshot 2024-08-13 at 8 59 51 PM

Additionally, I'd like to replace Save and Cancel with checkbox and X small icon buttons. Might be related to this work. Long term I think this should be a dedicated component.

Breadboard vote tally and general user flow.

Up to now, I've been mostly tinkering on the domain. I need to spend some time on the user experience.

Do a breadboard for the full user path (to spark ideas to enhance current ballot creation and vote capture pages) as well as to define what the vote tally page should look like.

Add editable by admin, vote weight

Defaults to 1.0 and is editable by the admin.

Allows the admin to boost the value of individual voters. For our book club we boost the votes of regular attendees.

Consider pure SQL query to generate vote report.

The first pass at the vote report is done in memory. I attempted to do this in SQL but did not figure it out.

def get_vote_report(ballot_id) do
ballot = get_ballot!(ballot_id)
answers = Ballot.possible_answers_as_list(ballot.possible_answers)
votes = list_votes_for_ballot_id(ballot_id)
reports =
Enum.reduce(answers, [], fn answer, acc ->
answer_report = %{
value: answer,
points: points_for_answer_in_votes(votes, answer)
}
[answer_report | acc]
end)
reports
|> Enum.sort(&(&1.value <= &2.value))
|> Enum.sort(&(&1.points >= &2.points))
end

I think this solution is acceptable for now, but ideally, I would come up with a pure SQL solution.

Revisit `map()` type for `attrs` function argument in `Ballots.create_ballot/2`.

With the work I am doing in #1 I am allowing for a very soft attrs type of map().

I'd prefer this type to be more specific, BUT since the payload is very dynamic and the keys I need to accept are strings, I'm not sure how to best approach this, and so I'm noting the concern here to come back to it.

  ballot_params #=> %{
    "questions" => %{
      "0" => %{"_persistent_id" => "0", "title" => "12"},
      "1" => %{"_persistent_id" => "1", "title" => "34"}
    },
    "questions_drop" => [""],
    "questions_sort" => ["0", "1"],
    "title" => "Lunch Survey123"
  }

Consider ways to DRY up validation tests.

Currently, we repeat many validation tests across create_* and update_* function tests.

We should try to figure out a better pattern to validate these validations across both functions.

Screenshot 2024-07-28 at 4 06 26 PM

Create ability to capture a ranked vote for a ballot

Users should be able to see a ballot page and then provide a ranked vote for each answer option.

We are not going to do anything with the ranked votes in this branch, just capture them somewhere.

Sample:

What pizza topping do you want (we can only have one):

  • Pepperoni
  • Sausage
  • Mushrooms
  • Anchovies

A user could provide a ranked vote recording

1st pref: Sausage, 2nd pref: Pepperoni , 3rd pref: Mushrooms, 4th pref: Anchovies

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.