A self-hosted photo-scanning pipeline that resumes interrupted imports from a ledger without re-uploading completed files.
At a glance
Outcome: Gets a stack of scanned family prints from a Windows desktop into
a self-hosted Immich library behind a home firewall, without the PC or the
public server ever holding the archive’s credentials.
Status: All eight build milestones are deployed on my own
infrastructure: OIDC-protected intake on a VPS and the importer beside Immich
on a homelab node. Prints scanned on a real scanner have gone all the way
into my production Immich library.
Automatic crop and deskew fall back to manual crop when they lack
confidence.
Role: Built every component solo.
Stack & libraries: C#/.NET, Avalonia + NAPS2, ASP.NET Core, .NET Worker,
EF Core/SQLite, Tailscale, ntfy.
Validation: xUnit HTTP and contract tests send the shared
Scanta.Contracts sample batches to each service unchanged. Two opt-in tests
run against a real Immich, one covering the whole pipeline. A backup was
restored into a spare copy of the library around June 2026.
Contribution: I wrote the design doc, the ADRs, the runbooks and the shared
contracts every service compiles against, then built and deployed the four
services.
Source: Five private MIT-licensed repositories: an umbrella and four
services.
Limitations: Date and album handling, including approximate sorting and
contributor sharing, still needs an end-to-end test. Replaying a photo’s ID
against a production server is untested.
Scanta moves scanned family photos from a Windows PC into Immich, a private photo library running on a home server. You scan a stack of prints, note roughly when each was taken, pick an album and upload. A date can be a day, month, season, year or decade, or left blank. Each photo sorts to the middle of its range, so “summer 1978” lands on July 15, 1978, instead of January 1.
The home server stays off the public internet, and the family PC never holds the library’s password. Uploads go first to a drop-off server online, which checks the sender and the batch, then holds it. It works like email: the drop-off server holds each batch until the home server collects it, so the home server never has to accept a connection from the internet. A program on the home server reaches out over Tailscale, a private network, picks up the batch and adds the photos. All three pieces share one C# definition of a batch, so a change one piece makes without the others fails to build.
Immich can’t undo a half-finished import, so the importer is built to pick up where it left off (an idempotent import). It writes down each step as it finishes, and a retry skips the finished ones. Each photo gets an ID made from its contents, so a photo the library already has simply counts as done.
One early bug: if the home server crashed partway through adding a batch, that batch got stuck. It stayed marked “importing,” and the importer only looks for batches marked “ready,” so nothing ever finished it. Only one batch runs at a time, so anything still marked “importing” when the importer starts must be left over from a crash. The importer now puts those batches back in line. In a test, I crashed it on purpose mid-import; on restart it finished the batch without uploading any photo twice.
The drop-off server runs on a VPS and the importer runs at home beside the library. Failures send an alert to my phone through ntfy. Next: better automatic cropping and straightening, to remove the manual crop step, and a full end-to-end test of dates and albums.
Ran the full server path: a test photo went from the drop-off server through the importer into Immich, and an import crashed on purpose resumed without uploading any photo twice.