Code Monkey home page Code Monkey logo

elections's Introduction

Elections Stories in Ready  David

A modern platform for managing elections, designed specifically for GM Week and other student government elections at RPI.

Features

  • Simpler nominations
  • Accessible candidate and party information
  • Modern web goodness

Deployment

This website is built in a modified MEAN stack (MariaDB, Express.js, Angular.js, and Node), and can be deployed using the following steps:

  1. Clone this git repository by running the following command in a Git-enabled terminal:

    • > git clone https://github.com/wtg/elections.git
  2. Navigate into the directory of the application:

    • > cd elections
  3. If Node is installed on your computer, skip this step.

    • Install Node here.
  4. Install all necessary dependencies by running the following commands:

    • > npm install
  5. If MySQL is installed on your computer, skip this step. Install MySQL or MariaDB (the open-source equivalent).

  6. Make a copy of devconfig.example.js and name it devconfig.js. Provide details about the database connection (host, port, username, password), as shown in the example.

    • This could be completed in the terminal by running: > cp devconfig.example.js devconfig.js
    • Blank configuration variables are provided in the file.
  7. Run the server: npm start. This command will also create the database for the site if it doesn't currently exist.

Note: if NODE_ENV is "production", npm start will serve static files from the dist folder, which you can have Webpack build by running npm run build. If NODE_ENV is "development", npm start will automatically run Webpack and serve assets from memory.

  1. Navigate to localhost:3000 in your browser, and pat yourself on the back—your instance is deployed.

Credits

This project was created by the Web Technologies Group.

Developers

The core development team consists of:

A list of all contributors can be found here.

elections's People

Contributors

justetz avatar kochman avatar jzblee avatar rickrizzo avatar draab avatar ddbruce avatar jlyon1 avatar evanlazaro avatar garoller avatar machay avatar

Stargazers

 avatar  avatar Raymond Jacobson avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar Zach Love avatar Hannah Lim avatar  avatar  avatar

elections's Issues

bin/testdata cannot find db.js

Line 7 of bin/testdata looks for a db.js file that doesn't exist:

var connection = mysql.createConnection(require('../db.js'));

Profile page

  • Candidates (signed in) can enter personal information, a photo, social media, etc
  • Anyone can see a candidate’s nominations, party affiliation, candidate assistants, and other pertinent information about the candidate

Sanctions view

Create a view where sanctions, warnings, and violations are listed. They will have an associated candidate, and will have a text and a category. Admins will be able administer, edit, and delete sanctions, but they will be publicly accessible.

Party page

Where students can see what candidates are in that party, show a party platform, and (maybe?) a party photo

Calendar page

Where RnE can enter dates for informational sessions, voting day, and other events that’ll occur during the race

Nominations entering

  • Allow for members of the Rules and Elections Committee for manual entry
  • Allow for candidates to open an page where students can enter their RINs and initials, kiosk style.

Election archives

Past elections should be viewable. The site should preserve and make accessible the information that was entered during elections.

Rules page

For the elections handbook. Should be entered in as text for table of contents and so that students can search through it

Image uploads

The site needs a system for photo uploads: every user can upload two images - profile image and cover image.

The desired flow would be:

  1. user uploads image
  2. the filename is changed the randomly generated value, and stored in public/usr_content/
  3. the randomly generated filename is subsequently added as new row of an images table, with an image_id and filename
  4. the image_id is added to the candidate_data row for the candidate, as profile_photo or cover_photo, appropriately.

Sessions should be stored persistently

Right now they're stored in memory, which means everyone gets logged out whenever the server is restarted. They should be stored in a database or something similar.

Offices / Races page

Where students can see who’s running for what positions, and see specifications / requirements for each position.

One-time image downloads

Candidate images are currently hosted by third-parties and simply linked to. Once the image upload system is in place, we should initiate a one-time download of linked images and insert them into the site as if they were uploaded. This will ensure that they will be accessible even if the links stop working in the future.

Email and site notifications

Create an automated, candidate-customizable notification system for candidates: either by email, visible on the site, or both.

Notifications could include:

  • Nominations added
  • Candidate assistant added
  • New AMA question posted
  • New contact (changing contact from a mailto link to a form)

Manual override nomination

User should enter the desired amount to set the nominations to, which would override the nominations table, regardless if nominations are added for the candidate through the table subsequently

Ensure office categories are taken into account for nominations

Needs to match the office type:

  • "All offices" -- any student can nominate
  • <year> -- only that year (either by credit or by entry), and coterminal students when they're senior candidates can nominate
  • "Graduate" -- only graduate students and coterminal students can nominate
  • "Greek" -- only greek students can nominate
  • "Independent" -- only greek students can nominate

Random candidate API endpoint incorrectly returning empty list

/api/candidates/random occasionally returns an empty list instead of a random candidate even when there are valid candidates to return. I think the issue is that candidates for inactive elections are not filtered out until after a random candidate ID is chosen by the backend.

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.