<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[legend4tech: The Engineer’s Journal]]></title><description><![CDATA[Documenting my journey through software engineering, open source contributions, and real-world system architecture. Deep dives into defensive coding, high-concurrency systems, and building products in the wild.
]]></description><link>https://legend4tech.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6ade6a450dd6024af3309f45/f037325e-3872-4d05-8f30-4df7936a3039.png</url><title>legend4tech: The Engineer’s Journal</title><link>https://legend4tech.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 29 Oct 2026 13:46:04 GMT</lastBuildDate><atom:link href="https://legend4tech.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Building BiteHub: Engineering a FoodTech Platform for Africa, From a Spring Idea to ₦350K Processed, and Why We're Bringing Stellar Next]]></title><description><![CDATA[From idea to ₦350k+ processed: How we engineered BiteHub's wallet, defensive security, daily vendor payouts, and upcoming Stellar integration.]]></description><link>https://legend4tech.hashnode.dev/building-bitehub</link><guid isPermaLink="true">https://legend4tech.hashnode.dev/building-bitehub</guid><category><![CDATA[fintech]]></category><category><![CDATA[Foodtech]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[Next.js]]></category><category><![CDATA[software architecture]]></category><category><![CDATA[Stellar]]></category><dc:creator><![CDATA[Ajulu Dennis]]></dc:creator><pubDate>Sun, 25 Oct 2026 22:26:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6ade6a450dd6024af3309f45/57f38739-4ff2-40f2-87a0-fb45dd45709c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Building software in Africa forces you to think defensively.</p>
<p>Copy the Silicon Valley playbook as-is and production will punish you fast. That playbook assumes stable fiber, one IP address per person, card payments that just work, and users who never double-tap a button on a slow 3G connection.</p>
<p><a href="https://www.bitehubapp.com/"><strong>BiteHub</strong></a> is a FoodTech platform built for Africa, starting with Nigeria. Our first market was deliberate: <strong>universities, campuses, and the tight-knit communities around them.</strong></p>
<p>Campuses are a great place to stress-test a product. Thousands of digitally native customers order inside the same two-hour meal windows, over crowded networks, often on shared Wi-Fi, and they expect it to just work. If your system survives a campus lunch rush, it can survive most places.</p>
<p>This is the story so far: how the idea started, what our MVP proved, how we moved real money and paid vendors every single day, the engineering decisions behind our wallet, rewards, and security, and why our next chapter is built on the <strong>Stellar network</strong>.</p>
<hr />
<h2>Part 1: The Timeline</h2>
<h3>March to April 2026: The Idea, and Building Started Right Away</h3>
<p>The problem was everywhere once we started looking. Ordering food in these communities depended on WhatsApp back-and-forth, screenshots of bank transfers, vendors manually checking whether money had landed, and nobody knowing when the food would actually arrive.</p>
<p>Customers didn't trust the process. Vendors didn't trust the payments. Everyone lost time.</p>
<p>We started building almost as soon as the idea took shape.</p>
<h3>May 2026: Making It Official</h3>
<p>Before we let real money flow through the platform, we <strong>registered the company in Nigeria</strong>. If you're going to handle other people's money (customers paying in, vendors getting paid out), you need a proper legal foundation from day one, not as an afterthought.</p>
<h3>June 20, 2026: MVP Launch</h3>
<p>We shipped the MVP with a tight scope:</p>
<ul>
<li>Browse vendors and menus</li>
<li>Place and pay for orders</li>
<li>Real-time order flow between customer, vendor, and delivery</li>
<li>Automated vendor settlement</li>
</ul>
<p>No fluff. The goal was to answer one question: <strong>will people actually use this, and will they pay?</strong></p>
<h3>By September 2026: The Answer Was Yes</h3>
<p>In under three months of live operation:</p>
<ul>
<li><strong>Over ₦350,000 processed</strong> through the platform</li>
<li><strong>95+ orders completed</strong> successfully</li>
<li><strong>Vendors paid every single day</strong>, with no manual chasing and no "I'll send it tomorrow"</li>
</ul>
<p>That last point matters more than any growth metric. In our market, vendor trust is earned slowly and lost instantly. One delayed payout and a vendor goes back to WhatsApp orders. Paying daily, without fail, is what kept our supply side loyal.</p>
<hr />
<h2>Part 2: What the MVP Taught Us</h2>
<p>The MVP validated demand. It also showed us exactly where the friction was.</p>
<p><strong>Ordering food on campus should feel effortless and fun.</strong></p>
<p>Our payment gateway was solid, but having students trigger a fresh bank payment for every single meal didn't match campus life. Students don't just want a payment method—they want an easy way to manage their daily food budget and skip the hassle of constant banking authentications between classes.</p>
<p>We built the wallet to solve for convenience and student lifestyle: pre-fund a meal allowance, checkout in a single tap, and unlock rewards that make ordering food something to look forward to.</p>
<p>That insight led directly to our biggest post-MVP milestone: <strong>the BiteHub Wallet.</strong></p>
<hr />
<h2>Part 3: Paying Vendors Daily, Reliably</h2>
<p>Before getting to the wallet, it's worth explaining how we paid vendors daily without things going wrong. This is the part of the system where a bug costs real money.</p>
<p>At a high level:</p>
<ol>
<li><strong>Every completed, paid order credits the vendor's pending earnings</strong> in our internal ledger, inside the same database transaction that confirms the payment. Either both happen or neither does.</li>
<li><strong>A scheduled job runs daily payouts in one bulk batch</strong> through our licensed payment partner.</li>
<li><strong>Each batch claims its vendors before sending any money.</strong> If two payout jobs ever overlapped because of a retry or a slow network, a vendor can't be picked up by both. Double payouts are ruled out structurally, not just "unlikely."</li>
<li><strong>We only mark as settled the exact orders covered by the amount we paid.</strong> If a new order lands while a payout is in flight, it rolls into the next batch instead of being wrongly marked as paid.</li>
<li><strong>If anything fails, every claimed vendor is released</strong> so the next run can retry cleanly. Nobody gets stuck in limbo.</li>
</ol>
<pre><code class="language-markdown">flowchart LR
    A["Order paid"] --&gt; B["Vendor pending earnings credited (atomic)"]
    B --&gt; C["Daily payout job"]
    C --&gt; D["Claim vendors for this batch"]
    D --&gt; E["Bulk disbursement via payment partner"]
    E --&gt;|Success| F["Settle exact orders covered"]
    E --&gt;|Failure| G["Release claims, retry next run"]
