Plan #
hey, i would like to make a program/script that periodically backs up the ATProto repos and blobs of specific people
(1) it should have a PDS list, where, it backs up every account on the PDSes in the list (2) it should have a separate account list, where, it backs up every account on the list (this list should be stored as DIDs not handles!) (3) you should be able to add someone to (2) even if they meet the criteria for (1) in case they migrate away (4) these settings should be accessible as a web app/site/panel, along with a general dashboard where it shows various stats, like how many backups are currently stored total, how many blobs are currently stored total, how much diskspace is taken up by both, how much diskspace remains on the server (though i might add s3 later, but for now itll just be local server disk. but make the code in a way where it shouldnt be too hard to add s3, maybe we could have an abstraction for file management which can be then implemented by a local files class, a s3 class, a webdav class, etc),
as for backups, (a) repos should be backed up periodically, and historical versions should be kept (lets say it would keep all backups made in the last week, and then before that it would keep 2 backups per historical week) (b) blobs are independent of repos and they should not be backed up over and over, as they are unchanging... rather, for each account, it should back up the blobs into a folder, then on the next run - check if there are any new blobs to back up, and if so, back up those as well. it would not delete blobs from the backup if they were deleted from the account (c) if an account gets marked as deactivated/deleted/suspended/takendown, it should not delete any further backups (i.e. do not keep following the (a) spec, but rather keep all backups that are currently there)
as for the actual code, i would like to use Bun with TypeScript
- there is a good webapp for making repo and blob backups here: https://github.com/mary-ext/boat so you can use it as a reference on how to make these backups.
- of course please reference atproto.com docs
- it should be written in elysia, and use
@elysiajs/htmlfor a completely server side rendered frontend. see ~/Project/lsky for a reference of this, basically that project is how id like the code here to be structured
please write this whole prompt down verbatim, maybe as ./PLAN.md, before you start working, and make a CLAUDE.md that just says to reference the PLAN.md file