The Kotlin packages

One folder per responsibility, from storage and network up to the screens.

All the code lives under app/src/main/java/com/opensolr/photos/, one folder per responsibility. They are listed from the bottom of the stack, things that know nothing about screens, to the screens at the top.

data/ — what the app remembers

  • Models.kt — the plain data classes passed around: the signed-in Session, the IndexConnection, AccountLimits with the photos-per-month arithmetic, SyncSchedule, SyncReport.
  • AppPrefs.kt — every setting and saved value, in one private preferences file; the place to remember anything new between runs.
  • SecureStore.kt — encrypts the secrets with an AES-256-GCM key held by the Android Keystore. Nothing stores a secret any other way.
  • PhotoCache.kt — the private SQLite database: the phone's copy of the index (docs), the outbox (actions), the owner's edits, the places set by hand, the faces, the photos that could not be read, the photos still arriving and the ones kept from removed folders.
  • FaceStore.kt — the faces of a photo as the one string that travels to the index (faces_json).
  • LibraryStats.kt — the numbers of the Stats screen.
  • Words.kt — the rule that decides two spellings are the same tag or person.
  • SearchCache.kt — the answers the index already gave, kept for as long as the owner chose.

net/ — talking to Opensolr

  • Http.kt — the one shared HTTP client: timeouts, and no redirects followed.
  • OpensolrApi.kt — one function per Opensolr call (see every call it makes), and the platform's refusals turned into typed errors.
  • SolrClient.kt — straight to the phone's index: search, suggest, the one read into the copy, the similar-photo facets, delete, empty, commit, the configuration check; a 401 fetches the current password once and repeats the request.
  • UpdateCheck.kt, SelfUpdate.kt — the daily release check and the self-update of the copy installed from GitHub.
  • Errors.kt — the exceptions, named after what the app has to do about them.

media/ — photos on the phone

  • MediaScanner.kt — lists folders, scans the chosen ones, and holds photoId(), the one place a photo's id is computed.
  • PhotoReader.kt — EXIF, the upright 1024 px copy for Opensolr, the file md5, the picture fingerprint, and the tags and names other apps left in a file.
  • FaceEngine.kt — finds and fingerprints faces with YuNet and SFace on LiteRT.
  • PhotoEditor.kt, ShapeFit.kt — the editor's steps, and a hand-drawn line turned into the shape it was meant to be.
  • DocumentEdges.kt, DocumentScan.kt — the scanner: the page's corners, and the straightened page saved as a photo.
  • PdfPhoto.kt, PdfWriter.kt — photos as PDF pages, up to 300 dpi.
  • DevicePlace.kt, Jpeg.kt — the phone's own position for new photos, and reading a JPEG marker by marker.

index/, auth/

  • IndexManager.kt — the index name, finding it, offering the indexes of other phones, creating it in the region marked nearest, uploading the configuration, the configuration version. The rule "create only when certainly missing" lives here.
  • AuthFlow.kt, AuthCallbackActivity.kt — the PKCE request, the browser, and the screen Android opens at the end of the sign-in.

sync/ — keeping the index in step

  • SyncEngine.kt — the sync itself, from "is the index there" to the final commit, every stop condition, and the refill from the phone's copy.
  • SyncWorker.kt, SyncScheduler.kt — the background job, one at a time, and every way a sync is started, stopped or scheduled.
  • FaceWorker.kt — names the newest faces after each sync, and reads every photo's faces once, only while charging.
  • PlanWatch.kt, Notifier.kt — what the plan's limits mean right now, and every notification.

search/ — finding photos

  • SearchRepository.kt — the search from the text and the filters, its facets, suggestions, similar photos, the map's photos; every read goes through SearchCache.
  • SearchOperators.kt — the phrase, + and - signs.
  • EditRepository.kt — edits saved on the phone, the words carried up fifty at a time, the one read of the index into the copy, and storeDoc, which keeps the copy in step.
  • FaceMatcher.kt — the people learned from named faces, the sure matches, the ones offered for review, and Same faces.

ui/ — the screens

  • AppViewModel.kt — one UiState holding everything the screens draw, and one function per thing the owner can do.
  • AppRoot.kt — picks the screen from UiState.screen.
  • screens/ — onboarding, the photos screen with its sheets and viewer, the editor, the tagging sheets, faces, the place picker, Stats, the map, Sync, the Me screen and the scanner.
  • Components.kt, theme/Theme.kt — the shared building blocks, and the colours and type, light and dark.
  • Actions.kt, ShareChooser.kt, PdfExport.kt — what is handed to other apps, sharing, and saving a PDF.
  • Haptics.kt, AppLanguage.kt, ScrollThumb.kt, OutsideTap.kt, KeyboardBack.kt, TextBox.kt — the small helpers.

At the top

  • MainActivity.kt, PhotosApp.kt, AppText.kt — the one real screen, the start-up, and the app's text outside the screens.

For developers

Opensolr Photos is open source and MIT licensed. Questions about your Opensolr account, index or plan go to opensolr.com/contact; questions about the app itself belong on GitHub.

Opensolr Photos Documentation