</code></pre>
<p>Boring, predictable money movement is a feature. Vendors don't care about our architecture. They care that the money shows up every day.</p>
<hr />
<h2>Part 4: The BiteHub Wallet</h2>
<p>The wallet changes checkout from "go through a payment flow every time" to <strong>"tap once and you're done."</strong></p>
<h3>How It Works</h3>
<ul>
<li>Every customer gets a <strong>dedicated virtual bank account</strong> linked to their BiteHub wallet, provided through our licensed payment partner.</li>
<li>Customers top up with a normal bank transfer, the way Nigerians already move money every day.</li>
<li>Once the transfer is confirmed, the wallet is credited automatically.</li>
<li>At checkout, the order is paid from the wallet instantly. No redirects and no waiting on OTPs.</li>
</ul>
<h3>Engineering Principles Behind the Wallet</h3>
<p><strong>1. Money is never a floating-point number.</strong> Every amount in BiteHub is stored and calculated in <strong>kobo, as whole integers</strong>. In most programming languages, <code>0.1 + 0.2</code> does not equal <code>0.3</code>. That's fine for a game score and unacceptable in a ledger. We convert to naira only at the very edge, when displaying amounts to people.</p>
<p><strong>2. Two kinds of balance, kept strictly apart.</strong> A wallet holds two separate balances:</p>
<ul>
<li><strong>Deposited funds</strong>: real money the customer put in.</li>
<li><strong>Reward credit</strong>: loyalty value earned on the platform.</li>
</ul>
<p>They're tracked separately because they behave differently. Reward credit can be spent on food, but it isn't cash and can't be withdrawn. Keeping them apart protects the business and keeps accounting honest.</p>
<p><strong>3. Balance checks happen at the moment of deduction.</strong> We don't check the balance and then deduct it in a separate step. That gap is how race conditions create negative balances when someone fires two checkouts at once. The sufficiency check and the deduction happen together inside one transaction. If the money isn't there at that exact moment, the order doesn't go through.</p>
<p><strong>4. Every movement is recorded in the ledger.</strong> Each credit and debit is written as a ledger entry with its reference and the resulting balance. When a customer asks "where did my money go?", we can show every kobo.</p>
<p><strong>5. Funding events are processed exactly once.</strong> Payment providers sometimes deliver the same notification more than once, which is normal on flaky networks. Every funding event has a unique reference, and our database refuses to record the same reference twice. A retried notification can never credit a wallet twice.</p>
<hr />
<h2>Part 5: A Reward System for Loyal Customers, Not Farmers</h2>
<p>Most reward and referral programs in our market get abused. People create dozens of fake accounts, refer themselves, collect signup bonuses, and disappear. The company pays for "growth" that never orders a single meal.</p>
<p>We designed BiteHub's rewards around one rule:</p>
<blockquote>
<p><strong>Reward loyal customers for real actions, not empty sign-ups.</strong></p>
</blockquote>
<h3>What Earns Rewards</h3>
<ul>
<li><strong>Completing real orders</strong>, with optional minimum order values so tiny orders don't game the system.</li>
<li><strong>Referrals that turn into actual customers.</strong> A referral counts only when the referred friend <strong>completes their first order</strong>, not when they create an account.</li>
</ul>
<p>Rewards come as <strong>BiteHub Coins</strong> (reward credit spendable on food) or <strong>free meal vouchers</strong> for specific items from specific vendors.</p>
<h3>How We Keep It Fair and Hard to Abuse</h3>
<ul>
<li><strong>Each qualifying action is counted once.</strong> The same order or the same referred friend can't be counted twice toward a campaign, even if events are retried.</li>
<li><strong>Per-customer limits.</strong> A campaign can be set so each customer completes it only a limited number of times.</li>
<li><strong>Beneficiary caps.</strong> Each campaign has a maximum number of winners.</li>
<li><strong>Hard budget ceilings.</strong> Every coin campaign has a fixed budget, checked atomically before each reward is issued. When the budget runs out, the campaign stops. It can't overspend, even under heavy concurrent traffic.</li>
<li><strong>Coins expire.</strong> Rewards have a shelf life, and when spent, the coins closest to expiring are used first. This keeps reward liability from piling up on the balance sheet forever.</li>
<li><strong>Targeting.</strong> Campaigns can target a specific school or campus, which lets us run local promotions where they matter.</li>
<li><strong>Audit alerts.</strong> Any creation or change to a reward campaign or promo code triggers an immediate security alert to leadership. If anyone, internal staff included, tampers with rewards, we know right away.</li>
</ul>
<p>The result: rewards go to the people who actually keep the platform alive, our loyal, repeat customers.</p>
<hr />
<h2>Part 6: Security, Built In From the Start</h2>
<p>Security isn't a feature we bolted on. It shaped the architecture from day one. Here's an overview of how we approach it, deliberately high-level, because detailed security internals don't belong in a public blog post.</p>
<h3>1. Rate Limiting That Understands Shared Networks</h3>
<p>Standard rate limiting identifies users by IP address. On a campus, <strong>hundreds of students can share a single IP</strong> through hostel Wi-Fi or a campus gateway. A naive IP limiter would treat a busy lunch hour as an attack and lock out a whole hostel of paying customers.</p>
<p>So our rate limiting uses a <strong>layered identity model</strong>. We identify a requester by the most specific signal available and fall back to the network address only when nothing better exists. Attackers still get throttled. Students sharing a router don't get punished for each other's traffic.</p>
<p>We also run these checks <strong>before</strong> any expensive work like database operations. If someone floods us, the flood gets turned away at the door instead of tying up our core systems.</p>
<h3>2. Verified, Idempotent Payment Notifications</h3>
<p>Every incoming payment notification is:</p>
<ul>
<li><strong>Cryptographically verified</strong>, so we know it really came from our payment partner, using constant-time comparison to avoid timing-based attacks.</li>
<li><strong>Processed idempotently</strong>, so the same event delivered twice changes nothing the second time.</li>
<li><strong>Applied inside database transactions</strong>, so a balance update and its ledger record either both happen or neither does.</li>
</ul>
<h3>3. Atomic Money Movement Everywhere</h3>
<p>Wallet payments, vendor earnings, reward issuance, refunds, and stock reservations all run inside <strong>database transactions</strong>. A crash halfway through an operation can't leave money half-moved.</p>
<h3>4. Step-Up Verification for Sensitive Admin Actions</h3>
<p>Some actions are too sensitive to rely on a logged-in session alone, like changing the platform's commission settings. For those, an admin must complete an extra <strong>email-based one-time verification</strong>. The codes are short-lived, stored only in hashed form, and limited in attempts, so they can't be brute-forced.</p>
<p>A stolen admin session alone isn't enough to quietly change how money flows through the platform.</p>
<h3>5. Immutable Financial Records</h3>
<p>Things that touch money and auditing, like promo code identities, are <strong>immutable once created</strong>. Historical orders always point to exactly what the customer used, which matters when reconciling accounts or resolving disputes months later.</p>
<h3>6. Strict Input Validation</h3>
<ul>
<li>Every request is validated against <strong>centralized, strict schemas</strong> before it's processed. Anything malformed gets rejected at the boundary.</li>
<li>User search input is sanitized to prevent injection and pattern-based denial-of-service attacks.</li>
<li>File uploads are limited by <strong>type and size</strong>.</li>
<li>Security headers protect against clickjacking, content sniffing, and unnecessary browser permissions.</li>
</ul>
<h3>7. Secured Background Jobs</h3>
<p>Scheduled jobs (payouts, reward expiry, inventory release, re-engagement) run as authenticated endpoints that verify their callers. Nobody can trigger a payout run just by finding a URL.</p>
<h3>8. Inventory Integrity</h3>
<p>Limited-quantity menu items are <strong>reserved during checkout and automatically released</strong> if payment doesn't complete. Two customers can't both buy the last plate of jollof.</p>
<h3>9. Tests for the Parts That Matter Most</h3>
<p>Our concurrency rules, reward idempotency, and verification flows are covered by automated tests. With money involved, "it works on my machine" doesn't count.</p>
<hr />
<h2>Part 7: The Next Chapter, Bringing Stellar to BiteHub</h2>
<p>Here's where it gets exciting.</p>
<h3>The Problem We Keep Seeing</h3>
<p>A big share of students and young people across Africa are <strong>supported by family abroad</strong>: an older sibling in London, parents in Houston, an uncle in Toronto. Many others have friends who are comfortable with stablecoins and blockchain.</p>
<p>Sending money home to cover something as simple as food is still painful:</p>
<ul>
<li>Traditional remittance fees can take a meaningful cut, especially on small amounts.</li>
<li>Transfers can take hours or days.</li>
<li>Foreign cards often get declined by local payment flows.</li>
</ul>
<p>Someone abroad who wants to make sure a loved one eats well this week shouldn't have to deal with all of that.</p>
<h3>What We're Building</h3>
<p>We're working on bringing the <strong>Stellar network</strong> into BiteHub so customers, and the people who support them, can <strong>fund a BiteHub wallet with USDC on Stellar.</strong></p>
<p>The idea:</p>
<ol>
<li>A family member abroad, or a crypto-savvy friend, sends <strong>USDC on Stellar</strong> to fund a customer's BiteHub wallet.</li>
<li>Behind the scenes, the platform <strong>off-ramps to naira through a licensed anchor such as Busha.</strong></li>
<li>The customer simply sees their <strong>naira wallet balance go up</strong>, ready to spend on food with one tap.</li>
</ol>
<pre><code class="language-mermaid">flowchart LR
    A["Family abroad / crypto-native friend"] --&gt;|"USDC on Stellar"| B["BiteHub"]
    B --&gt;|"Off-ramp via licensed anchor (e.g. Busha)"| C["Naira settlement"]
    C --&gt; D["Customer's BiteHub wallet (NGN)"]
    D --&gt;|"One-tap checkout"| E["Vendor gets paid daily"]
