Back to projects

App Store release · January 2026

PolyLog

An app that lets language learners go from a corrected diary entry to vocabulary review in one flow.

An app where you write a diary in a foreign language, Gemini corrects it, and the words that come up go into spaced-repetition review. I built it from friction I ran into in a Japanese study group, put it together with Flutter, Firebase, and Gemini, and shipped it to the App Store.

Period
2025.10 - 2026.03
Format
Solo project
Team
Solo project
Role
Built the flow where saving a diary entry triggers a Gemini correction in Cloud Functions, the change highlighting, and a spaced-repetition word list, then released it on the App Store.
Tech stack
Flutter, Firebase (Auth, Firestore, Functions, Secret Manager), Gemini API

Built for myself, from friction in a study group

PolyLog is an app for writing a diary in a foreign language and carrying it from correction through vocabulary review in one place. Entries can be written in Japanese, English, or Korean.

It started from friction I felt as a Japanese learner in a study group. Checking whether my writing sounded natural happened in one place, collecting unfamiliar words in another, so what I wrote never fed into review. The first user was me.

The app is built in Flutter, with authentication, the database, and server-side work handled by Firebase (Authentication, Firestore, Cloud Functions). There is no server of my own. It was released on the App Store in January 2026.

Saving an entry starts the correction on the server side

The app only saves the entry to Firestore; it never calls Gemini itself. The save triggers a Cloud Function, which reads the user's level and settings and asks Gemini (gemini-2.5-flash-lite) for a correction.

The result comes back as JSON: the corrected text, a casual and a formal alternative, the changes, words worth learning, and grammar notes. The function writes it to a separate document, and the app screen, which is subscribed to that document, switches to the correction as soon as it arrives.

The API key stays out of the app so that it cannot be pulled out of a distributed binary. In December 2025 I moved the key from the function's environment config into Secret Manager, so only functions that declare it can read it.

Where it got stuck was the explanation language. When a Korean speaker writes a Japanese entry, the grammar notes and word meanings should come back in Korean, but they sometimes came back in Japanese, the same language as the diary. The fix was to make the explanation language a setting separate from the native language (falling back to the native language when unset), and wrote the rule into both the system instruction and the end of the request, with correct and incorrect examples side by side.

PolyLog diary writing screen

Showing each fix inside the original sentence

The correction screen shows where and how the original sentence changed: deletions with a strikethrough, additions underlined.

At first, Gemini returned only the changed parts, and the app searched the original sentence for each word to color it. That search takes the first match in the sentence, so when the same word appeared twice, the unchanged occurrence could be the one highlighted.

To avoid that, I changed the format so Gemini returns the whole sentence in order, unchanged parts included. The app now just lays the pieces out in the order received and colors them, without searching the text. The trade-off is that the app does not check that the unchanged and deleted pieces rebuild the original, or that the unchanged and added pieces rebuild the corrected text; it trusts Gemini's segmentation as given.

For a plain diff, diff_match_patch could compare the original and corrected sentences character by character. In Japanese, though, 行く becoming 行った splits into small fragments, a deleted く and an added った, which makes it hard to see which word was fixed. Word-level diffs therefore come from Gemini, and the character-level comparison stays as a fallback for when the returned diff is empty or cannot be read.

Saved words come back at growing intervals

Words from a correction can be saved to the word list with their part of speech, meanings, example sentence, and the entry they came from. If the same headword in the same language is already in the on-device list, it is not added again.

Review intervals grow with an ease factor. The first correct answer on a new word schedules it one day later; after that, each correct answer multiplies the previous interval by the factor. The factor moves between 1.3 and 2.8 depending on whether the answer was rated hard, good, or easy. A forgotten word comes back ten minutes later, and a word forgotten eight times is moved to a separate group.

The word list is read from an on-device cache in Hive and written to both Firestore and Hive, so opening the list never reads from Firestore. The current limitation is that a full import from Firestore only happens when the local cache is empty, so words added on another device do not arrive on this one. The next step is delta sync: give each card an updated-at timestamp and pull only what changed since the last sync.

PolyLog vocabulary screen