News for hackers. Stuff that matters.
Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @02:54PM (#24792343)
I have a lot of experience with this having developed a personal finance app that is local-first: https://actualbudget.com/

Having all of the data local is a superpower. It changes how you build the app, and you just never have to worry about the network. Everything is fast _by default_. It's great.

The app uses CRDTs to sync and it's unlocked a lot of powerful stuff like a robust undo system. We also offer end-to-end encryption.

On the negative side, over time I've stepped back a little from being truly local-first. The mobile app used to connect to the desktop by pointing the phone's camera at a QR code on desktop, and it would literally sync peer-to-peer. Maintaining that was nightmare and users had endless networking problems. Our network infrastructure unfortunately is not built for truly peer-to-peer apps. Maybe ipv6 will help, I don't know. My app now has a "centralized" server but it's really just a backup that gives some convenience - the app is still totally local but syncs through a single server. You can work on it for weeks offline and then sync up. In the future when p2p is ready, I'll be ready for it.

Re:What if we had Local-First Software? by avrionov on Thursday October 15, 2020 @05:47PM (#24794486)
The app looks great. What technologies did you use to develop it?
Re:What if we had Local-First Software? by ignoramous on Thursday October 15, 2020 @08:56PM (#24796227)
The app's UI is consistent across all platforms. Such delightful colours and design. What an impressive execution!

GP, I'm curious about the frontend stack as well.

Re:What if we had Local-First Software? by jlongster on Friday October 16, 2020 @09:33AM (#24800651)
@avrionov @ignoramous Thank you!

The frontend for desktop/browser React, and Electron is used to create standalone apps. I don't love Electron, and if you don't want it a browser version is available too: https://app.actualbudget.com/

The mobile app uses React Native and has a custom UI just for mobile, but it shares styles and a few small components with web. I don't believe that you can build one UI that works well on both desktop and mobile.

All platforms share the backend code which runs in a separate process/thread. On mobile, I use https://github.com/JaneaSystems/nodejs-mobile to run the JS backend locally.

That's mostly it. No UI frameworks are used. I love UI/UX design so I built it from the ground up to be as usable and performant as possible.

Re:What if we had Local-First Software? by cw on Thursday October 15, 2020 @03:29PM (#24792765)
I cannot imagine my life without Actual. Bookkeeping is such a joy with this tool. I've used Acutal for more than a year to manage the budget for two companies and my personal finances. Highly highly recommend.
Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @03:49PM (#24792988)
Wow, that's really great to hear! There's so much more I'm excited to build into it, so it will only get better. Something I'm most excited about is custom reports. Having all your data local is going to make those super powerful.
Re:What if we had Local-First Software? by Larrikin on Thursday October 15, 2020 @03:43PM (#24792918)
This looks great and similar to YNAB. Do you feel you offer anything over YNAB vs just being local first.
Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @03:57PM (#24793072)
Right now, the differences are all in the details (income categories, no weird credit card handling, etc), and there are many of them. But instead I'll focus on what is to come soon:

* A custom rules engine (to be released in a few weeks). You'll be able to write a list of conditions for matching transactions, and a list of actions to apply when matched. The system will automatically encode what it learns as rules (apply category X to payee Y) so you can see what it's doing and adjust.

* Multiple budget types. Zero-based budgeting is cool, but Actual is just a tool for you. If you want, you can use a simple report based that just shows income vs expense. You choose the type you want adapt it to your lifestyle.

* Custom reports. This is really where having all your data local is incredible. You'll be able to write queries into your data, process it, and render any kind of visualization.

Re:What if we had Local-First Software? by boarnoah on Thursday October 15, 2020 @04:15PM (#24793287)
> You'll be able to write queries into your data, process it, and render any kind of visualization.

Now that sounds very cool.

Out of curiosity, do you have any plans to handle things that cannot be local first (for example with YNAB I like the Plaid Integration to pull transactions data out of banking).

Something like that for your application would need to clear through your own API right?

Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @04:30PM (#24793490)
Yep, bank syncing is going to launch by the end of the year.

It's tough. I've wrestled with this for over a year. Bank syncing has to come from my server, which means by doing so you are giving us access to your transactions. No banking provider has any way for clients to contact them directly. I think this is possible with the right encryption, but nobody is working on it. I've given this feedback to Plaid but they don't care.

The majority of people need the convenience of syncing though. So I plan to launch it, and it'll go through my server, and I plan to communicate clearly the privacy that you are giving up by doing so.

Re:What if we had Local-First Software? by jpeeler on Thursday October 15, 2020 @08:19PM (#24795984)
I assume by mentioning Plaid, you'd be using their services to extract the transaction data?

I keep hoping to find a (maintained/viable) open source project that uses headless browsing to login locally and extract transaction details.

Re:What if we had Local-First Software? by MarkSort on Thursday October 15, 2020 @09:58PM (#24796629)
I'm also interested in automated exports performed locally.

For my credit union, I "reverse engineered" the API and export multiple times throughout the day.

I wrote an extension that exports the data for CapitalOne, but I haven't gotten around to trying it either headless or even just in any automated fashion.

Easy automated export of user data, even beyond financials, is something I'd like to see more of. Feels like it could be a workaround while there's so little decentralization.

Re:What if we had Local-First Software? by jlongster on Friday October 16, 2020 @09:22AM (#24800553)
@jpeeler @Marksort I wish the same. I've also given feedback to Plaid that they should implement an encryption scheme that allows data to be encrypted from Plaid to the user, so at least apps which sit in the middle couldn't read your data. Nobody is interested in that though.

There _sort of_ is a solution where your computer directly connects to the bank. The format is called OFX (https://github.com/libofx/libofx), and there is a directory of banks that provide these files directly online. This site (https://www.ofxhome.com/) lists the URLs to use for each bank.

I used that for a while many years ago. But it's terrible and requires massive maintenance. For an app that requires connections to arbitrary banks, there's no way developers can support these direct downloads. There's always different errors in data for different banks, etc. Unfortunately, Plaid is solving a real problem

Re:What if we had Local-First Software? by throw0101a on Thursday October 15, 2020 @05:16PM (#24794109)
Personally, if I can get a YNAB4-equivalent that will work with macOS 10.15+ I'd be very happy. (YNAB4 is 32-bit only, and YNAB5 is subscription—and since I have no need for the cloud stuff I refuse to rent it; I do have a license for YNAB4.)
Re:What if we had Local-First Software? by TimSchumann on Thursday October 15, 2020 @04:25PM (#24793414)
I've actually been looking for an alternative to YNAB since they forced you into a cloud subscription model with data hosted on their servers. I mean, they didn't force, but they essentially stopped updating the standalone product.
Re:What if we had Local-First Software? by oriel on Saturday October 17, 2020 @01:15PM (#24811468)
I'm curious whats your definition of "ready".

I'm doing a similar quasi-local-first project with p2p. Ive been toying with libp2p[1], which underpins a number of distributed storage solutions, and originated from ipfs.

> [1]: https://libp2p.io

Re:What if we had Local-First Software? by jacobwilliamroy on Thursday October 15, 2020 @09:20PM (#24796398)
Maybe you don't need to use the QR code to establish a connection? Instead you could just use the QR code to transmit whatever data the phone might need from the computer. If it's just a finance app, surely the data would be small enough to fit into a qr code, maybe show a series of codes if the data is really big?
Re:What if we had Local-First Software? by jlongster on Friday October 16, 2020 @09:25AM (#24800583)
Fun idea! Just looked it up, 3kb is the max data in a QR code, and data _definitely_ gets bigger than that. If you import 100 transactions it'll probably be bigger than that. Also the syncing mechanism requires a two-way connection: they will communicate changes back and forth until they are synced up.
Re:What if we had Local-First Software? by matheusmoreira on Thursday October 15, 2020 @04:18PM (#24793328)
> Maintaining that was nightmare and users had endless networking problems. Our network infrastructure unfortunately is not built for truly peer-to-peer apps

What causes these problems? NAT?

Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @04:32PM (#24793523)
Yep, that and public routers blocking types of protocols. There was a phase where I switched to using mDNS (https://en.wikipedia.org/wiki/Multicast_DNS) so you didn't need a QR code, which discovers other devices. Turns out most public wifis (coffee shops) flat out block it.
Re:What if we had Local-First Software? by bitz-please on Thursday October 15, 2020 @05:38PM (#24794364)
What protocol were you using before that? Had you looked at using webrtc?
Re:What if we had Local-First Software? by sebmellen on Thursday October 15, 2020 @06:47PM (#24795195)
WebRTC is a horribly fantastic mess of complexity which is very hard to work with without using a third-party provider like https://simplewebrtc.com. Your head will be swimming with acronyms like ICE, TURN, STUN, etc. before you even understand the basic signalling mechanisms.
Re:What if we had Local-First Software? by ignoramous on Thursday October 15, 2020 @09:04PM (#24796291)
Re:What if we had Local-First Software? by sebmellen on Friday October 16, 2020 @04:02AM (#24798670)
Feross makes really great libraries. WebTorrent, which is basically an extension of simple-peer is fantastic. See https://webtorrent.io.
Re:What if we had Local-First Software? by tpetry on Friday October 16, 2020 @01:43AM (#24797862)
Compared to many different programming things its really easy. You just have to understand that their reason is to fix all networking problems. Its really _NOT_ complex!
Re:What if we had Local-First Software? by im3w1l on Friday October 16, 2020 @02:04AM (#24797964)
I've never found a good explanation of how it all works - Something that will cover everything from the high level reasons down to explaining what every byte in a typical packet means.

It's just a mess of documents referring to other documents for details.

I'm sure it all makes sense if you just spend a few months making sense of it all, but it's very not much accessible to someone looking do it as a weekend project.

Re:What if we had Local-First Software? by tpetry on Friday October 16, 2020 @02:39AM (#24798158)
You first stated that these concepts are hard, which is really not the case. Many more terminology is really good explained here: https://webrtcglossary.com/

Not understanding the byte protocol is understandable but a quite different topic. You really don't need to understand it, there are libraries for many programming languages doing the hard work for you. And if you want to understand it, it's normal you have to read a lot of different documents. If you would have no understanding of HTTP/2 you would have to read a lot of RFCs too as every version is built on the former version with retaining many of it's concepts

Re:What if we had Local-First Software? by im3w1l on Friday October 16, 2020 @05:41AM (#24799164)
> You first stated that these concepts are hard, which is really not the case.

That was another person, I don't struggle with that.

> If you would have no understanding of HTTP/2 you would have to read a lot of RFCs too as every version is built on the former version with retaining many of it's concepts

The turd doesn't smell less because you managed to find another.

The reason I wanted to read about it was because some sources say STUN requires two public IPV4. I wanted to know what would happen if I had only one. Or if I had two IPV6.

Re:What if we had Local-First Software? by mycall on Friday October 16, 2020 @12:27AM (#24797466)
What about running a default HTTP Proxy VPN for it?
Re:What if we had Local-First Software? by jlongster on Friday October 16, 2020 @09:26AM (#24800592)
I'm not exactly sure what you mean. Wouldn't that be a centralized thing that everybody has to go through?
Re:What if we had Local-First Software? by MrZander on Thursday October 15, 2020 @03:37PM (#24792848)
This looks great, do you have a newsletter? I'd love to know when you implement bank syncing. That's the only thing keeping me from signing up right now.
Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @03:46PM (#24792952)
Thanks! Sort of do but unfortunately you can only subscribe to it right now by subscribing to a trial. If you email [email protected] I'll subscribe your email manually.
Re:What if we had Local-First Software? by wry_discontent on Thursday October 15, 2020 @04:04PM (#24793158)
I've seen some ways you can hack this functionality together with email alerts for any > $0 transaction.

Does Actual expose any api stuff?

Re:What if we had Local-First Software? by jlongster on Thursday October 15, 2020 @04:26PM (#24793415)
Re:What if we had Local-First Software? by aidenn0 on Friday October 16, 2020 @07:43PM (#24806102)
I have 15 years of my personal budget in a double-entry system; is the import API sufficient that I could import that data?
Re:What if we had Local-First Software? by clarkmoody on Thursday October 15, 2020 @09:42PM (#24796527)
Did you consider spinning up a Tor hidden service on the desktop app and sending the onion address and credentials via QR to the mobile app?