<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tazoh Yanick</title>
    <description>The latest articles on DEV Community by Tazoh Yanick (@tyanick).</description>
    <link>https://dev.to/tyanick</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F585292%2F94a5595f-7d99-414c-8d6e-44a85cf49993.jpeg</url>
      <title>DEV Community: Tazoh Yanick</title>
      <link>https://dev.to/tyanick</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tyanick"/>
    <language>en</language>
    <item>
      <title>How I Shrank a Next.js Image by 80% in My First Week of Docker</title>
      <dc:creator>Tazoh Yanick</dc:creator>
      <pubDate>Thu, 04 Jun 2026 09:33:10 +0000</pubDate>
      <link>https://dev.to/tyanick/how-i-shrank-a-nextjs-image-by-80-in-my-first-week-of-docker-3ego</link>
      <guid>https://dev.to/tyanick/how-i-shrank-a-nextjs-image-by-80-in-my-first-week-of-docker-3ego</guid>
      <description>&lt;p&gt;I'm a full-stack developer pivoting toward Site Reliability Engineering and Platform Engineering. I'm based in Yaoundé, planning to move to Canada later this year, and I've decided the next 5 months are about turning my full-stack background into infrastructure skills that hold up against AI automation. Week 1 was Docker. I'd never used it before.&lt;/p&gt;

&lt;p&gt;Here's what I learned, the mistakes I made, and the optimization story I didn't expect.&lt;/p&gt;

&lt;h2&gt;
  
  
  Days 1-2: Foundations and the image-vs-container confusion
&lt;/h2&gt;

&lt;p&gt;Day 1 was installation and concepts. Day 2 was my first real container — a tiny Node.js HTTP server, containerized from scratch.&lt;/p&gt;

&lt;p&gt;The conceptual flip everyone hits on Day 2 hit me too. When my mentor asked me what an image was versus a container, I answered confidently — and got it backwards. I said the image was the thing you share and the container was the read-only template. It's the opposite.&lt;/p&gt;

&lt;p&gt;Here's the version that finally stuck for me:&lt;/p&gt;

&lt;p&gt;An image is the read-only blueprint. A container is a running instance created from an image. Images get shared via Docker Hub. Containers run locally.&lt;/p&gt;

&lt;p&gt;The other concepts that took a beat to land:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Docker daemon doesn't just relay commands, it does the actual work.&lt;/strong&gt; Your terminal (the client) is a waiter; the daemon is the kitchen. When you type docker run, the daemon builds, runs, pulls, and manages everything.&lt;br&gt;
&lt;strong&gt;Image layers exist for caching.&lt;/strong&gt; Change one line of source code and only the affected layer rebuilds. Push to Docker Hub and only changed layers go over the network.&lt;/p&gt;

&lt;p&gt;By end of Day 2 I had a 46 MB hello-world image pushed to Docker Hub. Small, but mine.&lt;/p&gt;
&lt;h2&gt;
  
  
  Day 3: The optimization story
&lt;/h2&gt;

&lt;p&gt;This is where Docker stopped being academic.&lt;br&gt;
The plan for Day 3 was to containerize my actual deployed project: an AI immigration assistant I built for the recent DEV Gemma 4 Challenge. Same Next.js code that's running in production on Vercel. I wrote a multi-stage Dockerfile, used &lt;code&gt;npm ci --omit=dev&lt;/code&gt;, picked the Alpine Node base. Built the image.&lt;/p&gt;

&lt;p&gt;It came out to &lt;strong&gt;1.37 GB.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's not a working Dockerfile — that's a broken one with a working app inside it. So I did what an SRE would actually do: I ran &lt;code&gt;docker history&lt;/code&gt; and looked at where the bytes lived.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;node_modules&lt;/code&gt; (from deps stage)&lt;/td&gt;
&lt;td&gt;493 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;.next&lt;/code&gt; (full build output)&lt;/td&gt;
&lt;td&gt;326 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Node 20 Alpine base&lt;/td&gt;
&lt;td&gt;130 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Everything else&lt;/td&gt;
&lt;td&gt;tiny&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two problem layers, 819 MB combined. The diagnosis was clear: even with &lt;code&gt;--omit=dev&lt;/code&gt;, my &lt;code&gt;node_modules&lt;/code&gt; was carrying packages npm classified as devDependencies but Next.js actually needs at runtime. And the full .next directory was carrying build caches, source maps, and intermediate compiler artifacts I'd never use.&lt;/p&gt;

