Personal finance app for web, cli and android
There is a web-based API written in Node.js, which also runs a web app. The Android app connects to this API.
- Node version: 14
The CLI app is written in Python 3. See cli/README.md
for setup info.
For info on building the Android app, see android/README.md
.
Please note that the Android and CLI apps are deprecated and not compatible with the current API. Development on them ceased a while ago.
-
Install external dependencies
- PostgreSQL server
-
Set environment variables
- These are in
.env.example
, which you should copy to.env
and edit with the appropriate values (see below).
- These are in
-
Run
yarn install
to install Node dependencies -
Run
yarn build
to build the web app
- Run
yarn start
and access the app athttp://localhost:3000
by default.
-
Run
yarn scrape_funds
to scrape and cache current fund prices -
Run
yarn scrape_holdings
to scrape and cache current fund holdings
-
Run
yarn dev
to run a development server with hot module replacement- This runs inside a Docker containerised environment
- All external services are created by docker-compose
-
This is accessible at
http://localhost:3000
by default- To set the port, change the
PORT
environment variable in.env
- To set the port, change the
To run database migrations:
yarn migrate up
To run seeds:
yarn seed:user
yarn seed:stage-data
Upon running the server, API documentation is available at /docs/api
and /graphql
.
These environment variables must be set on your deployment environment, or in .env
:
Note that the development variables are optional on a production environment.
PORT
: the port to listen onDATABASE_URL
: URI for connecting to the databaseREDIS_HOST
: hostname for redisREDIS_PORT
: custom port for redis (defaults to 6379)DEFAULT_PIN
: the PIN for the first generated userBIRTH_DATE
: the (ISO) date of birth (for use in FTI calculation)IP_BAN_TIME
: how long to ban users for if they make too many bad login attemptsIP_BAN_LIMIT
: the period of time to consider when banning usersIP_BAN_TRIES
: the maximum number of failed logins before banning usersPIE_TOLERANCE
: minimum slice of pie charts to include on list dataPIE_DETAIL
: maximum number of pie slices to return on list dataFUND_RESOLUTION
: detail to include on fund price graphOPEN_EXCHANGE_RATES_API_KEY
: API key for exchange rate data (used in fund scraping and net worth calculation)