| Service | Status |
|---|---|
| GitHub | |
| Qlty | |
| Qlty | |
| Snyk (npm) | |
| Snyk (Gemfile) |
Loot is a web-based personal finance management application. Its 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 config --local path vendor/bundle && bundle install) (path vendor/bundleensures that gems are installed locally in the project) - Install the client-side dev dependencies (
npm install) (Note: you should have./node_modules/.binin 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.htmland 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.)
The app uses basic authentication, and you will need to declare the following environment variables (replacing the values with your own):
.env
LOOT_USERNAME='username'
LOOT_PASSWORD='supersecret'For staging/production, if you use Fly.io you can specify these as secrets using the flyctl CLI, eg.
fly secrets set LOOT_USERNAME=username --app <name of staging or production app>(Assumes you have setup two Fly apps, one for staging and one for production)
Staging/production also require a RAILS_MASTER_KEY secret. config/credentials.yml.enc is committed and copied into the Docker image, but config/master.key is excluded (see .dockerignore), so the key must be supplied via the environment for the app to boot. Set it on both apps using the value from your local config/master.key:
fly secrets set RAILS_MASTER_KEY=$(cat config/master.key) --app <name of staging or production app>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:bddwatches for any file changes and runs the full test suite (without code coverage)npm run test:coverageperforms 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 run db) - Run the RSpec rake task (
bundle exec rake spec). To run specific specs, use RSpec filtering (fdescribe,fit,xdescribe,xit)
Integration tests are implemented using Cypress:
- Start the database server and app server in test mode, and launch Cypress (
npm run test:e2e) - Optionally run Cypress in headless mode (
cypress run --browser chrome)
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).
Then run:
npm run deploy:stagingto deploy to the staging appnpm run deploy:productionto deploy to the production app