sammularczyk / democracy.io

democracy.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Democracy.io

Build Status

Express & Angular app for sending messages to Senate and House members

Table of Contents

Background Info

Democracy.io is an app for contacting Senate & House members. It provides a user friendly wrapper around the individual member contact forms.

It uses APIs from:

Getting started

Redis

Ensure that redis is running locally: http://redis.io/topics/quickstart

App dependencies & build

npm install
npm run build

credentials

You can generate required creds by running

node bin/gen-creds.js

or:

After you've run npm install generate a salt for encrypting IP addresses and store it in your local.json file, under: SERVER > CREDENTIALS > IP > SALT

var bcrypt = require('bcrypt');
var salt = bcrypt.genSaltSync(10);
console.log(salt);

Set a session secret and store it in your local.json file, under: SERVER > CREDENTIALS > SESSION > SECRET

App Configuration

App config is controlled via the node-config module.

To set credentials, create a local.json file under the config dir and override the SERVER.CREDENTIALS setting.

Alternately, you can use:

Run tests

npm run test

Running the server locally

Spins up a local server to serve the app, including proxying browsersync on top of the express server.

gulp serve

Deploying

To deploy the server, simply run:

pm2 deploy ecosystem.json5 production

For more instructions on setting up a production server, check /devops/README.md.

Angular app

See the www/README.md for details

About

democracy.io

License:GNU Affero General Public License v3.0


Languages

Language:JavaScript 64.4%Language:CSS 23.7%Language:HTML 11.9%