<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Darasimi Oni on Medium]]></title>
        <description><![CDATA[Stories by Darasimi Oni on Medium]]></description>
        <link>https://medium.com/@darasimidideoluwa?source=rss-472057fd6a6f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*NjnsXB82zavqzfvk3PHEkw@2x.jpeg</url>
            <title>Stories by Darasimi Oni on Medium</title>
            <link>https://medium.com/@darasimidideoluwa?source=rss-472057fd6a6f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 06:05:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@darasimidideoluwa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why VITS finally solved the robotic voice problem in TTS.]]></title>
            <link>https://medium.com/@darasimidideoluwa/why-vits-finally-solved-the-robotic-voice-problem-in-tts-2cce528f0d77?source=rss-472057fd6a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cce528f0d77</guid>
            <category><![CDATA[research-paper]]></category>
            <category><![CDATA[text-to-speech]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Darasimi Oni]]></dc:creator>
            <pubDate>Fri, 10 Jul 2026 16:54:26 GMT</pubDate>
            <atom:updated>2026-07-12T02:16:42.531Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KT1XsairpiLrtFM2HoKQ7g.png" /></figure><p>The evolution of TTS (Text-to-Speech) models over the past few years has been very exciting because of the battle against bottlenecks. We’ve moved from autoregressive models like Tacotron 2, to the first set of parallel models like FastSpeech that still needed training guidance from autoregressive models. From there, the TTS evolved to parallel models requiring no autoregressive guidance, such as Glow-TTS. That relentless optimization brings us to the model that is fortunately the subject of this article, VITS (Variational Inference with adversarial learning for end-to-end Text-to-Speech).</p><p>Previous models like FastSpeech and <a href="https://arxiv.org/pdf/2005.11129">Glow-TTS</a> required going over two stages: Text to Mel-spectrogram and Mel-spectrogram to Waveform.</p><p>FastSpeech and <a href="https://arxiv.org/pdf/2005.11129">Glow-TTS</a> only have the capabilities to turn a text (phonemes) to a visual representation of how the audio frequencies should look over time. They have no business providing the actual audio.</p><p>An additional model like <a href="https://arxiv.org/pdf/2010.05646">HIFI-GAN</a> is then used to turn these spectrograms into raw audio waveforms. These waveforms can then be played through your computer’s speaker.</p><p>Instead of using a two-stage pipeline where the second model (e.g., HiFi-GAN) has to blindly trust the spectrograms generated by the first model (e.g., Glow-TTS), we need a unified system. That is why VITS was introduced.</p><p>VITS is a parallel end to end TTS model. It does not need to pass through two stages to generate audio waveforms. It also generates natural sounding audio which basically means the audio generated do not sound robotic.</p><p>Now, getting to the nitty gritty of VITS and showing how it is superior to models and methods spoken about before, we will need to talk about three processes namely:</p><ol><li>Conditional Variational Autoencoder (VAE) Formulation</li><li>Alignment Estimation</li><li>Adversarial Training</li></ol><h3><strong>Conditional VAE Formulation</strong></h3><p>An autoencoder is basically a compression algorithm that takes a massive piece of data, compresses it into a latent space and then decompresses it back.</p><p>Now, here is the deal, older models mapped inputs to fixed points in their latent space which made them sound the same even if the same text is generated hundreds of times. E.g. you generate a text “Hello world”, in older models, that will always sound the same way because of the fixed points in the latent space.</p><p>VITS fixed this by making the autoencoder variational. What does this mean? It simply means instead of making points fixed in a latent space, points are distributed in a probability range. Which means on every generation of say, “Hello world”, there will be a different outcome in the way the model speaks</p><p>Imagine you walk into a cafe and tell the attendant to give you any coffee, that is how a standard VAE works. A conditional VAE is one where you tell the attendant to get you a cappuccino (you specified). That is how the conditional VAE works, if you generate speech using VITS, the text you type acts as that specific cappuccino order. The model uses your exact words as a condition to pull the right voice patterns out of its latent space, ensuring it reads your sentence perfectly instead of just making random human noises.</p><p>During this conditional VAE process, <strong>KL-DIVERGENCE</strong> is used to check the difference between the audio used to train the model and the equivalent text of the audio. This ensures the model learns how to predict speech from text.</p><p>The <strong>RECONSTRUCTION LOSS</strong> on the other hand ensures the audio decompressed back as I mentioned while explaining autoencoders, is similar or almost similar to the target human audio. If the output sounds muffled, the Reconstruction Loss penalizes the model, forcing the Decoder to generate sharper, cleaner waveforms next time.</p><h3>Alignment Estimation</h3><p>Now that we have a Conditional VAE framework that understands the relationship between text meaning and voice synthesis, another problem is how the model knows the duration each letter/phoneme should last for. For this, VITS uses two concepts: Monotonic Alignment Search and Stochastic Duration Predictor.</p><p>The job of the Monotonic Alignment Search (MAS) is a straightforward one. During training, it acts as the ultimate matchmaker between the text and the actual human audio file. Since raw training audio doesn’t come with timestamp labels telling the computer how long a word was spoken, MAS figures it out organically. It aligns the text phonemes to the audio frames, calculating exactly how many frames the human held the “H” sound versus the “O” sound in the word “Hello”. The monotonic part means it maps sound moving forward just like how humans read text in order without skipping any words.</p><p>Once MAS extracts these exact, timings during training, it acts as a teacher for the Stochastic Duration Predictor (SDP). Right there in the training loop, MAS hands those calculated durations over to the SDP so it can learn how to map text to timing.</p><p>The stochastic duration predictor is basically responsible for determining how long each word or sound should be spoken. It bridges the gap between text and audio by ensuring the spoken words sound naturally paced rather than perfectly robotic.</p><p>SDP is a flow-based generative model, which means it is just an algorithm that is exceptionally good at taking simple data and twisting it into highly complex distributions and then, the math is completely invertible, meaning the algorithm can run perfectly in reverse.</p><p>Duration gotten from MAS is just a single number (e.g. “O” could be 12 frames) but, flow-based models do their heavy lifting using high dimensional matrix math. You can’t do complex, multi-dimensional math on a single, integer. To solve this problem, VITS applied two engineering tricks namely Variational Dequantization and Variational Data Augmentation which I will briefly explain.</p><blockquote><strong>1. Variational Dequantization: </strong>Neural networks learn by calculating smooth gradients to update their weights. If you feed a network a rigid, discrete whole number like exactly 12 frames, it hits a mathematical cliff. A neural network cannot calculate a slope on a rigid staircase. Variational Dequantization solves this by subtracting a tiny fraction of random mathematical noise from the integer, turning a rigid 12 into a continuous float like 11.6 or 11.8. This essentially gives the algorithm the continuous decimal values it needs to learn smoothly without crashing.</blockquote><blockquote><strong>2. Variational Data Augmentation: </strong>Even after smoothing the integer into a float, duration is still just a single, flat number. High-dimensional flow-based matrices cannot twist, flip, or transform a single point. Variational Data Augmentation solves this by generating an array of random mathematical noise and adding it directly to the duration value. By concatenating this noise, the flat number suddenly gains extra dimensions (from 1D to nD). It expands the data into a larger, multi-dimensional array, giving the flow-based algorithm the spatial volume it requires to execute its complex matrix transformations.</blockquote><h3>Adversarial Training</h3><p>Now, there is a model that takes in data, compresses it into a probabilistic latent space, decompresses it and uses the <strong>Reconstruction</strong> <strong>Loss </strong>to ensure what is decompressed sounds sharp and better. Here is the problem, trusting Reconstruction loss alone is not so great because this is a mathematical formula that could still output audio that sounds muffled.</p><p>This is where Adversarial Training comes in. It forces the audio gotten to sound very human-like by using a discriminator that distinguishes between the output generated by the Generator (decoder) and the ground truth waveform.</p><p>Both Generator and Discriminator are neural network models and not mathematical equations like the Reconstruction Loss. The generator and discriminator play a cat and mouse game, always trying to outsmart each other.</p><blockquote><strong>The Generator:</strong> In the VITS architecture, the Generator is actually your Decoder. Its primary job is to take the latent text and rhythm data and synthesize a raw audio waveform. Why? Its entire purpose is to create an audio file so undeniably crisp and realistic that it successfully tricks the Discriminator into classifying it as a real, living human voice.</blockquote><blockquote><strong>The Discriminator:</strong> This is a completely separate neural network whose only job is to be an audio critic. It listens to a mix of actual human audio recordings and the fake audio produced by the Generator. Why? It actively hunts for the tiny, robotic imperfections and muffled frequencies that standard Reconstruction Loss ignores. Every time it successfully catches the Generator’s fake audio, the Generator gets a mathematical penalty and is forced to update its weights to do better next time.</blockquote><p>With this back and forth from both generator and discriminator, we see how VITS slowly eliminates robotic sounds from the audio.</p><p>Generally, it is seen as the entire architecture of the VITS is to create very human like audio without the need for two stages as required in older models.</p><p>But if there is one thing I have learnt from these TTS models, it is that they are perfect for mainstream Western languages and accents out of the box. When it comes to representing the rich, distinct cadences of African voices like the Nigerian accent, off-the-shelf architectures hit a wall.</p><p>Standard phonemizers and pre-trained datasets are heavily biased toward American or British English. Nigerian English has its own unique phonetic rules, tones, and a completely different rhythm. If you just feed Nigerian text into a VITS model, the Text Encoder and Stochastic Duration Predictor will try to force a Western cadence into it, resulting in an output that sounds completely unnatural which is an ultimate bottleneck.</p><p>To achieve the desired audio output, developers should intervene. We have to tweak the pipeline by curating localized, high-quality audio datasets, writing custom phoneme dictionaries that map to how words are actually pronounced locally, and fine-tuning the alignment so the model learns the true rhythm of the culture.</p><p>Just incase you want to go over the paper, here is a link — <a href="https://arxiv.org/pdf/2106.06103">https://arxiv.org/pdf/2106.06103</a>.</p><p>Obrigado.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cce528f0d77" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[This Life Thing, eh.]]></title>
            <link>https://medium.com/@darasimidideoluwa/this-life-thing-eh-fc1a34c720d9?source=rss-472057fd6a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc1a34c720d9</guid>
            <category><![CDATA[edtech]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[startup-lessons]]></category>
            <category><![CDATA[lean-startup]]></category>
            <dc:creator><![CDATA[Darasimi Oni]]></dc:creator>
            <pubDate>Tue, 30 Dec 2025 18:31:49 GMT</pubDate>
            <atom:updated>2026-07-10T08:30:35.746Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4M2mh3zBX2JaMD9_GSCfA.png" /></figure><h3>Pressure? What pressure??</h3><p>If you had walked into the person’s room on the first day of january, you would have found a couple of cues that this is indeed their year to get things right. Although, they got into the year not expecting so much. Maybe it was a fear of self-applied pressure. Or maybe it was just their reality. It’s hard to tell the difference when you’re in the middle of it.</p><p>Not expecting much didn’t mean they did not have goals. As I said, they were subconsciously trying not to put so much pressure of themselves. It was clear from the start, they just wanted to explore and try new stuff because I mean, it is a new year. They wanted to try to love again, build intriguing things, figure solutions to problems, face fears, be better at life, help friends and most importantly, be that ever present person to family and friends.</p><h3>The Accidental Architect</h3><p>Second week into the year, a close companion of theirs came up with this great idea about running a startup. They had not thought of starting off their own startup before this encounter. This first came off as “Can I really do this” but I mean, it won’t hurt to try. yes?.</p><p>That decision to help out with the technical side of the startup was the beginning of everything that happened most of the year. In less than 3 months, the first MVP was up with a few users and reviews. This only meant one thing to them which is “You can just do great stuff because the potential is in you.” After that was established, they were just eager to build stuff and solve problems because I mean, they found this somewhat comfortable to go around so they just went on and on.</p><h3>All Time High!</h3><p>It’s May already and by this time, they had gone about their life building different projects and having fun. By this time, they had about 3, 4, or even 5 projects pushed out with positive feedback and, on top of that, active users. They woke up every day feeling happy, as one of their goals this year was to find solutions to problems and they had started doing this already.</p><p>Living the life with everything looking great, it became greater as they felt a heightened emotional clarity. Amidst the noise of building a startup and shipping code for personal projects, one person became a steady signal. The choice to move from “seeing where this goes” to “this is my person” was the easiest decision of the year. They weren’t just exploring the idea of love anymore, they were living it, anchored by a partner who made the pressure of the world feel a lot lighter.</p><p>But life has a way of balancing the scales just when the view from the top looks permanent. Right in the middle of this winning streak, they hit their first real wall. A rejection from an accelerator program<strong>.</strong> It was the first “L” of the year. After months of “Yeses”, this “No” stung differently. It was a reminder that while they were capable, the road to building something great wasn’t going to be a straight line of constant ascent.</p><h3>Not Quite</h3><p>Few weeks after the first “L”, they had to pick themselves up, it is not any good to dwell in such. Instead, make that L which initially should mean ‘loss’ to a ‘lesson’ to learn from. It is time to focus on what the main challenges could be, they said to themselves. It was at that point they learnt their first lesson of the year — The best products to build aren’t the “nice to have” but the “Must have” products. That alone, made them move differently when it came to tinkering problems to solve.</p><p>Another lesson they learnt is to study their current ecosystem or the ecosystem/region the product is built for. Building for Africa has a whole lot of disadvantages. Stemming from the economy, to willingness of people to pay for products (Especially B2C).</p><p>Cost of operations at a very early stage should also be considered and a great lesson they learnt. Given a very early stage startup, the founders most likely don’t have hundreds of thousands of dollars to keep operations running. Starting pretty lean makes that easier. You can build the very very very lean mimimum viable product, minimize cost, maximum of three people working on this product (this way, you don’t worry about paying salaries yet).</p><p>They also embraced a fundamental startup truth which is getting the MVP into as many hands as possible, as fast as possible. You have to know if you’re building a monument or a sandcastle before you invest more time and effort into the project.</p><h3>Recoup</h3><p>By this time, it’s August. Wow!, they wonder how many months have gone by but it’s been quite an adventurous year so it feels only fair that time has moved so quickly. They finally crossed the bridge from ‘potential’ to ‘partnership’ with the person they had built a heightened emotional connection with. In fact, that kicked off the month.</p><p>Settling into the new period of life they were in did not mean they stopped thinking. In fact, they had started thinking better at this point, given they had quite a lot to learn from their previous endeavour. They started skimming through different ideas and solutions to problems around them and also to problems close friends/companions faced. With the help from their partner, it was quite easier to throw ideas around and filter out the feasible ones and also make sure these aren’t just “nice to have” solutions but “must have” as they had previously learnt from their last major project.</p><p>After lots of skimming and tinkering, they finally settled on an Edtech problem to solve which had an initial idea of helping students create their own tutorial videos. Also, to make the product lean, fast to build and narrow down to a specific market, they decided to focus on just SAT students and also turn it to an interactive tutor for students (They can create their own interactive video tutorials) primarily building for the US market.</p><p>At this point, it wasn’t about building for an accelerator anymore. It was about the personal challenge of finding a solution that mattered but as things went down, they were once again interested in building this for an accelerator which they applied to as this project checked most of the boxes the former didn’t.</p><p>While all this was going with the new project, they had to quit a full time job because the work wasn’t exciting and intriguing anymore. Of course, this took a toll on them as they had to fully focus on freelancing and got a couple of gigs through referrals from close companions.</p><h3>Outcome</h3><p>Whilst waiting to get a response from the accelerator program they applied to, they kept on reiterating on the project, working on updates, pitching to potential investors and also gathering beta customers to use the mvp. It was around this time they came across the next big challenge — Marketing.</p><p>Nobody really talks about how difficult marketing is till one has to do that themselves. The main problem they faced in that phase was marketing the product and also getting across to the target audience in which all the strategies they had were not working. This really took a toll on them and then, confusion set in. They wouldn’t have believed they would come across this challenge at the beginning of the year but here they were, super confused. Around that time, they received another “L” which was another rejection from the accelerator program.</p><p>Just because they had initially set out on this project without the intention of building for an accelerator, it was quite easy to bounce back and also, learn from this as they always do.</p><p>Now, it’s clear as day that there is one thing to set out for — focusing on marketing and trying to get people to use this product. At the same time, they had started feeling a bit burnt out from all that had happened all year and I guess they needed a bit of rest and focus on how to improve in marketing and other strategies they were not familiar with early on.</p><p>Regardless of the challenges that they faced this year, one thing stood out for them which was finding the potential to build intriguing software not only them but other people believed in, figure solutions to problems, love someone right enough for them to be a partner, face the fear of building startups, help friends in any way possible and lastly, be present for both family and friends. These were top priority goals for them and they could accomplish all of that. This only means it was a 10/10 year!</p><p>From a challenge, another one came up and what else can be said than for that to be a goal for the next year.</p><h3>Conclusion</h3><p><em>What is to come next year for them? Really?</em></p><p>This should be straight forward. They spent this year dabbling around different ideas/projects and building different MVPs. Next year won’t be different in the aspect of building but rather than build a whole lot of stuff, they would focus on a very critical problem, dive deep into the problem, try to find the smallest loophole in an industry, find the best way it impacts the end users.</p><p><em>What do they feel about EdTech? </em>Honestly, an amazing space but they’ll rather go from building a tool that just helps students pass exams because that is the most obvious thing an EdTech software will solve but lately, they don’t believe in that anymore.</p><p><em>What do they believe now?</em> Ah, the educational system tests for who can cram best and that is not education. Impact is education and that is what should be tested. What is believed now is Edtech tools should help a student learn better, faster and impactful and not just to pass exams. Maybe, there should be another dedicated article for that because it is a long discussion.</p><h3>Projects worked on this year:</h3><ol><li><a href="https://tealy.ai/">Tealy</a></li><li><a href="https://uselumine.com/">Lumine</a></li><li><a href="https://wordguess.xyz/">Word Guess</a></li><li><a href="https://www.lettersoflove.xyz/">Letters Of Love</a></li><li>Researcher —An agentic search API that finds, extracts, and structures web data and then, inserts it directly into your database. (Not public yet)</li><li><a href="https://chromewebstore.google.com/detail/summarize-it/iedpejpokkbafbeicakapljceblgegpj?authuser=0&amp;hl=en-GB">Summariza</a></li><li><a href="http://tiny-me.netlify.app/">Tiny Me</a></li><li><a href="https://novoinno.com/">Novoinno Website</a></li><li><a href="https://app.novoinno.com/">Novoinno Dashboard v2</a></li></ol><h3>Documentaries Watched this year:</h3><p><em>Didn’t watch a whole lot of documentaries this year, but here are a few —</em></p><ol><li><a href="https://www.netflix.com/ng/title/81700898?s=i&amp;trkid=264265097&amp;vlang=en">American Manhunt: Osama bin Laden</a></li><li><a href="https://www.netflix.com/us/title/81303911?s=i&amp;trkid=260908269&amp;vlang=en&amp;trg=cp">World War II: From the Frontlines</a></li><li><a href="https://www.netflix.com/us/title/80178151?s=i&amp;trkid=260908269&amp;vlang=en&amp;trg=cp">The Spy</a></li><li><a href="https://www.netflix.com/us/title/81906780?s=i&amp;trkid=260908269&amp;vlang=en&amp;trg=cp">Sean Combs: The Reckoning</a></li><li><a href="https://youtube.com/@johnnyharris?si=yRZIX56jXeKRcFsZ">A whole lot from Johnny Harris</a></li><li><a href="https://www.youtube.com/@neoexplains">Quite a few from NeoExplains</a></li><li><a href="https://www.youtube.com/@fern-tv">Fern TV</a></li></ol><h3>Podcasts Listened this year</h3><ol><li><a href="https://open.spotify.com/show/3AGe43ZNWzBplppVCmPc2b?si=HqLkJUVmR5m1zGedcqQP2g">I said what I said</a></li><li><a href="https://open.spotify.com/show/2uNRw32FZSvTwy1VfOm8fe?si=HHek1duZS3G-XRYHtrvAkQ">So Nigerian</a></li><li><a href="https://open.spotify.com/show/7qZAVw03FuurfYnWIWwkHY?si=f84a685b6dcc40a8">Naval</a></li><li><a href="https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX?si=a21fb28978a14127">The Diary Of A CEO</a></li><li><a href="https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk?si=f72e5a36e6a84998">The Joe Rogan Experience</a></li><li><a href="https://open.spotify.com/show/2uNRw32FZSvTwy1VfOm8fe?si=c0308329c81c4365">Africa and Everywhere</a></li><li><a href="https://open.spotify.com/show/6RTnICKr8KoafopcFoOLqR?si=1085643f4a7a46c0">I Guess I’m an Adult Now</a></li><li><a href="https://open.spotify.com/show/6mqxaJRYDqs1zzWgAx58KV?si=f825701167fc4fdb">Amazing War Stories</a></li><li><a href="https://open.spotify.com/show/5OAZSpE4pTg7zf8ZcCJqQQ?si=64619aec10034a7f">Special Forces In World War 2 Podcast</a></li></ol><h3>The People Who Made the 10/10 Possible</h3><p>No one builds in a vacuum, and this year wouldn’t have been what it was without the people who held me down.</p><p>To the person who sparked the <strong>“Accidental Architect”</strong> in me — <strong>Kolapo</strong>; to my sister <strong>Jadesola</strong>; to <strong>Doyin ❤️</strong>, my steady signal; to the “encouragement engine” <strong>Ayowande</strong>; and to <strong>Lara, Jolaoluwa, Gloria, Toluwanimi, Kachi, Gboyega, Charles, and Alex</strong> — I appreciate you all!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc1a34c720d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Update on my shenanigans: April 13, 2025]]></title>
            <link>https://medium.com/@darasimidideoluwa/update-on-my-shenanigans-april-13-2025-fcf686e18117?source=rss-472057fd6a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcf686e18117</guid>
            <category><![CDATA[random]]></category>
            <category><![CDATA[feelings]]></category>
            <category><![CDATA[yap]]></category>
            <dc:creator><![CDATA[Darasimi Oni]]></dc:creator>
            <pubDate>Sun, 13 Apr 2025 16:25:56 GMT</pubDate>
            <atom:updated>2026-07-10T08:33:20.974Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMGQqxysiTWMnimQthKKcA.png" /></figure><p>It’s Sunday morning. I’ve had some slices of bread and drank a bottle of water. Probably still dark out, I haven’t actually looked. Most importantly, it’s been a solid month of this word “iterating” banging around in my head. I have a lot to say, mostly because I’m trying to get these thoughts into writing.</p><p>Sometime last month, I randomly came across a <a href="https://youtu.be/iHvl6ls6QBY?si=E2mOKdp4gmYK-qeg">Naval podcast</a> clip. He was talking about iteration driving the learning curve and nailing the difference between that and just repetition. And honestly, after he contrasted them, I could literally see it. (Here’s that <a href="https://youtu.be/iHvl6ls6QBY?si=E2mOKdp4gmYK-qeg">link</a> again).</p><p>Anyway, “iteration” has just been stuck on repeat in my head since then. Then, earlier this week, I woke up, had some “me time,” and it hit me: <strong>“What even <em>is</em> growth?”</strong> I used to bug my friends with this one, but stopped because nobody, including me, had a perfect answer. But I think I cracked it this week… My answer now? <strong>ITERATION.</strong> Seriously, it just clicks now. You might be lost, so just walk with me, I’d give you a little illustration.</p><blockquote>Picture two friends, Tolu and Ada, starting a lemonade stand.</blockquote><blockquote><strong>Day 1:</strong> They make one huge batch. It’s <em>way</em> too sour, zero sugar. Hardly anyone buys. They hear folks saying, “Too sour!”</blockquote><blockquote><strong>Iteration Kicks In…</strong></blockquote><blockquote><strong>Day 2:</strong> They tweak the recipe — add sugar. More people buy! One person mentions, “Nice, but it’s kinda warm.”</blockquote><blockquote><strong>Day 3:</strong> They adapt again — add ice. Even <em>more</em> people buy. Someone suggests, “I’d totally buy more if you took mobile payment.”</blockquote><blockquote><strong>Day 4:</strong> They jump on it — start taking mobile transfers. Sales go wild. A customer tweets about them. Boom — now they’re trending.</blockquote><p>See? They didn’t just repeat Day 1. They listened, changed things up, iterated. That’s how they grew.</p><p>If you’d asked me what growth was 2 or 3 years back, I’d have said landing that big role at some big company. And to be fair, that’s still valid! But I always kinda knew deep down that wasn’t the whole picture. Looking at Tolu and Ada, I don’t feel I need to spell out how growth and iteration are linked. But here’s where it gets tricky, and you might ask, <strong>“Okay, but how do I know <em>I’m</em> actually growing?”</strong></p><p>This is the “aha!” moment, leading to another thing I bumped into. (Just chill, I promise I’ll try and link this).</p><p>I was reading “So Good They Can’t Ignore You” last week. The intro part basically tells you <em>not</em> to follow your passion — super controversial, I know (do your own research on that, not diving deep here). The book pushes trying stuff and finding passion in what you get good at instead. So, how does this fit in?</p><p>Well, thinking about it… you know you’re growing (iterating effectively) when you actually see yourself getting better, even just a tiny bit, at whatever you’re doing. This kind of loops back to self-awareness, right? You need to be tuned in enough to notice what needs changing (like Tolu and Ada hearing “too sour”) and then also notice when your changes make things better. Maybe that’s where the passion part from the book comes in — finding it as you get better through conscious iteration?</p><p>So yeah, I guess I’m trying to say: you know you’re growing when there’s iteration happening. And you know there’s iteration when you’re <strong>self-aware</strong> enough to actually notice what’s going on around you and within your own progress.</p><p>I really want to talk more on this, but that’ll have to be next time I get this urge to write. My next post will probably be about Vectors and me seriously wishing I’d paid more attention back in the day. To be fair, that’s what I originally wanted to ramble about today, but that’ll be another time!</p><p>It’s been a wild and super exciting month of thinking, though. I’m on my first semester break, pretty much just been indoors working on some stuff that should be out soon. Super excited to share when it’s ready.</p><p>For now, just keep iterating, people. We’re not getting any younger!</p><p>Outro music —<a href="https://open.spotify.com/track/3BUWNzPWz2mDbptZmGEXpB?si=HhEEz1UFTnGb7ls6_oGvEw&amp;context=spotify%3Aalbum%3A50yFYgKdwJANZ5O9MIbMkg"> Let It All Work Out</a></p><p>Thanks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcf686e18117" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy your server-side code with serverless functions using Firebase Cloud Functions]]></title>
            <link>https://medium.com/@darasimidideoluwa/how-to-deploy-your-server-side-code-with-serverless-functions-using-firebase-cloud-functions-4e20a5d6db59?source=rss-472057fd6a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e20a5d6db59</guid>
            <category><![CDATA[firebase-cloud-functions]]></category>
            <category><![CDATA[node-js-tutorial]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Darasimi Oni]]></dc:creator>
            <pubDate>Tue, 24 Dec 2024 00:00:09 GMT</pubDate>
            <atom:updated>2024-12-24T00:00:09.960Z</atom:updated>
            <content:encoded><![CDATA[<h4>Have you been struggling since Heroku ended their free tier? I’ve found a practical solution: serverless functions. Not only can you deploy your applications without cost, but you can also set up automated scheduled tasks (cron jobs) to run periodically. This guide will help you transition from traditional server hosting to a serverless architecture.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*EB9Fotq8RLxoK64C6NRPeg.png" /></figure><h3><strong>What are serverless functions?</strong></h3><p>In simple terms, serverless functions are small pieces of code that run on the cloud without the need for you to maintain the server. Try to think of it like this: Siri (your function) is always ready to help, but it doesn’t stay active all the time. It only <em>activates</em> when you call it, and then, it turns off when you’re done. That’s exactly how serverless functions work.</p><p>For example, we have a simple code to fetch a few states in Nigeria:</p><pre>const express = require(&#39;express&#39;);<br><br>const app = express();<br><br>const states = [<br>  &quot;Abia&quot;, &quot;Adamawa&quot;, &quot;Akwa Ibom&quot;, &quot;Anambra&quot;, &quot;Bauchi&quot;, &quot;Bayelsa&quot;, &quot;Benue&quot;<br>];<br><br>app.get(&#39;/states&#39;, (req, res) =&gt; {<br>  res.json({ states });<br>});<br><br>const PORT = process.env.PORT || 8080;<br>app.listen(PORT, () =&gt; {<br>  console.log(`Server running on http://localhost:${PORT}`);<br>});</pre><p>From the above code, you can deduce that I only need this server to respond when I want to send the list of states. This means I don’t need the server to always be active 24/7, which makes sense.</p><p>I just need the server to be “awake” whenever I want to send a response. Serverless functions don’t experience idle timeout delays, ensuring quick response times. Examples of platforms that offer serverless functions include AWS Lambda, Vercel, Netlify, and Firebase. For this article, we’ll be focusing on Firebase.</p><h3><strong>Getting started with Firebase Cloud Functions (Serverless functions).</strong></h3><p>Set up your firebase account on the firebase console <a href="https://console.firebase.google.com/">here</a>. After setting your account, create a project on the console. Once you are done setting up your firebase project, you’ll need to upgrade from <strong>Spark </strong>which is the free firebase plan to <strong>Blaze</strong> — a pay as you go plan which is relatively cheap (Check firebase pricing <a href="https://firebase.google.com/pricing?hl=en&amp;authuser=0&amp;_gl=1*xw052d*_ga*MTA2MzMxNjkwNi4xNzExMzcyOTE3*_ga_CW55HF8NVT*MTczNDUxNDE5My40OC4xLjE3MzQ1MTU3MTguNTcuMC4w">here</a>).</p><h3>Creating your functions</h3><p>After setting up your firebase account, creating your project and switching to Blaze plan, you will need to login to firebase from your command line by running the command below</p><pre>firebase login</pre><p>You will be redirected to your browser to complete the authentication.</p><p>Next, navigate to the directory where you want to create your new function project. Then, run the following commands in your terminal to install Firebase Admin and Firebase Tools globally, and initialize Firebase. <strong>If you’re using a Mac, you might need to prefix the commands with </strong><strong>sudo.</strong></p><pre>npm install firebase-functions@latest firebase-admin@latest — save<br>npm install -g firebase-tools<br><br>firebase init</pre><p>Select the “Functions: Configure a Cloud Functions directory and its files” option from the prompt you will get after running the command <strong>above</strong></p><pre>Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to confirm your choices. (Press &lt;space&gt; <br>to select, &lt;a&gt; to toggle all, &lt;i&gt; to invert selection, and &lt;enter&gt; to proceed)<br> ◯ Data Connect: Set up a Firebase Data Connect service<br> ◯ Firestore: Configure security rules and indexes files for Firestore<br> ◯ Genkit: Setup a new Genkit project with Firebase<br>❯◯ Functions: Configure a Cloud Functions directory and its files<br> ◯ App Hosting: Configure an apphosting.yaml file for App Hosting<br> ◯ Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys<br> ◯ Storage: Configure a security rules file for Cloud Storage</pre><p>You will then select the project you created earlier on the terminal and initialize a new codebase.<br>After that, you will see a <strong>function</strong> folder created for you in your directory which shows the project was linked successfully. <strong>PS: Make sure you are on the latest Node version</strong></p><p>After successfully linking the firebase project to your new function project, you can import `firebase-functions/v2` in your base file of your project (app.js or index.js)</p><pre>// app.js<br><br>const functions = require(&quot;firebase-functions/v2&quot;); // second generation of firebase cloud function</pre><p>Next, you add a line below at the bottom of your code</p><pre>const app = express(); // create the express app<br><br>exports.api = functions.https.onRequest(app);</pre><p>Which basically means we are making a <strong>Named Export </strong>which means after importing functions from `firebase-functions/v2`, we get https and inside https, we get onRequest function where we pass app (which means our express app). This means that when there is a request, the serverless function runs the app instance.</p><p>For example, when the serverless function url with the /state route is run, the method we wrote earlier that sends the states as a response will run and return a response.</p><h3><strong>Running Schedules (Cron Jobs) on Firebase Cloud Functions</strong></h3><p>Since serverless functions are not always active, they can’t run cron jobs in the traditional way. However, Firebase offers a simple solution that mimics this familiar process.</p><pre>cron.schedule(<br>  &quot;0 12 * * *&quot;,<br>  () =&gt; {<br>    deleteData();<br>  },<br>  {<br>    scheduled: true,<br>    timezone: &quot;UTC&quot;,<br>  }<br>);<br><br>// run the deleteData function 12pm everyday</pre><p>The only difference is that we import onSchedule from firebase-functions (2nd generation again) and run our schedule like this<br>const { onSchedule } = require(“firebase-functions/v2/scheduler”);</p><pre>exports.schedule = onSchedule(&quot;0 12 * * *&quot;, async (event) =&gt; {<br>  deleteData();<br>  return null;<br>});</pre><p>You can either write these lines of code in your base file or create another file for it and import it in your base file.</p><p>After this, you need to make another named export for our schedule.</p><pre>exports.schedule = cronJobs.schedule; // if you import from an external file<br></pre><h3>Here is what your final code looks like</h3><pre>const express = require(&#39;express&#39;);<br>const functions = require(&quot;firebase-functions/v2&quot;);<br>const { onSchedule } = require(&quot;firebase-functions/v2/scheduler&quot;);<br>const { deleteData } = require(&quot;../services/delete.services&quot;);<br><br>const app = express();<br><br>const states = [<br>  &quot;Abia&quot;, &quot;Adamawa&quot;, &quot;Akwa Ibom&quot;, &quot;Anambra&quot;, &quot;Bauchi&quot;, &quot;Bayelsa&quot;, &quot;Benue&quot;<br>];<br><br>app.get(&#39;/states&#39;, (req, res) =&gt; {<br>  res.json({ states });<br>});<br><br>exports.schedule = onSchedule(&quot;0 12 * * *&quot;, async (event) =&gt; {<br>  deleteData();<br>  return null;<br>});<br><br>const PORT = process.env.PORT || 8080;<br>app.listen(PORT, () =&gt; {<br>  console.log(`Server running on http://localhost:${PORT}`);<br>});<br><br><br>exports.api = functions.https.onRequest(app);</pre><h3>Deploying Your App</h3><p>Now that we have created our functions and given them a named exports, the next thing to do is deploy this to firebase so we can start using the serverless functions.<br>To deploy to firebase we just need to run a simple command on the terminal which is:</p><pre>firebase deploy<br>or<br>sudo firebase deploy  // for mac users</pre><p>After running that, your app gets deployed successfully after a few minutes.</p><h3>Checking Your Functions on Firebase Console</h3><p>When you successfully deploy your app, a url to the firebase cloud functions page is provided just immediately after the “Deploy complete!” message.</p><p>If you don’t see the url, you can go back to your firebase project on the console <a href="https://console.firebase.google.com/">here</a> and check the left-hand navigation menu, click on “<strong>Build</strong>” and then select “<strong>Functions</strong>” under it.</p><p>This will take you to the Cloud Functions page, where you can view, manage, and monitor your deployed serverless functions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e20a5d6db59" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>