Zgidno-Vidpovidno
Two-way Ukrainian AI translator with structured output and a free-tier Cloudflare backend for secure generation, fallback AI, and shared snapshots.
Categories:
AIWebAstroReactTypeScriptFirebaseCloudflareOpen SourceGitHubSocial Impact
Zgidno-Vidpovidno demonstrates a transparent two-way AI workflow for Ukrainian text. Its small Cloudflare backend protects provider keys, supplies an AI fallback, and stores immutable shared results without requiring a conventional application server.
Executive Summary
Zgidno-Vidpovidno is an open-source AI web app for translating Ukrainian text in two directions. It turns an everyday incident into an absurdly formal military-style report, or takes a bureaucratic document and explains what it actually says in plain Ukrainian.

The interface is intentionally playful, but the implementation addresses practical AI product concerns: structured output, factual constraints, provider failure, secret management, public sharing, privacy warnings, analytics, and validation. The current product has two translation modes, ten service-branch variants, five report lengths, and permanent links to exact saved results.
The Product Problem
Most AI rewriting demos stop at producing a paragraph. This app needed to support two distinct jobs while keeping the interface predictable:
- Expand a short civilian phrase into a recognisable service document without losing the original event.
- Reduce a dense report, order, or service note to the facts and required actions without inventing missing information.
- Return structured data that the interface can validate and render consistently.
- Make a generated result shareable without asking the recipient to run the model again.
- Keep AI provider credentials out of a public, open-source frontend.
What The App Does
In "To bureaucratic" mode, the user enters an ordinary Ukrainian phrase, selects one of ten service branches, and chooses a target length from S to XXL. The app generates a structured report containing the main report text, command resolution, order, approvers, regulation, authorisation, operation code, document number, and date. Length targets range from 100 words to 500 or more, and the interface shows how much text was generated.
In "To plain language" mode, the user pastes a report, order, or service note. The result is not just a shorter paragraph. It is separated into:
- A short informal summary.
- Key facts and consequences.
- Required, proposed, completed, or unclear actions.
- Responsible people and deadlines when the source states them.
- Uncertainties that the document does not resolve.
Both modes validate the model's JSON before rendering it. Users can copy the formatted output or create a public link to the exact generated result.
The Free, Simple Backend
The application does not need a traditional server, user-account system, or separately managed database host. Its small backend runs as a Cloudflare Worker and is designed to remain within the free allowances available for Workers, D1, and Workers AI at the project's current scale.
That backend now gives the app four important capabilities:
- Secret protection. The Gemini API key is stored as an encrypted Worker secret and is never shipped to the browser.
- Provider fallback. Generation goes to Gemini first. If the primary provider is unavailable, rate-limited, or returns a server failure, the Worker can fall back to a Qwen model through Cloudflare Workers AI.
- Permanent shared results. Pressing Share explicitly stores an immutable snapshot in Cloudflare D1 and creates an unlisted
?case=<id>URL. - Exact replay without AI cost. Opening that URL restores the source text, translation mode, generated result, and report metadata without calling an AI model again.
Shared IDs are random rather than sequential. Shared pages are marked noindex, and the plain-language mode warns the user before publishing a document because the link can contain sensitive source text. The API also limits source and payload sizes and validates loaded results again in the frontend.
This is intentionally a small backend, but it is no longer only a proxy. It now provides resilience and persistence while leaving the prompts and core product logic visible in the open-source frontend.
Architecture And Tradeoffs
The static application is built with Astro, React, TypeScript, and Tailwind CSS and deployed through Firebase Hosting. Prompt construction, examples, response parsing, output validation, document formatting, local anti-spam controls, and UI state all remain in the frontend repository.
The Cloudflare Worker handles only the concerns that should not live in the browser: provider credentials, AI routing, and D1 access. Firebase Analytics records product events without sending the source document or generated text as analytics parameters.
The current implementation stores public snapshots only after an explicit sharing action. It does not yet cache repeated generation requests, and it does not provide accounts, private links, moderation, or user-controlled deletion. Those are deliberate limits of the current lightweight architecture rather than features hidden behind the demo.
Results And Proof
- One open-source application supports two opposite Ukrainian-language workflows.
- Ten service branches and five output sizes reuse one validated report schema.
- A failed primary AI request can be routed to a second provider without changing the frontend.
- A recipient can reopen the exact saved result without spending another model request.
- The backend requires no dedicated server maintenance and can operate within Cloudflare's free allowances for a small public project.
Transferable Value For Clients
Zgidno-Vidpovidno demonstrates how a focused AI product can remain transparent and inexpensive without being reduced to a fragile one-shot prompt. The same pattern applies to internal document assistants, policy explainers, structured content generators, approval workflows, and domain-specific rewriting tools.
For teams that need a practical AI interface, the relevant capability is not the joke itself. It is the combination of local-language prompt design, strict structured output, provider fallback, safe secret handling, persistent shareable results, and a backend kept proportional to the product.
Open the live app, inspect the source on GitHub, or read about our AI and machine learning development services.
Project site: zgidno-vidpovidno.web.app