DEV Community

Bmartin2000
Bmartin2000

Posted on

Code Your Reality: film how your business works, get your own app (built on Gemma 4)

Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle Submission 💸

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

Here's something I see all the time: a company is a mirror of its founder's head. If that head is a mess (sticky notes, half-remembered promises, "I'll just call Peter"), the company slowly turns into the same mess. Orders get lost, two people book the same van, nobody knows which spreadsheet is the real one. Nobody notices it happening, but it quietly strangles the business.

The textbook answer is a CRM or an ERP. And yet most small and mid-sized businesses never get one, for good reasons:

  • Fitting it to your company takes forever. Off-the-shelf systems make you work their way, not yours.
  • Building your own takes even longer, and it's expensive.
  • And every change starts the whole thing again: another quote, another wait, more time, energy and frustration.

So they stay with the chaos, because the cure looks worse than the disease.

But what if… you just took out your phone, opened an app, and filmed how your company actually works, talking through it like you'd explain it to a new colleague? And out came a complete system, built around your process, that you can start using right away?

That's Code Your Reality.

And when it isn't quite right, or your business changes, you don't start over. Record a new video, describe the change in one sentence, or edit it by hand. The Plus plan gives you room to grow, and real people behind the project will help you along the way.

How it works, in a bit more detail

You film the job once (a clerk renting out a camera, a workshop lending a drill, a repair shop taking in a bike) and say out loud what you check and what must never happen. Google's open-weight Gemma 4 model looks at frames from the video and reads the transcript. It then proposes what the business keeps track of, how work moves along, and which rules it follows. You keep or drop each finding in plain language, press Build my app, and get a real application: forms, lists, a step-by-step lifecycle, and business rules that the server enforces.

Try to rent the same camera twice and the app refuses, quoting the rule that came from the video. The app works like a small CRM: a pipeline board, filters, notes on records, and spreadsheet import that goes through the same rules. You can rename sections, fields and steps in your team's own words.

Who pays for it, and why. I work at Integrint, a Hungarian digital agency. Our smallest clients are rental shops, workshops and event-equipment companies, and they are exactly the businesses described above. They would love custom software, but they can't write a specification, and they can't afford weeks of meetings to produce one. What they can do is show us how they work. So the pricing is simple:

  • Free demo: build one app from your own process, no card.
  • Plus, €19/month: 30 analyses a month instead of 3, so you can keep re-recording as you improve. Deeper analysis (12 frames instead of 6), reports, colleagues with roles (owner, manager, staff, viewer), a calendar feed and webhooks, and up to 5 apps.
  • Integrint Care: we record and maintain it with you.

Subscribers see their period, usage and invoices. Invoices are issued through Számlázz.hu, Hungary's most common invoicing service, once the operator connects it. Until then they stay clearly marked drafts, and this preview takes no payments. On Plus, the generated app can also invoice the business's own customers, straight from a record.

That's less than an hour of developer time per month, for software that matches how the business actually works, and keeps matching it as the business changes.

Plain-language review: what the app tracks, how things move along, and rules quoting the moment they were said

Demo

The launch film tells the story of a company tangled in its own workarounds. Halfway through, the film itself turns out to be the recording: the app's real recorder appears over the owner's shot, the video is sent, and from there every app scene is a real screen recording of Code Your Reality analysing that clip with Gemma 4 and building the app.

You can run it yourself in a few minutes on Windows, macOS or Linux. The guided example works without any AI model, so you can see the whole journey right away: review, build, rent, get refused, return. With Ollama and Gemma installed, record your own process.

Record with the phone camera The app is ready: open, download, share, record again, ask for a change
The generated rental app The server refuses renting the same item twice

Code

GitHub logo Bmartin2000 / code-your-reality

Reality Compiler — turn an observed business process into a working application. Local open-weight AI, human-verified rules, schema-driven runtime.

Code Your Reality

Film how you work. Get your own app. By Integrint. Don't describe your workflow. Show it.

Code Your Reality turns a recorded business process into a working application. A small business owner films how the work is done with a phone. Google's open-weight Gemma 4 model, running locally through Ollama, proposes the process structure: what is tracked, how things move along, and the business rules. Each finding is traced back to the second of the recording it came from. The owner keeps or drops each finding in plain language. The approved workflow then compiles into a schema-driven application that actually runs: records persist, and the server enforces the business rules on every operation. When the business changes, the owner records again or asks for a small change in one sentence.

Customer journey: see how it works → pick a plan (free pilot) → record with the…

Stack:

  • FastAPI and SQLite on the backend, React and TypeScript on the frontend, plus FFmpeg, faster-whisper and Ollama.
  • One Docker image for servers (HTTP or HTTPS on port 7413), plain pip/npm for local use.
  • The frontend can also be hosted separately, on any origin or in a subfolder.

Sign-in protects the Studio, so nobody can use the speech-to-text or the model anonymously on a public server. The first account becomes admin and adds the rest.

