This might be exactly what I need.
Currently, I use [Obsidian](https://obsidian.md/) to keep notes and [Syncthing](https://syncthing.net/) to sync them between devices. A major downside of this is that the devices have to be online at the same time for them to sync.
Thank you! Duck doesn't require devices to be online at the same time, the sync works asynchronously in each device. So I'm happy if it meets your need!
> Every message is stored in your local database, you don't need to connect Internet.
Very nice!
> If you connected Internet and signed in with Google, messages are automatically synchronized between devices
Nice to have but not ideal for privacy-oriented people who actually appreciate the local database feature. Better add support for SFTP, WebDAV or something to synchronize via my own server.
Well done, very clean and functional.
I'm really curious about the implementation, since I'm also working on a static web app. It's been hard to deal with browser APIs manually.
- Could you give a brief overview of how the project is built, or what libraries are used? I found two in the source, React and Workbox. I've never heard of Workbox before, and I'm still figuring out how service workers are used. But it seems like a big part of the source.
- What factors made you choose Google Drive for syncing? And was it easy to set up?
Thank you for trying it and asking questions. Let me reply to them below.
> Could you give a brief overview of how the project is built, or what libraries are used? I found two in the source, React and Workbox. I've never heard of Workbox before, and I'm still figuring out how service workers are used. But it seems like a big part of the source.
For building, I used Next.js with static generation, not using Server-side rendering. But it's not an important part because it doesn't rely on Next.js features so much.
About Workbox, the app uses them with next-pwa (https://github.com/shadowwalker/next-pwa) for providing caching strategies and offline behavior as Progressive Web App. For example, the app registers several precached files via Workbox. Precached files are fetched and cached by the service worker and these caches can be used while offline. Also, Workbox can configure runtime caching strategies. You can see details in Workbox documentation (https://developer.chrome.com/docs/workbox/).
The app also uses the Service Worker to connect IndexedDB as a local database and send HTTP requests to synchronize data with Google Drive. By using the Service Worker, these methods don't block the user interaction from the main thread and Service Worker can run in the background to synchronize data even if the browser window is suddenly closed.
So the Service Worker is used for not waiting for HTTP requests/responses and improving performance.
> What factors made you choose Google Drive for syncing? And was it easy to set up?
Using Google Drive as a database is not easy to implement, but I chose Google Drive in terms of data ownership. The users can delete the data by themselves if they want and the app can't connect users' data without receiving the HTTP request from the user. These points are good for privacy laws and reduce the security risk.
It also keeps infrastructural costs low. It's also an important factor in providing the application free of charge.
The bad point of Google Drive is high latency, but the latency issue wouldn't be a big problem because the HTTP requests/responses wouldn't block user interactions in this app.
Yeah, this is one of the reason. I don't have a plan to earn a living with this app now, but it depends on how many users use the app and how much the infrastructure costs. If the app is used by many users, I'd like to think about paid option with additional features (eg. providing API, managed database, etc) and keep free plan with current features.
Yeah agree. I would rather pay $10/year or something. Right now I still have to trust that the developer won't just copy all the data I'm writing. I don't have any reason to trust them if I can't see the code and I'm not paying. Not going to use it for that reason.
Thank you for your opinion! I wrote how the app handles data on the privacy policy page (https://site.ducknote.app/privacy/), but your opinion is understandable.