</code></pre>
<h3>Why Stellar</h3>
<ul>
<li><strong>Fast settlement</strong>: transactions confirm in seconds.</li>
<li><strong>Very low fees</strong>: fractions of a cent, so even small top-ups make sense.</li>
<li><strong>Built for real-world money movement</strong>: Stellar has a mature ecosystem of anchors that connect on-chain assets to local currencies.</li>
</ul>
<h3>What Doesn't Change</h3>
<p>The customer experience stays simple: a naira balance and one-tap checkout. The engineering principles stay the same too. Every new funding source goes through the same integer-kobo ledger, the same once-only processing, and the same transactional guarantees as everything else on the platform.</p>
<p>We're not adding blockchain because it's trendy. We're adding it because it solves a real problem for real families: <strong>making sure someone you love can eat, from anywhere in the world, in seconds.</strong></p>
<hr />
<h2>Part 8: Lessons for Anyone Building in Africa</h2>
<ol>
<li><strong>Design for the network you have, not the one you wish you had.</strong> Shared IPs, dropped connections, and duplicate requests are normal here. Plan for them.</li>
<li><strong>Treat every kobo as sacred.</strong> Integer math, atomic transactions, idempotent processing, and complete ledgers. There's no shortcut.</li>
<li><strong>Supply-side trust is everything.</strong> Paying vendors every day did more for us than any marketing campaign.</li>
<li><strong>Reward behavior, not vanity metrics.</strong> If your referral program can be farmed, it will be.</li>
<li><strong>Ship an MVP to learn, then build what the data tells you.</strong> Our wallet exists because the MVP showed us where customers were dropping off.</li>
<li><strong>Secure the inside too.</strong> Threats aren't only external. Step-up verification and audit alerts protect you from mistakes and bad actors alike.</li>
</ol>
<hr />
<h2>Closing</h2>
<p>BiteHub went from an idea in March and April, to a registered Nigerian company in May, to a live MVP on <strong>June 20, 2026</strong>, to <strong>over ₦350,000 processed and 95+ completed orders by September</strong>, with vendors paid every single day.</p>
<p>We're just getting started. Next up: deepening the wallet experience, expanding across more campuses and communities, and connecting African food commerce to the global economy through <strong>Stellar</strong>.</p>
<p>I'll keep documenting the journey here: the engineering, the lessons, the mistakes, and the wins.</p>
<p>If you're building in emerging markets, my advice is simple: <strong>don't build for ideal conditions. Build for the real world.</strong></p>
<p>👉 <strong>See BiteHub live at</strong> <a href="https://www.bitehubapp.com/"><strong>bitehubapp.com</strong></a></p>
<hr />
<p><em>Written by</em> <em><strong>Ajulu Dennis (legend4tech)</strong></em><em>, Founder &amp; Lead Engineer at</em> <a href="https://www.bitehubapp.com/"><em>BiteHub</em></a><em>.Follow the journey on</em> <em><strong>legend4tech: The Engineer's Journal</strong></em>.</p>
]]></content:encoded></item></channel></rss>