Personal finance accounting with frontend in JavaScript with Dojo framework and data storage in CouchDB. Thus JavaScript code directly talks to database. Its current functionality is very limited: CRUD operations on expenses, filtering expenses by date and import/export via CSV format. The work is in progress to make it full-featured. See TODO.txt for the nearest plans. Feel free to contact me at paul.lysak@gmail.com if something is unclear!
Fintracker needs CouchDB version 1.1 or later (due to modules usage in design documents) and some web-server that can work as a reverse proxy. Easiest way to run the application is via scripts in scripts/ folder. Currently they're only available for Unix-like systems and nginx web-server. Before you can do it you need to copy (and optionally customize) some configuration files:
- Folder app/config_sample/ -> app/config/. Contains file FintrackerConfig.js where you can set URL of CouchDB server and names of Fintracker databases.
- File scripts/couchdb.ini.sample -> scripts/couchdb.ini Overrides some default settings for CouchDB including port number, storage directory location, log files location
- File scripts/nginx.conf.sample -> scripts/nginx.conf Settings for nginx web-server: to which port it should bind, where should map CouchDB database
- Run start_dev_env.sh to run both CouchDB and nginx. If you press Ctrl+C in colsole they both will stop. If you prefer to run them separately in different consoles there are start_couchdb.sh and start_nginx.sh scripts.
- You may use application. Default URL for application is http://localhost:7070, for CouchDB console - http://localhost:7000/_utils/ After you open the application for the first time it will create databases on CouchDB server and upload design document there.
For the production deployment you'll probably have servers started by init-scripts so you'll need slightly different approach which depends on your environment and preferred web-server. Here is my suggestion with nginx:
- Copy (and optionally customize) sampes/fintracker-site file to /etc/nginx/sites-available/
- Go to /etc/nginx/sites-enabled/
- Make a symlink: sudo ln -s /etc/nginx/sites-available/fintracker-site fintracker-site
- Copy content of app/ directory to folder served by web-server. With default fintracker-site file it's /var/web-content/fintracker/
- Start (or restart) nginx
- Make sure CouchDB is running
- Now you may use applicaion. Default URL is http://localhost:7080/, CouchDB console - http://localhost:5984/_utils/
On default CouchDB installation there's no users and anybody can do anything. In order to restrict users you need to do following:
- Open CouchDB web console
- Click "Set up admin" and follow the instructions
- Log out from console.
- Click "Signup" to create new user and follow the instructions
- Re-login as an admin
- Click database name you'd like to secure (fintracker_expenses and fintracker_status are default DB names)
- Click "Security..."
- Specify at least one admin and at least 1 regular user. Click "Update".
Now your database is secured. Next time you open the application you'll be prompted for username and password. Application can be used by regular user, no admin right needed. However if you didn't open the application before you don't have databases yet so you can't do steps 5 to 7. Then you'll need to login as admin into the application in order to create databases and then return to steps 4 to 7 in order to complete securing.
Currently there is a handful of unit-tests written with Dojo DOH testing framework. If you'd like to run them you can use scripts/serve_tests.sh script. You'll need Python v.2 or v.3 for this. Then you can open http://localhost:8000/test/runTests.html in your browser to run the tests.
Licensed under Apache 2.0 license: http://www.apache.org/licenses/LICENSE-2.0.txt