&lt;p&gt;The fix was a Next.js feature called &lt;strong&gt;standalone output mode&lt;/strong&gt;. One line in &lt;code&gt;next.config.ts&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;tsoutput:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"standalone"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this does: Next.js traces the compiled application and bundles only the files genuinely needed at runtime into &lt;code&gt;.next/standalone/&lt;/code&gt;. The standalone output for my project has 10 directories in its &lt;code&gt;node_modules&lt;/code&gt; — React, ReactDOM, Next.js itself, the SWC compiler, sharp, and a few small utilities. That's it. Total standalone size: &lt;strong&gt;18 MB.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I rewrote the Dockerfile to copy only &lt;code&gt;.next/standalone&lt;/code&gt; and &lt;code&gt;.next/static&lt;/code&gt; instead of the whole &lt;code&gt;node_modules&lt;/code&gt; and &lt;code&gt;.next&lt;/code&gt; directories. One more change: &lt;code&gt;ENV HOSTNAME=0.0.0.0&lt;/code&gt;, because standalone defaults to localhost and that means Docker port mapping doesn't work.&lt;/p&gt;

&lt;p&gt;Rebuilt.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Version&lt;/th&gt;
&lt;th&gt;Image Size&lt;/th&gt;
&lt;th&gt;Compressed on Docker Hub&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;:1.0&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;1.37 GB&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;:1.1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;269 MB&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;64.6 MB&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;80% reduction. 5x smaller. Same app, same Node base, same architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The lesson wasn't "Docker is hard." It was: capable defaults aren't always sufficient defaults. Real optimization comes from looking at &lt;em&gt;where the bytes are&lt;/em&gt; and applying the right targeted fix.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 4: Multi-container systems with Compose
&lt;/h2&gt;

&lt;p&gt;Day 4 was about the leap from one container to systems of containers. I built a small Node API + Postgres stack, orchestrated with a &lt;code&gt;docker-compose.yml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The moment that made Compose click for me was this log line, right after I ran &lt;code&gt;docker compose up -d&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;✔ Container lab-03-compose-multi-container-db-1   Healthy   6.2s
✔ Container lab-03-compose-multi-container-api-1  Started   6.5s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database was declared _healthy _at 6.2 seconds. The API started at 6.5 seconds. The 300 ms gap was Compose waiting — specifically, &lt;code&gt;depends_on&lt;/code&gt; with &lt;code&gt;condition: service_healthy&lt;/code&gt;&lt;br&gt;
 waiting for Postgres's &lt;code&gt;pg_isready&lt;/code&gt; healthcheck to pass before letting the API container come up. Without that gate, the API would start instantly and try to connect to a Postgres that wasn't ready yet, get &lt;code&gt;ECONNREFUSED&lt;/code&gt;, and crash.&lt;/p&gt;

&lt;p&gt;That's &lt;em&gt;production-shape orchestration&lt;/em&gt;: not just "start everything in order" but "start everything in &lt;code&gt;readiness&lt;/code&gt;order."&lt;/p&gt;

&lt;p&gt;The other concept that landed: &lt;code&gt;service discovery by name&lt;/code&gt;. Inside the API container, my Node code connects to Postgres using the hostname &lt;code&gt;db&lt;/code&gt;. Not &lt;code&gt;localhost&lt;/code&gt;. Not an IP. Just &lt;code&gt;db&lt;/code&gt;. Compose creates a private network where the service name is the hostname, automatically. I tested it from inside the running container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;/app #&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping db
&lt;span class="go"&gt;PING db (172.19.0.2): 56 data bytes
64 bytes from 172.19.0.2: seq=0 ttl=64 time=2.5 ms

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the entire conceptual basis for how Kubernetes services work too, by the way. Day 4 taught me orchestration vocabulary I'll need in Week 12 when CKA prep starts.&lt;/p&gt;

