Project 02
SahaEtüt
An Android app for dam-site field surveys, built at TMC Proje for a DSİ project.
Project 02
An Android app for dam-site field surveys, built at TMC Proje for a DSİ project.
Previously, engineers took photos with their phones and recorded notes on paper during field surveys. Back at the office, they had to manually organize the data into Excel and KMZ files. This process was slow and prone to errors, especially when notes were difficult to read or too much time had passed to recall missing details. With the project expanding, field surveys and office processing will be handled by different engineers, making these problems more significant. SahaEtüt replaces this workflow with structured digital data collection, reducing manual work and making field records easier to process.
The server runs on an office PC behind Caddy, with device pairing and TLS.




Screens from the app with demo data: stock photos (CC0 / public domain) and a simulated GPS route.
Code runs in two places, the tablet and the office server PC, and only the reverse proxy is reachable from the internet.
A photo's lifecycle runs from capture to sync confirmation on the tablet. Since files and database records are saved separately on both the tablet and server, a crash between these operations can leave incomplete data.
Photo file
The camera's temp file is flushed to disk and moved into the Gallery album. The app computes its SHA-256.
The file move and the database transaction are two separate steps, not one atomic operation.
Record and sync queue
One Room transaction writes the record, its photo row and its sync-queue entries.
Resumable upload
The tablet asks the server how many bytes it holds and sends 512 KiB chunks from there. The server flushes each chunk to disk before it records the new offset.
Verification
After the last byte, the server checks the SHA-256 and that the JPEG decodes fully, moves the file to its final path, then marks the photo complete in its database.
Revision-aware acknowledgement
The tablet accepts the result only if the photo, revision, size and checksum match what it sent. A retake made in the meantime stays queued.
A rejected photo stops retrying until the engineer retries or retakes it.
Archiving photos without trusting a bad copy.
A background job (hourly by default) copies photos older than a day to the archive through a temp file, re-hashes the copy, and renames it into place only if it matches. Only then is the photo marked archived and the working copy deleted.
Under the hood
Challenge
Decision
Check that the referenced photo file still exists before uploading it.
Why
The app must not upload a different file in place of a missing photo.
Trade-off
If the photo is missing, its upload fails and needs the engineer's attention.
Challenge
Decision
Resumable uploads in 512 KiB chunks, for photos up to a 10 MiB limit. The tablet always resumes from the offset the server confirms, and the server accepts a photo only when the SHA-256 of the stored file matches the one the tablet declared.
Why
If the connection drops, the tablet can continue from the last confirmed position instead of sending the whole file again.
Trade-off
A lost partial file or a rejected photo restarts the upload at zero. Retrying a write can't create a second record, because each write is keyed by a client-generated ID, but nothing stops the same point being captured twice.
Challenge
Decision
A background job (hourly by default) copies photos older than a day to the archive through a temp file, re-hashes the copy, and renames it into place only if it matches. Only then is the photo marked archived and the working copy deleted.
Why
At every step at least one verified copy exists, and the database never points to a file that was removed.
Trade-off
Deleting a record in the app erases its server files, including the archive copy.
| Area | What the tests cover | Verification scope |
|---|---|---|
| Android app | The app's main workflows, including local persistence and sync. | 703 automated tests. |
| Go server | API behavior and data-processing logic, including upload verification and archiving. | 301 top-level test functions. |