Skip to content

ryanmoelter/splity

Repository files navigation

Splity – a sync engine for couples using YNAB

Build badge

Getting started

This assumes that both people's budgets are in the same account, but that they use separate budgets.

Config

Add your YNAB token and account names to a config.yaml file, like so:

ynabToken: "<ynab token>"
startDate: "<optional inclusive start date, e.g. '2021-02-23' (useful if someone does a fresh start)>"

firstAccount:
  budgetName: "<First person's budget name, e.g. '2020.1'>"
  accountName: "<First person's split account, e.g. 'Split - Sarah'>"
secondAccount:
  budgetName: "<Second person's budget name, e.g. 'Sarah's budget 2020'>"
  accountName: "<Second person's split account, e.g. 'Split - Ryan'>"

Run with Docker

Splity is published as a Docker image (ryanmoelter/splity). The image runs once and exits, just like the bare executable, so schedule it with whatever you already use (e.g. cron). I recommend every 10 minutes to avoid getting rate limited.

Put your config.yaml in a directory like /srv/splity and mount it at /data (the container's working directory):

docker run --rm -v /srv/splity:/data ryanmoelter/splity:latest

The database is created on the first run in the directory bound to /data (e.g. /srv/splity/incrementalSync.db), and is read and written in place. Persist it between runs to allow for incremental sync, saving you lots of API calls, network bandwidth, and runtime.

Example crontab entry running every 10 minutes:

*/10 * * * * docker run --rm -v /srv/splity:/data ryanmoelter/splity:latest >> /var/log/splity.log 2>&1

To build the image yourself, build the Gradle distribution first, then copy it in:

./gradlew installDist && docker build -t splity .

Run Splity outside of docker

Either use one of the pre-packaged releases here on GitHub, or package the app using ./gradlew assemble, and find the zipped file build/distributions/splity-<version>. From there, unzip and find the executable in the splity-<version>/bin/ directory.

(You could also run it with gradle run if you don't want to spend the time to package it.)

Put your config file in the same directory as the executable before running it.

Note that running the bare executable or gradle requires Java 25+.

Sentry integration

If you (like me) want to be alerted when budget syncing fails, create a new project on Sentry and put the DSN in your config.yaml file.

sentryConfig:
  dsn: "<Paste dsn here>"

Troubleshooting

Please create an issue if you run into any problems!

As a workaround until I fix it, I've found that deleting the incremental sync file (incrementalSync.db) solves most problems. It will be recreated on the next run.

About

A tool to sync two people's accounts in YNAB

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors