This directory contains the source code for the Beancount-import web frontend.
The web frontend communicates with a Python server (typically running on the same machine) over a websocket. The Python server also serves a copy of the frontend code.
In order to use the modified version after making changes, you must run the build command, which requires some additional setup:
-
A recent version of Node.js is required to build the frontend. The recommended way to obtain Node.js is by installing NVM (node version manager) by following the instructions here:
-
Install a recent version of Node.js by running:
nvm install stable
You can also specify a version manually.
-
From within this directory, install the dependencies required by this project:
npm install
-
To build a development version of the frontend, run:
npm run builddev
Alternatively, you can run:
npm run builddev:watch
This watches the source tree and incrementally rebuilds as changes are made. This is the recommended command to use during development.
-
The build output is written to the (beancount_import/frontend_dist/)[../beancount_import/frontend_dist/] directory. When using the
builddev
orbuilddev:watch
commands, the frontend is built in development mode and the output is written to thedev
subdirectory. When using thebuild
command, the frontend is built in production mode and the output is written to theprod
sub-directory. Note that only theindex.html
file contained in thedev
orprod
directory is actually used. Themain.bundle.js
file is just an intermediate output. -
By default, the Python server serves the
index.html
file in theprod
directory. As thebuilddev
andbuilddev:watch
commands update thedev
directory only, you must specify the--dev
command-line option when running Beancount-import in order to use thedev
version.