Coder Social home page Coder Social logo

anish-agnihotri / quadratic-voting Goto Github PK

View Code? Open in Web Editor NEW
91.0 6.0 32.0 1.66 MB

Real-time Quadratic Voting dashboard to encourage mathematically optimal voting in democratic communities.

Home Page: https://quadraticvote.co

License: GNU Affero General Public License v3.0

JavaScript 100.00%
quadratic-voting democracy voting

quadratic-voting's Introduction

Quadratic Voting (live)

Open-source, real-time QV dashboard.

Quadratic Voting is the mathematically optimal way to vote in a democratic community, where votes express the degree of your preferences, not just direction. This calculator is an open-source voting application, with development supported by Gitcoin, and is a counterpart to the Quadratic Funding Calculator.

Architecture

This application is built atop

  1. Front-end: NextJS (React)
  2. Back-end: NodeJS + Express serverless functions deployed on Vercel
  3. Database: PostgreSQL + the Prisma DB toolkit

At a fundamental level, the way in which voting links are generated and sessions are handled is kept simple:

  1. An events table keeps track of open voting events. Each event has a secret_key (uuid) to manage the event.
  2. A voters table keeps track of all voters and their preferences. Each voter has a id (uuid) that together with the event_uuid (uuid) represents their unique voting URL.

Important files:

  1. prisma/schema.sql contains the SQL schema for the application.
  2. pages/api/events/details.js contains the QV calculation logic.

Run locally / redeploy

  1. Setup your PostgreSQL database
# Import schema
pg:psql -f prisma/schema.sql
  1. Setup environment variables. Copy prisma/.env.sample to prisma/.env and replace DATABASE_URL with your PostgreSQL DB url.

  2. Run application

# Install dependencies
yarn

# Run application
yarn dev

License

GNU Affero General Public License v3.0

quadratic-voting's People

Contributors

anish-agnihotri avatar erichfi avatar richardlitt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

quadratic-voting's Issues

Custom option input for voters

Feature Request:

(1) Instead of a fixed number of options, let voters add their own.
(2) Optionally, let future voters see the added options of previous voters

Example:

Title: What should we eat today?

Voters can then add options like

  • Panna Cotta
  • Strawberry
  • Pizza

on the voting page and quadratically vote for them

Pimp Description field

Thank you for this tool! it is so neat and clean.

I as a user would be even more satisfied if the Description field gave me the possibility to use

  • html (embeddable images/videos)
    or a
  • markdown+img uploader

just

No license?

There is no license file in this repo. Is it intended to be open source? If so, it's a good idea to put one in as early as possible, so you don't need to contact all contributors for relicensing later :)

My personal recommendation for whole applications would be AGPL (see https://choosealicense.com/licenses/agpl-3.0/).

Thanks!

Add Interpretation Text to Results Table

Hi! It would be really helpful to help people understand the results table. For example, should they look at the green bars or the blue bars? What does the gap between an items blue and green bars mean?

Love the tool!

Allow participants to have different amounts of voting tokens

One of the more interesting things about quadratic voting is its ability to integrate different voting powers. My question:

  • Would it be possible to create different roles for events, where each role can obtain a different amount of voting tokens.
  • This would be an excellent tool to integrate things like seniority into the voting process...

Results don't display all voting options

I have a vote with over 90 options. The results screen is not displaying all of the items. Can you expand the image size or allow us to dump the results to a csv file or something? I'm trying to use this tool to help the City of Pearland, Texas prioritize it's budget requests by June 1st. Thanks!

Stale repository?

Hi @Anish-Agnihotri, i see that this repository hasn't been updated since December 2020.
Are you still maintaining this?

If not, do you think you would be willing to add additional maintainers to this repository?
I am looking to rely quadraticvote.co for frequent large votes for an org and would love to see this project maintained for the long-term ๐Ÿ˜ƒ

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.