Service | Status |
---|---|
Travis CI | |
Code Climate | |
Code Climate | |
Gemnasium | |
Dependency CI | |
Snyk (npm) | |
Snyk (Gemfile) |
Loot is a web-based personal finance management application. It's main goal is to reproduce the core functionality of Microsoft Money 2008, for the web.
Rails on the backend (JSON API); Angular.js + Bootstrap on the frontend
- Clone the repository (
git clone git://github.com/scottohara/loot.git
) and switch to it (cd loot
) - Install the server-side dependencies (
bundle install --path vendor/bundle
) (--path ensures that gems are installed locally in the project) - Install the client-side dev dependencies (
npm install
) (Note: you should have./node_modules/.bin
in your shell path; so that locally installed packages are preferred over globally installed ones) - (Optional) Configure database.yml (uses postgres by default)
- (Optional) Export your existing MS Money data (see below)
- Initialise the database (
rake db:setup
, or if you have no data to importrake db:create && rake db:migrate
) - Configure environment variables for the username and password to login as (
export LOOT_USERNAME=user && export LOOT_PASSWORD=pass
) - Start the database server and app server in dev mode (
npm start
) - Browse to http://localhost:8080/index.html and login using the credentials configured at step #8
To get data out of MS Money and into Loot, I'm using the excellent Sunriise project to access the underlying data from my *.mny file, and export it as a set of CSV files.
- Download the latest Sunriise build
- Launch the executable JAR file
- Choose the "MS Money file viewer" option
- File -> Open -> {your *.mny file}
- File -> Export DB -> To CSV
- Save to ~/Documents/sunriise/csv
- Run the importer (
rake db:seed
)
(Note: this import tool has been tested using my MS Money file only. YMMV.)
npm run build
Frontend specs are implemented using mocha+chai+sinon.
Two npm scripts are available to run the frontend test suite:
npm run test:bdd
watches for any file changes and runs the full test suite (without code coverage)npm run test:coverage
performs a single full test suite run, including instanbul code coverage reporting. Summary coverage reports are written to stdout, and detailed HTML reports are available in/loot/coverage/index.html
Backend specs are implemented using RSpec:
- Ensure the database server is running (e.g.
npm start:db
) - Run the RSpec rake task (
rake spec
). To run specific specs, use RSpec filtering (fdescribe
,fit
,xdescribe
,xit
)
Integration tests are implemented using Protractor:
- Start the database server and app server in test mode (
npm test:e2e
) - Prepare the test data fixtures (
rake db:e2e:prepare
) - Run the test suite (
protractor
). To run specific suites, use the--suite
argument (e.g.protractor --suite authentication,accounts
)
Frontend checks are implemented using eslint:
npm run lint
Backend checks are implemented using rubocop:
bundle exec rubocop
Before deploying, you should first create an annotated tag (e.g. git tag -am "Version 1.00" v1.00
).
If you use use heroku, it's a simple git push heroku master
. If there are additional commits after the tag that shouldn't be deployed, just push the tag (git push heroku v1.00:master
).
The Procfile
includes a release
phase that automatically runs db:migrate
before release is deployed.
If you use heroku pipelines, the recommendation is that your heroku
git remote maps to a staging
app in the pipeline. This allows you to verify the release before promoting it to a production
app in the pipeline.
(Note: You must configure your heroku app to use the multi buildpack, eg. heroku buildpack:set https://github.com/heroku/heroku-buildpack-multi
)
(Note: Ensure your server is configured to your local timezone. For heroku, this is done by setting the TZ
config variable, eg. heroku config:add TZ=Australia/Sydney
)