This is a small and simple application in Node.js for tracking my retirement savings.
At this moment it periodically queries my retirement plan company - NN Investment Partners - for quotes of securities I invest in. When it detects a change (which happens once a day) it sends me an email with updated quotes as well as updates a Google spreadsheet based in which I've set up some simple tracking tools.
=========================
- Login to Google Developers' console.
- Create a new project. Generate an OAuth 'other' key and download the secret file. Copy it to
./data_private/google-api-key.json
. - Enable Sheets API and GMail API for this project
- Copy the
config.example.json
toconfig.json
- Within this file adjust the config settings
- Create a spreadsheet on Google Docs where daily updates will be stored
- Run the application for the first time. It will ask you to authenticate with your Google account. Go to the link displayed in the command line, accept the request for modifying spreadsheets and sending email. Afterwards copy the generated token back to the application.
- You can leave the application running in the background now. A wise idea is to use
pm2
as a process supervisor.
An array with IDs of funds to track. Its prefilled with all the funds available from NN Investment Partners as of October 2016
Number of milliseconds. How often to poll the NN website for new quotes.
Configuration object for the HTTPS request used for fetching new data.
Settings relevant to Google Spreadsheets
String indicating the path were API key will be stored
String with an id of a spreadsheet where daily quotes will be stored
String with a name of a sheet within the spreadsheet where daily quotes will be stored
Settings relevant to GMail
String: this will be used as the 'from' field in your email. It should be the address associated with your Google account.
String: this will be the address to which the email with daily updates will be send to
String: This will be used as the first part of email subject. Date and hour of an update will be appended to it.
- Node.js 5+, ES2015
- Use as few 3rd party modules as possible. Currently only Google API libraries are imported.
- Use Google APIs for storing data in Google docs and sending email through Gmail
- Only query for new data when new data is expected (after 3pm on weekdays)
- Persist historical data
- Use data from my spreadsheet to do some more advanced calculations of profitability
- Do some kind of nice visualization
- Fetch data from more sources
- Add a Web UI for configuration and management
- Dockerize
- Automatic discovery of new securities to track
- ...
- Profit
- Ignore ENOTFOUND errors - they're transient and should not stop polling
- Ignore ETIMEDOUT errors - they're transient and should not stop polling
- Add instructions regarding OAuth key to README.md
- Basically 0.0.3 which has proven to be stable enough over a course of several days
- Added README.md
- Added LICENSE
- Ignore some errors arising from API returning malformed data or connectivity errors
- First functional release with basic features in place