DAHLIA is the affordable housing portal for the City and County of San Francisco. It was created by the Mayor's Office of Housing and Community Development (MOHCD). This application streamlines the process of searching and applying for affordable housing, making it easier to rent, buy and stay in our City.
Before you install DAHLIA, your system should have the following:
- Ruby (see Gemfile for version)
- Homebrew
- bundler
gem install bundler
- PostgreSQL
brew install node
- npm install -g grunt-cli (To run grunt commands globally)
- npm install bower
We will create a Boxen for this project, but for now to get started:
- Clone the repo
git clone https://github.com/Exygy/sf-dahlia-web.git
- Open a terminal window
- Run
bundle install
in command line to download all necessary gems - Run
npm install
to run the js style and code linters - Run
overcommit --install
to install git hooks into the repo - Run
bower install
- Run
grunt
. Ensure that the latest pattern library is in the same folder as this repo. Running grunt will migrate the css over from the pattern library. You can ignore the warning that saysUnable to match 1 pattern.
. - Run
rake bower:install
- Open a separate terminal tab and run
postgres -D /usr/local/var/postgres
to start Postgres. - Run
rake db:create
, followed byrake db:migrate
to create the app database. - If you have access to the correct environment values, create a file named
.env
and copy in the values. It will look similar to.env.sample
. - Run
rails s
to start the server.
Run thor tests
. This will run syntax linters, code quality linters, rspec and jasmine specs.
Temporary "acceptance" apps are created upon opening a pull request for a feature branch. After the pull request is closed, the acceptance app is automatically spun down. See this Heroku article for details.
<3 Use the engineering workflow and coding style standards established below. <3
Dahlia's current engineering workflow has been fully documented and can be found here.
Dahlia's project backlog is in Pivotal Tracker.
Javascript code quality is ensured by two npm packages: JsHint and JSCS. They will run automatically as a pre-commit hooks. Follow the Airbnb JavaScript Style guide.
Rubocop is configured in .rubocop.yml
to enforce code quality and style standards based on the Ruby Style Guide and runs every time you commit using a pre-commit hook. Refer to the Ruby Style Guide for all Ruby style questions.
To identify and have Rubocop automatically correct violations when possible, run:
rubocop -a [path_to_file]
for individual filesrubocop -a
for all Ruby files
When adding new modules to the JavaScript dirctory, please follow the example structure below to mantain a modular component structure.
- javascripts
- applications
- ApplicationsController.js
- ApplicationsService.js
- templates
- applications.html
- listings
- ListingController.js
- ListingService.js
- templates
- listings.html
- listing.html
- shared
- SharedService.js
- SharedController.js
- LanguageController.js
- LanguageService.js
- directives
- filters
- templates
- welcome.html
Any changes to Rubocop, JSCS, etc. affect the entire team, so it should be a group decision before commiting any changes. Please don't commit changes without discussing with the team first.
Copyright (C) 2015 City and County of San Francisco
DAHLIA is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with DAHLIA. If not, see http://choosealicense.com/licenses/gpl-2.0/