A band of dedicated hackers from Code For Australia, making a difference in the way we view government spending.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 11 commits ahead, 9 commits behind CodeforAustralia:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
test
vendor/assets
.buildpacks
.codeclimate.yml
.gitignore
.ruby-gemset
.ruby-version
.scrutinizer.yml
.travis.yml
Gemfile
Gemfile.lock
LICENSE
Procfile
README.md
Rakefile
config.ru

README.md

About

This is the @PuZZleDucK fork of the CfA @ DTF project

Aims

  1. Get tests back on track
  2. Get CI/CD back on track (semaphore / codeship)
  1. Store all contract types
  2. Store all revisions and ocid
  3. Automate validity checking in new/updated contracts
  4. Simplify DB/UI
  5. Correct documentation

CfA & DTF Genesis

We aim to provide transparency of construction contracts.

A platform where anyone who wants insights on government projects can subscribe and participate actively and sharing the information collected to preferred social media.

A place for public to be aware and be inspired of the upcoming projects and infrastructure that will be implemented on their areas.

Setup

  1. Install rails: for Windows or Mac for Linux

  2. Install PostgreSQL database

  • Windows

    • Download postgresql
    • Take note of port setting (5432 is default)
    • Run postgresql pgAdmin 4 GUI
    • "object menu" --> "properties" --> "connection"
    • Create a user and take note of the username and password in the postgres database
  • Linux

    • In a terminal run
sudo apt-get install postgresql postgresql-server-dev-all
sudo su - postgres
createdb genesis_development
psql
* Then in SQL prompt:
CREATE USER genesis WITH PASSWORD 'q1w2e3r4t5';
ALTER USER genesis CREATEDB;
  1. Create/Locate a suitable local folder like "Sites" for development

  2. Open terminal ("Command Prompt With Ruby On Rails") and execute the following tasks

git clone https://github.com/CodeforAustralia/dtf-genesis.git
cd dtf-genesis
  1. Edit database.yml file with appropriate username and password for the development database (Ex. genesis_development) from "config" folder

  2. Then run the commands:

bundle install
rails db:create db:migrate
rails db:migrate RAILS_ENV=test
rails test
rails server
  1. Open your browser and you should be able to see your application by entering the url localhost:3000

  2. Create active admin user locally Run this commands at terminal:

    rails c  # opens up rails console
    u = User.new
    u.email = "admin@example.com"
    u.password = "password"
    u.password_confirmation = "password"
    u.save
  1. Run required database setup tasks (prefix with heroku run to run on production)
rails db:migrate
bundle exec rake db:seed
bundle exec rake migrate:contract_status
bundle exec rake migrate:contract_types
bundle exec rake migrate:agency
bundle exec rake migrate:value_types
bundle exec rake migrate:unspsc
  1. On heroku you may need to add a phantomjs buildpack
heroku buildpacks:add https://github.com/stomita/heroku-buildpack-phantomjs
  1. Now you should be able to trigger the scraper with
bundle exec rake scrape:new
bundle exec rake scrape:update