Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
offline/migrations
src
.env.example
.gitignore
README.md
jest.setup.js
package-lock.json
package.json
serverless.yml

README.md

Quadratic Voting API

Functions

Create new election

Input:

{
  "owner": "uuid-user",
  "config": {
    "name": "Name of vote",
    "budget": 99,
    "private": true,
    "notifyInvites": true,
    "invite": [
      {
        "name": "Person A",
        "email": "persona@gmail.com"
      },
      {
        "name": "Person B",
        "email": "personb@gmail.com"
      }
    ]
  },
  "candidates": [
    {
      "title": "Decision 1",
      "description": "Long description 1"
    },
    {
      "title": "Decision 2",
      "description": "Long description 2"
    }
  ]
}

Get status of a election

Output:

{
  "id": "uuid-election",
  "owner": "uuid-user",
  "config": {
    "name": "Name of vote",
    "budget": 99
  },
  "candidates": [
    {
      "title": "Decision 1",
      "description": "Long description 1"
    },
    {
      "title": "Decision 2",
      "description": "Long description 2"
    }
  ],
  "votes": [
    {
      "voter": "uuid-user",
      "votes": [
        {
          "decisionId": 1,
          "vote": 2
        },
        {
          "decisionId": 2,
          "vote": 2
        }
      ]
    }
  ]
}

Cast votes

Input:

{
  "voter": "uuid-user",
  "election": "uuid-election",
  "votes": [
    {
      "candidate": 0,
      "vote": 2
    },
    {
      "candidate": 1,
      "vote": 0
    }
  ]
}

Dynamodb

The development environment uses serverless-dynamodb-local to emulate the dynamodb in AWS.

Install dynamodb locally

sls dynamodb install

Start dynamodb

sls dynamodb start
You can’t perform that action at this time.