&lt;p&gt;One more thing worth knowing: &lt;strong&gt;volumes&lt;/strong&gt;. I tested it explicitly. &lt;code&gt;docker compose down&lt;/code&gt; keeps the named volume — my Postgres data survived the restart. &lt;code&gt;docker compose down -v&lt;/code&gt; removed the volume and the data was gone. That distinction matters for any stateful production service.&lt;/p&gt;

&lt;h2&gt;
  
  
  Day 5: Networking deep dive (the gotcha that bites everyone)
&lt;/h2&gt;

&lt;p&gt;Day 5 closed Week 1 with the one Docker concept I hadn't drilled by hand yet — networks.&lt;br&gt;
Docker has three network drivers worth knowing:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bridge&lt;/strong&gt;: single-host private network. ~90% of what you'll ever use.&lt;br&gt;
&lt;strong&gt;Host&lt;/strong&gt;: no network isolation at all; container shares the host's network stack directly. Performance-critical use cases only.&lt;br&gt;
&lt;strong&gt;Overlay&lt;/strong&gt;: multi-host networking for Docker Swarm or distributed orchestrators. Conceptual predecessor to Kubernetes networking.&lt;/p&gt;

&lt;p&gt;The gotcha that bites everyone is this: &lt;strong&gt;the default&lt;/strong&gt; &lt;code&gt;bridge&lt;/code&gt;&lt;strong&gt;network **&lt;/strong&gt;, the one that ships with Docker out of the box — does not give you DNS resolution by container name.** If two containers attach to the default bridge, they can only reach each other by IP address. And container IPs change every time you restart.&lt;/p&gt;

&lt;p&gt;Custom bridge networks (the ones you create with &lt;code&gt;docker network create my-network&lt;/code&gt;) do give you automatic DNS by name. Same driver, totally different behavior.&lt;/p&gt;

&lt;p&gt;This is why every real-world Docker setup creates custom networks. It's also why &lt;code&gt;docker-compose.yml&lt;/code&gt; automatically creates a custom network for your stack — that's the entire reason Compose works the way it does.&lt;/p&gt;

&lt;p&gt;The rule worth memorizing: &lt;strong&gt;never use the default bridge in production. Always create a custom network.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I tested it with two unrelated containers — &lt;code&gt;web1&lt;/code&gt;and &lt;code&gt;web2&lt;/code&gt;— attached to a network I created manually. From inside &lt;code&gt;web1&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;/ #&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 web2
&lt;span class="go"&gt;PING web2 (172.19.0.3): 56 data bytes
64 bytes from 172.19.0.3: seq=0 ttl=64 time=1.944 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;web2&lt;/code&gt;resolved to &lt;code&gt;172.19.0.3&lt;/code&gt; automatically. No configuration, no IP hardcoding. The container name became the hostname.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three things I'd tell another Docker beginner
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Verify everything you write to a file.&lt;/strong&gt; I corrupted a README this week by piping a heredoc that swallowed a special character mid-stream. The file ended mid-sentence, and I didn't notice until commit. After every cat &amp;gt; file &amp;lt;&amp;lt; EOF, run cat file to confirm what landed. This is a real DevOps habit. Verify state, don't assume.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-stage builds aren't optional. They're how you avoid 1 GB images.&lt;/strong&gt; A single-stage Dockerfile for a typical Next.js project will produce an image somewhere between 800 MB and 1.5 GB. Separating build from runtime, copying only the runtime artifacts forward, is the basic discipline. Combine it with framework-specific tricks (like Next.js standalone), and you get 80% reductions for free.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The default bridge network is a trap. Always create a custom network.&lt;/strong&gt; I covered this above but it bears repeating because it's the kind of thing people learn the hard way at 2 AM when their containers can't talk to each other on the default bridge. Custom networks come with automatic DNS resolution. Default doesn't. Just use custom.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Week 2 starts AWS Solutions Architect Associate prep — the next chapter in the SRE pivot. The plan: certification by end of June, then Terraform, networking deep-dive, Kubernetes, and CKA before the move to Canada.&lt;br&gt;
Everything from this week lives on GitHub:&lt;a href="//github.com/t-yanick/sre-portfolio-2026"&gt; github.com/t-yanick/sre-portfolio-2026&lt;/a&gt;. Three labs, real READMEs, the full optimization story documented with &lt;code&gt;docker history&lt;/code&gt; outputs and Dockerfiles.&lt;/p&gt;