The repo has 50 backend tests plus frontend unit tests and Playwright end-to-end tests. The end-to-end tests include a full "review → build → rent → refuse → return → reload" journey.

How I Built It

The AI pipeline (all open source or open weights):

  1. FFmpeg extracts a 16 kHz audio track and samples 6 still frames evenly across the video (12 on Plus).
  2. faster-whisper (CPU, int8) transcribes the narration into timestamped segments.
  3. Gemma 4 through Ollama reads the frames and the numbered transcript segments in two constrained passes:
    • Pass A proposes the data structure: entities, typed fields, references, and the lifecycle of the main transaction.
    • Pass B proposes rules and actions. Its JSON schema is generated from Pass A's answer. Every rule kind (precondition, exclusivity, effect on a linked record, minimum value, date order) is its own anyOf branch, whose parameters are enums of the entities, fields, states and events that actually exist. The model can't reference a field it didn't define.
  4. Every finding cites the segment numbers it came from, and the server turns those into timestamps and quotes. A finding that claims to come from the video but cites no segment is downgraded to "AI guess, check this".

The part I'm proudest of: no generated code ever runs. The model only produces JSON constrained by a schema. That JSON is:

  • normalized (identifiers re-derived, references checked, unmappable rules kept as documentation);
  • reviewed by a person;
  • validated and compiled into a manifest.

A small runtime interprets a closed set of rule kinds, so the app is safe by construction. The AI decides what the rules are, never how they execute.

Small change requests use the same idea. One sentence becomes at most five operations from a fixed set (add a field, make it required, add an option, add or remove a rule…), each constrained by a schema built from the current app. "Build me a full accounting system" is refused, not guessed.

Honest numbers. I tested on a 48-second narrated clip about lending tools in a community workshop, deliberately not the rental domain of the built-in example.

  • Gemma 4 E4B, locally on my laptop (Intel Core Ultra 7 155U, 15 GB RAM, no GPU): about 8.4 minutes for the two passes.
    • It found Tool, Member and Loan with correct references, put the lifecycle on the loan, and cited a transcript timestamp for all 9 rules.
    • Two rules mapped straight to enforceable rules: the deposit can't be negative, and a new loan records today's date.
    • One proposed effect was wrong, which is exactly the kind of thing the review step catches. The rest were kept as notes for the owner to confirm.
  • A change request, "members should also give an email address, and it is required": 50 seconds, and exactly one new required field.
  • Gemma 4 31B on Ollama Cloud, same clip (transcript and 6 frames): 7.7 seconds. All 6 rules came back as enforceable kinds, each citing its transcript segment, from "a tool can only be lent to one member at a time" to "returning it turns the card back to available".

Ollama Cloud doesn't support structured outputs, so there the schema goes into the prompt instead. The server validates the answer against it. If the answer doesn't fit, the server asks for at most two repairs that name exactly what was wrong. This run fit on the first try.

Small local models are good at structure and less consistent at rules. That's exactly why the human review step and the evidence quotes exist.

Why Does Open Innovation Matter?

Because the customer's video is their business. A recording of how a shop works shows its customers, prices, deposits and habits. With an open-weight model running in Ollama, the analysis happens on the machine that runs Code Your Reality, so the video never has to leave it. For a privacy-minded small business, and for GDPR in the EU, that's the difference between "maybe" and "yes". When a server has no GPU, the same code switches to Ollama Cloud with two environment variables (the URL and an API key, kept on the server). The app then tells the user honestly that the transcript and a few still frames are sent for analysis.

Because the business model only works if inference is cheap and predictable. A €19/month product can't pay per-token prices for long video prompts and two analysis passes every time someone re-records. Running Gemma locally makes the marginal cost of an analysis close to zero, so the price covers support, not tokens.

Because the open stack made the safety design possible. Ollama's structured outputs let me compile a grammar from the first pass's answer and force the second pass to stay inside it. I could also inspect and swap the model (I tested Qwen 3.5 4B and Gemma 4 E4B side by side on the same clip), set its context and temperature, and turn its "thinking" off for extraction. A closed API wouldn't have given me that control.

And because no one gets locked in. The model is replaceable and the runtime is mine. Every customer can download their app definition and all their data as spreadsheets at any time.

My Agent Session

Prize Categories

  • Best Use of Gemma: Gemma 4 is the default model. It reads the video frames and the transcript in two schema-constrained passes, and it handles the one-sentence change requests: locally as Gemma 4 E4B, or as Gemma 4 31B on Ollama Cloud.

AI disclosure: I built this project with the help of Claude Code, an AI coding assistant, and drafted this post with AI assistance. I reviewed, tested and edited everything, and the numbers above come from my own runs. The launch film's cinematic shots and narration were generated with AI video and voice tools. Its app scenes are real screen recordings. The product's own AI is Google's open-weight Gemma 4 model running through Ollama.

Top comments (0)