This little web service performs transaction classification and integrates with FireFly III (A free and open source personal finance manager) via web hooks.
Every time you add new transaction to FireFly III, either manually or via import tool, web hook will trigger and provide transaction description to ffiiitc
. It will then be classified using Naive Bayesian Classification and transaction will be updated with matching category.
Naive Bayesian classifier go package used by
ffiiitc
is available here. Please read the license.
Options->Profile->OAuth
click Create new token
git clone https://github.com/akopulko/ffiiitc.git
docker buildx build --load --platform=linux/amd64 -t ffiiitc:latest .
docker compose -f docker-compose.yml down
fftc:
image: akopulko/ffiiitc:latest
hostname: fftc
networks:
- firefly_iii
restart: always
container_name: ffiiitc
environment:
- FF_API_KEY=<YOUR_PAT_GOES_HERE>
- FF_APP_URL=<FIREFLY_ADDRESS:PORT>
volumes:
- ffiiitc-data:/app/data
ports:
- '<EXPOSED_PORT>:8080'
depends_on:
- app
volumes:
...
ffiiitc-data:
You can also append your environment variable names with _FILE
instead, having their value point to the file where tha actual sensitive value is stored. This works with any environment variable.
secrets:
ffiiitc-personal-access-token:
file: "<path/to/secrets/location>/ffiiitc-personal-access-token"
services:
...
fftc:
image: akopulko/ffiiitc:latest
hostname: fftc
networks:
- firefly_iii
restart: always
container_name: ffiiitc
secrets:
- "ffiiitc-personal-access-token"
environment:
- FF_API_KEY_FILE="/run/secrets/ffiiitc-personal-access-token"
- FF_APP_URL=<FIREFLY_ADDRESS:PORT>
volumes:
- ffiiitc-data:/app/data
ports:
- '<EXPOSED_PORT>:8080'
depends_on:
- app
volumes:
...
ffiiitc-data:
docker compose -f docker-compose.yml up -d
docker run
-d
--name='ffiiitc'
-e 'FF_API_KEY'='<YOUR_PAT_GOES_HERE>'
-e 'FF_APP_URL'='<FIREFLY_ADDRESS:PORT>'
-p '<EXPOSED_PORT>:8080'
-v '<TRAINED_MODEL_FOLDER>':'/app/data':'rw' 'ffiiitc'
In FireFly
go to Automation -> Webhooks
and click Create new webhook
title: classify
trigger: after transaction creation
response: transaction details
delivery: json
url: http://fftc:<EXPOSED_PORT>/classify
active: checked
You can check ffiiitc
logs to see if there are any errors:
docker compose logs fftc -f
There is also option available to force train the model from your transactions if required.
To trigger force train run the following command and restart fftc
container:
curl -i http://localhost:<EXPOSED_PORT>/train
where EXPOSED_PORT
is the port you provided in your docker compose for fftc
.
As always, you can check logs to see if model was successfully regenerated.