&lt;p&gt;The deployed AI immigration assistant — now also available as a 64.6 MB Docker image on Docker Hub at &lt;code&gt;tyanick237/gemma-canada-assistant:1.1&lt;/code&gt; — is at &lt;a href="//gemma-canada-assistant.vercel.app"&gt;gemma-canada-assistant.vercel.app&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Week 1 down. Twenty-one to go.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>learninpublic</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Building a Cameroon-Aware Immigration Assistant with Gemma 4</title>
      <dc:creator>Tazoh Yanick</dc:creator>
      <pubDate>Sun, 24 May 2026 20:41:39 +0000</pubDate>
      <link>https://dev.to/tyanick/building-a-cameroon-aware-immigration-assistant-with-gemma-4-50h7</link>
      <guid>https://dev.to/tyanick/building-a-cameroon-aware-immigration-assistant-with-gemma-4-50h7</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Build with Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most refusals for Cameroonian Express Entry applicants come from the same handful of patterns. I built a Gemma 4–powered second-reviewer that flags them before submission.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;The Canada Immigration Assistant is a second-reviewer tool for African applicants navigating Canadian immigration. It addresses three of the most common refusal patterns IRCC cites, all in one place.&lt;/p&gt;

&lt;p&gt;The reference letter generator takes a user's NOC code, their actual day-to-day duties, and employer details — then rewrites the duties in the applicant's own voice (so IRCC doesn't see verbatim NOC text), produces a 7-to-10-point reference-letter checklist, and assembles a full copy-paste-ready letter outline.&lt;/p&gt;

&lt;p&gt;The proof of funds + employment legitimacy analyzer checks the applicant's funds against the official IRCC table for their family size, flags fund-source issues (microfinance, mobile money, gifts without donor documentation), and validates employment legitimacy across Cameroon's public, private, mission, and vacataire sectors. It also surfaces CEC and job-offer exemptions up front, so applicants who don't need POF know it immediately.&lt;/p&gt;

&lt;p&gt;The visitor visa home ties analyzer rates an applicant's ties to home, builds a category-by-category inventory across employment, family, property, financial, and travel history, and flags dual-intent risks specific to the applicant's situation.&lt;/p&gt;

&lt;p&gt;What makes it different from generic AI immigration tools: it knows that a Cameroonian government teacher is documented by l'acte d'intégration, not CNPS — and many other locally-specific rules that a globally-trained model gets confidently wrong by default. All three features are powered by Gemma 4.&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://gemma-canada-assistant.vercel.app/" rel="noopener noreferrer"&gt;gemma-canada-assistant.vercel.app&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The deeper story: &lt;a href="https://dev.to/tyanick/what-gemma-4-doesnt-know-about-cameroon-and-what-that-taught-me-about-building-ai-for-the-real-3gl2"&gt;I wrote about the prompt-engineering lessons here.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;Live app: &lt;a href="https://gemma-canada-assistant.vercel.app/" rel="noopener noreferrer"&gt;gemma-canada-assistant.vercel.app&lt;/a&gt;&lt;/p&gt;


&lt;div&gt;
  &lt;iframe src="https://loom.com/embed/ae037232cbcf4a3194762cc44358b988"&gt;
  &lt;/iframe&gt;
&lt;/div&gt;


&lt;p&gt;The reference letter feature, with all twelve supported NOC codes and three-way navigation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6iuacba0tioiefgw356.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd6iuacba0tioiefgw356.png" alt="twelve supported NOC codes" width="369" height="829"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhb3ygghiet1bhqwwcoed.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhb3ygghiet1bhqwwcoed.png" alt="full form screenshot" width="371" height="817"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A real Gemma 4 response from the proof of funds analyzer, flagging microfinance and missing CNPS for a private-sector applicant:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5u3laekixlx91wtl5gxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5u3laekixlx91wtl5gxt.png" alt="POF results screen showing flags, documents list, regional note" width="800" height="671"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbq8u4gnr6x4okc67bzz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvbq8u4gnr6x4okc67bzz.png" alt="POF results screen showing flags, documents list, regional note" width="736" height="751"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/t-yanick/gemma-canada-assistant" rel="noopener noreferrer"&gt;github.com/t-yanick/gemma-canada-assistant&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The README walks through architecture (Next.js 16 App Router, Tailwind v4, three API routes, a shared Gemma client, three system prompts, twelve IRCC-verified NOC entries), setup, and local development.&lt;/p&gt;
&lt;h2&gt;
  
  
  How I Used Gemma 4
&lt;/h2&gt;

&lt;p&gt;I used &lt;code&gt;google/gemma-4-31b-it:free&lt;/code&gt; via OpenRouter throughout the project, with a Google AI Studio API key plugged in as BYOK. Total cost to build, test, and deploy: &lt;strong&gt;$0&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Three things mattered for the project, and Gemma 4 handled all three well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Structured JSON output&lt;/strong&gt;. Every API endpoint in the app expects a typed response from Gemma — &lt;code&gt;RewriteApiResponse&lt;/code&gt;, &lt;code&gt;PofApiResponse&lt;/code&gt;, &lt;code&gt;VisitorVisaApiResponse&lt;/code&gt;. I used Gemma's JSON mode (&lt;code&gt;response_format: { type: 'json_object' }&lt;/code&gt;) and defined the exact schema inside each system prompt. The model returned valid, parseable JSON on the first attempt, the overwhelming majority of the time. For the rare exceptions, the shared client falls back to a defensive parser that strips markdown fences before parsing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Long, rule-dense system prompts.&lt;/strong&gt; Each prompt is roughly 100-150 lines of dense domain knowledge: which Cameroonian institutions are microfinance vs commercial banks, how &lt;em&gt;l'acte d'intégration&lt;/em&gt; differs from CNPS for public-sector workers, which fund sources require seasoning, when an applicant qualifies for exemption. Gemma 4 held all of it across the conversation without drifting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retry-on-5xx for reliability.&lt;/strong&gt; The free Google AI Studio tier occasionally returns transient 500 errors. The shared &lt;code&gt;callGemma&lt;/code&gt; client retries once on 5xx with a 1.5-second delay, which made the difference between a flaky demo and a reliable product.&lt;/p&gt;

&lt;p&gt;A real Gemma 4 response, lightly trimmed, from the POF analyzer for an applicant with funds at Express Union microfinance and cash-paid employment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"exemption_status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"not_exempt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pof_status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"borderline"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pof_amount_check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"The applicant has 25,000 CAD, which exceeds the required 23,360 CAD. However, this is a slim margin; a buffer of 2,000-3,000 CAD is recommended to account for exchange rate fluctuations."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fund_source_flags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"IRCC does not accept funds held in microfinance institutions like Express Union because they are not considered liquid commercial bank accounts. These funds must be transferred to a commercial bank (e.g., Afriland First Bank, BICEC, Ecobank) to be valid."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"employment_legitimacy_flags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Cash payment without CNPS registration is a strong red flag for a private sector worker. IRCC may view this as undocumented or informal employment, which can lead to a rejection of the work experience claim."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"required_documents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Bank letter from a commercial bank on official letterhead, dated within 1 month, stating account number, opening date, current balance, 6-month average balance, and outstanding debts."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"6 months of stamped bank statements from a commercial bank showing salary deposits."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"CNPS attestation to prove legal employment status in the private sector."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"recommended_next_steps"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Immediately open a commercial bank account and transfer the funds from Express Union to begin establishing a 6-month average balance."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Request your employer to provide a formal letter of employment and start registering with CNPS to legitimize your work history."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Begin depositing your cash salary into your new commercial bank account every month to create a paper trail of income."&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"regional_context_note"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"In Cameroon, microfinance and cash-based salaries are common and legitimate ways of managing finances. However, IRCC requires strict adherence to commercial banking standards and social security registration to verify the legitimacy of funds and employment."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That single response identified two refusal-pattern risks, listed the documents the applicant needs, sequenced four concrete next steps, and acknowledged the local context without moralizing about it. The same model, with a generic prompt, would have given generic advice that didn't apply to Cameroon at all. The difference is entirely in the system prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Three things I'd tell another developer building with Gemma 4:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Constrain the output, narrow the decision space.&lt;/strong&gt; Gemma 4 is reliable when you use JSON mode with an explicit schema, and unreliable when you let it improvise. Define the shape you want, define the values it can produce, and the model will stay inside the box.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It's a general-purpose model — domain context goes in the prompt.&lt;/strong&gt; Don't expect Gemma to know your context. Teach it, explicitly. For me, that meant four rounds of iteration: ship a prompt, test with real applicant data, find what the model got wrong by local standards, refine. The fourth round held up against two real anonymized IRCC refusal letters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy it as a second reviewer, not an oracle.&lt;/strong&gt; This tool isn't replacing immigration lawyers — it's catching the kinds of mistakes a human would, if a human had the time and patience to review every applicant's file before submission. Framing it that way changed both the product and how I wrote about it.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>cameroon</category>
    </item>
    <item>
      <title>What Gemma 4 Doesn't Know About Cameroon — and What That Taught Me About Building AI for the Real World</title>
      <dc:creator>Tazoh Yanick</dc:creator>
      <pubDate>Thu, 21 May 2026 10:06:12 +0000</pubDate>
      <link>https://dev.to/tyanick/what-gemma-4-doesnt-know-about-cameroon-and-what-that-taught-me-about-building-ai-for-the-real-3gl2</link>
      <guid>https://dev.to/tyanick/what-gemma-4-doesnt-know-about-cameroon-and-what-that-taught-me-about-building-ai-for-the-real-3gl2</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-gemma-2026-05-06"&gt;Gemma 4 Challenge: Write About Gemma 4&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When my friend contacted me on WhatsApp with a crying 😢 emoji, my heart skipped. I asked what was wrong, and she sent me her Express Entry refusal letter. IRCC had denied her application — no CNPS affiliation, and the funds in her account were held in a microfinance institution, which the officer did not consider transferable. I read the letter line by line. What made it hard wasn't just that she'd been refused — it was that I understood every reason. I'm in the same queue, waiting for my own decision, and over the years I've helped a lot of friends and family enter the pool and fill their ePR applications. If I had seen her application before she submitted it, I could have flagged these things. That thought sat with me for days. When an email from the DEV Community landed about a challenge to build something creative and useful, it was the push I needed.&lt;/p&gt;

&lt;p&gt;So I decided to build a Gemma 4–powered assistant that flags these mistakes before an applicant hits submit. The goal isn't to replace immigration lawyers or consultants. It's to give ordinary applicants — especially people navigating these systems alone — a second pair of eyes before costly mistakes become refusals.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Gemma 4
&lt;/h3&gt;

&lt;p&gt;This project needed a model with structured reasoning capability, able to handle country-specific rules, and cost-effective.&lt;/p&gt;

&lt;p&gt;Gemma 4 was the right fit because it gave very structured JSON output, and could hold long prompts without drifting from the real results.&lt;/p&gt;

&lt;p&gt;I didn't do a technical review with other models, but I read about Gemma 4 and was convinced it could do the job, so I started building.&lt;/p&gt;

&lt;p&gt;It actually mattered that I could run it via OpenRouter for free, because this proves that any developer in a place where resources are limited can conveniently build serious AI apps with Gemma 4.&lt;/p&gt;

&lt;p&gt;On paper, Gemma 4 was the right model. The real test was what it would do when given a Cameroonian applicant's data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Gemma 4 got it wrong
&lt;/h3&gt;

&lt;p&gt;I ran my first test, in which I entered the data and details of a computer science and ICT government secondary school teacher. This is, of course, a typical example of the kind of applicant I have personally helped, so I know what a correct output should look like.&lt;/p&gt;

&lt;p&gt;The output told me to translate any French documents into English. For the Cameroonian context, which was my test data, this is wrong — because Cameroon, just like Canada, is a bilingual country, and documents in French and English are both accepted by IRCC. Worth noting is that Gemma was not stupid. It simply didn't have the local context, because globally speaking, that advice for someone from Cape Verde or Equatorial Guinea is perfect. Gemma applied a firm rule without considering the special status of Cameroon.&lt;/p&gt;

&lt;p&gt;With the same test data, Gemma flagged the teacher for missing CNPS. This was wrong, because civil servants in Cameroon are documented by &lt;em&gt;l'acte d'intégration.&lt;/em&gt; Globally, Gemma's logic was correct, but locally it didn't hold.&lt;/p&gt;

&lt;p&gt;Looking at the output again, it clicked: the two scenarios above were not two separate bugs — it was Gemma using the same reasoning pattern. It reasons well, but it didn't have the Cameroon context. The fix wasn't a better model. It was giving Gemma the context it didn't have.&lt;/p&gt;

&lt;h3&gt;
  
  
  The fix
&lt;/h3&gt;

&lt;p&gt;After my first test, it dawned on me that I had to teach Gemma 4 about the Cameroonian context with regard to what I was building.&lt;/p&gt;

&lt;p&gt;I made Gemma 4 understand there is a real difference between employees of the public and private sectors: civil servants are documented by l'acte d'intégration, while CNPS affiliation applies to private sector workers. I also taught it the bilingual rule — never recommend French-to-English translation, because Cameroon is bilingual, just like Canada. And I taught it to preserve local terminologies like "Lower Sixth" and "Probatoire," because that is what tells IRCC the employment letter duties are not copied verbatim from the NOC code.&lt;/p&gt;

&lt;p&gt;It is worth mentioning that it wasn't a single prompt that produced the best results. Four rounds of testing with a range of data, finding gaps, and refining the prompts is what got us there. For example, a later test surfaced a gap that needed addressing: the microfinance / commercial-bank intermediary funds transferability issue, and the payslip-versus-bank-deposit consistency check.&lt;/p&gt;

&lt;p&gt;Gemma 4 is actually a very capable model. With a precise domain context, it is reliable enough to produce locally correct output. No fine-tuning needed — just precise prompts.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two real refusals
&lt;/h3&gt;

&lt;p&gt;This isn't theoretical. Below are two real IRCC refusal letters from Cameroonian applicants, anonymized for this article.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exhibit A&lt;/strong&gt; — a web designer applying as NOC 21233, cited for three failures: cash payment without CNPS affiliation, payslip amounts not matching bank deposits, and proof-of-funds documents on Norton Financial letterhead carrying UBA's SWIFT code (UNAFCMCX), which the officer read as evidence that the funds were not actually transferable.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flut0uy84c8nku87fo3zq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flut0uy84c8nku87fo3zq.jpeg" alt="Anonymized IRCC refusal letter citing cash payment without CNPS, payslip-deposit mismatch, and a SWIFT code mismatch between Norton Financial Corporation and UBA" width="800" height="574"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exhibit B&lt;/strong&gt; — funds held at LA MEC microfinance with no proof of a commercial-bank pathway, plus an &lt;em&gt;acte de donation&lt;/em&gt; submitted without the donor's bank statements to back it up. The officer concluded the funds were not reliably transferable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4ieoh06qng9b14x2thm.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo4ieoh06qng9b14x2thm.jpeg" alt="Anonymized IRCC refusal letter citing funds at LA MEC microfinance with no commercial-bank pathway, and an acte de donation without donor bank statements" width="800" height="784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every ground cited in both letters — cash payment, missing CNPS, payslip-deposit mismatch, microfinance via commercial-bank intermediary, gift deed without donor records — is flagged by the tool before submission.&lt;/p&gt;

&lt;h3&gt;
  
  
  What this means
&lt;/h3&gt;

&lt;p&gt;Gemma 4 is a capable open model, freely accessible and running on a developer's laptop without infrastructure or budget. As a developer whose laptop is not powerful enough to train models, I was still able to build something unique and useful for my community.&lt;/p&gt;

&lt;p&gt;Nobody in San Francisco was going to build a Cameroon-aware immigration assistant. Not because the developers there are not smart, but because Express Entry refusals in Yaoundé are not a problem they see. The people best placed to build for a niche are the people inside it. Open, capable models make that possible.&lt;/p&gt;

&lt;p&gt;Gemma 4 is for builders everywhere who understand real problems that nobody else is going to solve for them.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>gemmachallenge</category>
      <category>gemma</category>
      <category>cameroon</category>
    </item>
  </channel>
</rss>
