{"id":13779486,"url":"https://github.com/webkom/vote","last_synced_at":"2025-04-15T18:42:01.828Z","repository":{"id":21124435,"uuid":"24425280","full_name":"webkom/vote","owner":"webkom","description":"🗳️ Abakus' voting system","archived":false,"fork":false,"pushed_at":"2024-10-21T14:53:56.000Z","size":9478,"stargazers_count":27,"open_issues_count":26,"forks_count":7,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-22T00:48:10.873Z","etag":null,"topics":["angularjs","hacktoberfest","mongodb","pug","svelte"],"latest_commit_sha":null,"homepage":"https://vote.abakus.no","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webkom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-24T17:33:56.000Z","updated_at":"2024-10-21T14:51:34.000Z","dependencies_parsed_at":"2023-02-14T02:16:26.366Z","dependency_job_id":"4beef771-7358-496b-a475-4c46fccc5624","html_url":"https://github.com/webkom/vote","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fvote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fvote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fvote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webkom%2Fvote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webkom","download_url":"https://codeload.github.com/webkom/vote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249131011,"owners_count":21217655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angularjs","hacktoberfest","mongodb","pug","svelte"],"created_at":"2024-08-03T18:01:05.705Z","updated_at":"2025-04-15T18:42:01.795Z","avatar_url":"https://github.com/webkom.png","language":"JavaScript","funding_links":[],"categories":["Mad science"],"sub_categories":[],"readme":"# vote [![DroneCI](https://ci.webkom.dev/api/badges/webkom/vote/status.svg?branch=master)](https://ci.webkom.dev/webkom/vote) [![Coverage Status](https://coveralls.io/repos/github/webkom/vote/badge.svg?branch=master)](https://coveralls.io/github/webkom/vote?branch=master) [![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/webkom/vote)](https://libraries.io/github/webkom/vote#dependencies) ![GitHub](https://img.shields.io/github/license/webkom/vote)\n\n\u003e Digital voting system for Abakus' general assembly\n\n![vote](https://i.imgur.com/DIMAJfj.png)\n\n## Setup\n\nvote assumes you have a MongoDB-server running on `mongodb://localhost:27017/vote` and a redis-server running as `localhost:6379`. To change the URL, export `MONGO_URL` and `REDIS_URL` as an environment variable.\n\n```bash\n# Start MongoDB and Redis, both required for development and production\n$ docker-compose up -d\n# Install all dependencies\n$ yarn\n$ yarn dev # terminal 1, backend and old frontend\n$ yarn dev:client # terminal 2, new frontend\n```\n\n## Usage\n\nThe following docs outline the technical usage, if you've got someone else to set it up for you and are looking for how to interact with the GUI, check out [HOWTO.md](./HOWTO.md) (in norwegian).\n\n### Users\n\nInitially you will need to create a moderator and or admin user in order to login\n\n```bash\n# Create a user via the CLI. You are prompted to select usertype.\n$ ./bin/users create-user \u003cusername\u003e \u003ccardKey\u003e\n```\n\n### Card-readers\n\nvote uses a RFID-reader to register and activate/deactivate users. This is done to make sure that only people that are at the location can vote. The RFID-reader needs to be connected to the computer that is logged in to the moderator panel. See section about using the card reader further down this readme.\n\n### Development\n\n\u003e Check docs for the environment variable `ETHEREAL` if you intend to develop email related features\n\n```bash\n$ yarn start\n```\n\n### Environment variables\n\n- `MONGO_URL`\n  - Url to the database connection\n  - `default`: `mongodb://0.0.0.0:27017/vote`\n- `REDIS_URL`\n  - Hostname of the redis server\n  - `default`: `localhost`\n- `ICON_SRC` _(optional)_\n  - Url to the main icon on all pages\n  - `default`: `/static/images/Abakule.jpg`\n- `COOKIE_SECRET`\n  - **IMPORTANT** to change this to a secret value in production!!\n  - `default`: in dev: `localsecret`, otherwise empty\n- `FRONTEND_URL`\n  - The site where vote should run\n  - `defualt`: `http://localhost:3000`\n- `FROM`\n  - The name we send mail from\n  - `default`: `Abakus`\n- `FROM_MAIL`\n  - The email we send mail from\n  - `default`: `admin@abakus.no`\n- `SMTP_URL`\n  - An SMTP connection string of the form `smtps://username:password@smtp.example.com/?pool=true`\n- `GOOGLE_AUTH`\n  - A base64 encoded string with the json data of a service account that can send mail.\n- `NODE_ENV`\n  - Node environment. `development`, `test` or `production`\n\nSee `app.js` and `env.js` for the rest\n\n### Production\n\n\u003e For a production deployment example, see [deployment](./deployment/README.md) in the `deployment` folder\n\n```bash\n$ yarn build\n$ ICON_SRC=https://some-domain/image.png NODE_ENV=production GOOGLE_AUTH=base64encoding yarn start\n```\n\n## Using the card-readers\n\nMake sure you have enabled Experimental Web Platform features and are using Google Chrome. Experimental features can be enabled by navigating to: **chrome://flags/#enable-experimental-web-platform-features**.\nPlease check that the USB card reader is connected. When prompted for permissions, please select the card reader (CP210x).\n\n### Serial permissions (Linux)\n\nWhen using the card readers on a linux based system there can be permission problems with **google-chrome**. Chrome needs access to the ports, and often the ports are controlled by another group, so chrome cannot use them. Therefore you must do one of the following:\n\n1. Run google-chrome as `root`\n\n\u003e NOTE: This has stopped working on modern versions of ubuntu-based distros, most likely due to the\n\u003e use of flatpak.\n\n```sh\n$ sudo google-chrome\n```\n\n**OR**\n\n2. Add your user to the `dialout` group.\n   - Check what group the tty(USBPORT) is:\n   ```\n   $ ls -al /dev/ttyUSB* | cut -d ' ' -f 2`\n   ```\n   - Check what groups your user is added to:\n   ```sh\n   $ groups\n   ```\n   - Normally the `tty` is in the `dialout` group, so add your user to that group with:\n   ```sh\n   $ sudo usrmod -a -G dialout $USER\n   ```\n\n\u003e You need to sign in and out to get the new privileges!\n\n## Tests\n\nvote uses vitest for backend cypress for the frontent tests. To run them all you can do:\n\n```bash\n# Frontend (headless) and backend\n$ yarn test\n# Frontend with gui\n$ yarn test:frontend\n```\n\n## Vote Occasion\n\nWe have a list of every occasion vote has been used. If you or your organization use vote for your event we would love if you made a PR where you append your event to the list.\n\nThe list is located at `./usage.yml`. Just create a new entry at the bottom. Then run `yarn lint` to see if your YAML is correct.\n\n---\n\nMIT © webkom, Abakus Linjeforening\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkom%2Fvote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebkom%2Fvote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebkom%2Fvote/lists"}