This is the front-end AngularJS application for viewing ballot measure funding data. This front-end application works from an API defined by the back-end Django application
Don't forget to run the tests.
$ npm test
The data comes from the disclosure API. The API is incomplete, but the repo has useful information about what the models are shaping up like, even for incomplete APIs. Ballot models are separate from finance data, since that's how the data is ingested, but eventually should be combined for the frontend views.
Url | Description |
---|---|
disclosure-backend | Disclosure API repo. |
Disclosure API | Documentation for the disclosure API. |
Disclosure Admin | Admin interface for entering ballot data. |
If you want to test against a development backend, you can set an environment variable
$ DISCLOSURE_STATIC_BACKEND='http://localhost:4567' gulp build
$ DISCLOSURE_SWAGGER_SPEC='http://localhost:8000/docs/api-docs/' gulp build
And the tests
$ DISCLOSURE_STATIC_BACKEND='http://localhost:4567' gulp test
$ DISCLOSURE_SWAGGER_SPEC='http://localhost:8000/docs/api-docs/' gulp test
- Install the LTS version of node.js
- Install gulp.js (
npm install -g gulp
) - Clone the repository.
- Run:
npm install
from inside the repository directory, to install all project dependencies. - Run
gulp build
(in most cases,gulp
alone will be enough;gulp build
rebuilds static files). - Open
http://localhost:5000
in your browser
To tweak the install,
- Edit
gulpfile.js
to change the port.
To point this front-end to another (e.g. local test) back-end:
- Run
python manage.py runserver
from your back-end repo; this should start your back-end server on port 8000. - Edit
app/app-init.js
, set$rootScope.swaggerSpec = 'http://127.0.0.1:8000/docs/api-docs/';
.
This project is open source so collaboration is welcome.
A brief guide:
- If you see a way to improve something in this project, please feel free to open a Pull Request to the develop branch so we can discuss your code.
- Review our docs for contributing to learn more about the application structure, coding style, etc.
- Run
npm test
before submitting a pull request.
- https://github.com/curran/screencasts/tree/gh-pages/introToAngular
- https://www.codeschool.com/courses/shaping-up-with-angular-js
- http://egghead.io
- http://thinkster.io
Travis will deploy the master
branch to Github Pages. You shouldn't need to manually deploy
but, here are the instructions.
To deploy, just set a personal access token via GITHUB_TOKEN in your environment and run the deploy script. The script will build your working directory as is, and push it to Github pages.
$ GITHUB_TOKEN=<your personal token> ./deploy.sh