Voting-record is a web app for tracking Portland, Maine city council votes.
Votes back as far as 2014 appear to be recorded in PDF's listed under City Council on http://www.portlandmaine.gov/AgendaCenter
Some record of orders as far back as fiscal year 2012/2013 (FY 12/13) can be found in PDF's listed under City Council on http://www.portlandmaine.gov/DocumentCenter
npm install
We don't use package.json
scripts because JSON doesn't allow comments.
To run the development servers (Postgres):
docker-compose up
You can shut them down with Ctrl+C.
To initialize the database:
./sql.sh sql/encoding.sql
# DID THAT SAY UTF8? IF NOT, GET IT FIXED!
./sql.sh sql/councilors.sql
To run database commands manually....
If you have psql
installed, you can use it to connect just like you would
to any Postgres running on localhost.
If you don't, you can use psql
without installing it by running it from
within Docker using this script:
./psql.sh
To run the frontend build process:
# if you don't have gulp installed globally
export PATH="$PWD/node_modules/.bin:$PATH"
gulp watch
To run the server:
node server
- See the
config
object ingulpfile.js
for locations of the frontend files. - Database contents is in
db
. You can shut the database down and move that directory aside to start fresh. - S3 contents (files) are in
s3-minio
. You can shut minio (docker-compose) down and move that directory aside to start fresh.
- The database is Postgres.
- The API uses
hapi-node-postgres
(which usesnode-postgres
(pg
)) directly. - No ORM is in use. This probably makes development slower, but gives us less to learn and eliminates the likelihood of losing time to ORM limitations later.
- Eventually, we'll want a database migrations tool. There's a Trello card tagged technical debt for adopting one.
If you ever include any variable in the first argument to
request.pg.query
, also include a half page comment on why the right way wouldn't work that time.