Project structure

What everything in the repository is, and where to read next.

For a developer who has just cloned the repository: what everything is, and where to read next. After this part you should be able to open the right file for any change.

Want to work on it with us?

Opensolr Photos is open source and contributions are welcome. To become a contributor to this or any other Opensolr open source project, write to support@opensolr.com and tell us what you would like to work on.

01 · The big picture

Opensolr Photos is one Android app written in Kotlin, its screens built with Jetpack Compose. It has no server of its own: what it needs on the server side is Opensolr, over HTTPS (see every call it makes). Almost every file belongs to one of these flows:

  • Sign-in: the browser, a one-time code, a key for this phone. auth/, finished in ui/AppViewModel.kt.
  • Sync: find photos, compare them with the phone's copy of the index, send the new ones, carry up the words. sync/, using media/, net/, index/ and data/.
  • Browse and search: browsing from the phone's copy; a typed search or a filter becomes one request. search/ and ui/screens/SearchScreen.kt.
  • Local-first editing: tags, people, wording and places saved on the phone first, carried up by a queue. search/EditRepository.kt and data/PhotoCache.kt.
  • On the phone only: faces, the photo editor, the scanner and PDF. media/.

The next pages go deeper: the Kotlin packages, how the flows move through the code and where to change something.

02 · The repository, top to bottom
app/

The Android application module: all code, resources and the manifest.

app/build.gradle.kts

How the app is built: package name, minimum and target Android versions, version number, dependencies, release signing, and the task that zips the Solr configuration into the APK.

app/src/main/AndroidManifest.xml

Permissions, the two activities (the app, and the sign-in callback with its App Link), and the foreground service type for sync.

app/src/main/java/com/opensolr/photos/

All Kotlin code, one folder per responsibility. See the Kotlin packages.

app/src/main/res/

Resources: the strings in English and in the six other languages (values-de, -es, -fr, -ja, -ro, -zh), colours, icons, the bundled Space Grotesk font, and the XML files that switch off cleartext traffic and backups.

app/src/main/assets/faces/

The two face models, YuNet and SFace, that run on the phone.

app/src/play/

What the Google Play build changes: it leaves updating to the store.

solr/conf/

The configuration uploaded to every phone's index: schema.xml, solrconfig.xml, stop words, synonyms, protected words.

docs/

The Markdown documentation shown on GitHub, and docs/images/ with every diagram as an SVG file.

gradle/libs.versions.toml

The one place every library and plugin version is written.

build.gradle.kts, settings.gradle.kts, gradle.properties, gradlew

The Gradle project around the app module, and the wrapper that downloads the right Gradle version.

third_party/

Licences of bundled third-party material: the font and the face models.

fastlane/

The store listing kept as files: titles, descriptions, change notes and screenshots.

README.md, CONTRIBUTING.md, SECURITY.md, LICENSE

The front page, how to contribute and what a change has to keep, how to report a vulnerability, and the MIT licence.

signing.properties, local.properties

Not in the repository, on purpose: your signing key settings and your Android SDK path. Both are git-ignored.

03 · The one idea to hold first

The phone keeps a copy of every document its index holds, in the docs table of PhotoCache, read from the index once (EditRepository.readIndexIntoCache()) and kept in step by every write (storeDoc). The actions table is the outbox the sync drains: ACTION_INDEX (read and write a photo whole), ACTION_WORDS (only the words changed), ACTION_DELETE. If you add a write path, it keeps the copy in step, or the copy is wrong. Browsing, Stats and the tag suggestions are answered from the copy: do not put a Solr call back into them. See the phone's copy of the index.

04 · Before you start

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