<?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 Faith Kariuki on Medium]]></title>
        <description><![CDATA[Stories by Faith Kariuki on Medium]]></description>
        <link>https://medium.com/@techtinkerbell?source=rss-47fc24d3353a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*IJjBICI7Hus60-v4</url>
            <title>Stories by Faith Kariuki on Medium</title>
            <link>https://medium.com/@techtinkerbell?source=rss-47fc24d3353a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 06:25:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@techtinkerbell/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[Understanding Asynchronous Programming in Flutter]]></title>
            <link>https://medium.com/@techtinkerbell/understanding-asynchronous-programming-in-flutter-8b669273e395?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b669273e395</guid>
            <category><![CDATA[asyncawait]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[future]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 24 Jan 2026 13:20:39 GMT</pubDate>
            <atom:updated>2026-01-24T13:21:33.573Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zGTSjg9Op4TZh-EF" /><figcaption>Photo by <a href="https://unsplash.com/@afgprogrammer?utm_source=medium&amp;utm_medium=referral">Mohammad Rahmani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When I started learning Flutter two weeks ago, I expected asynchronous programming to feel familiar. After all, I come from a background of working with JavaScript, Django, and APIs. Concepts like async, waiting for data, and non-blocking operations weren’t new to me.</p><p>In this post, I’ll share how I currently understand asynchronous programming in Flutter and hopefully make it click for you.</p><p><strong>What does “Asynchronous” mean in Flutter?</strong></p><p>In simple terms, asynchronous programming allows Flutter to <strong>do more than onr thing at a time without freezing the app</strong>.</p><p>In a flutter app, the UI should remain responsive, long tasks (like fetching data from an API) should not block the main thread and the app should be able to wait for results without crashing or hanging.</p><p>Instead of stopping everything to wait for data, asynchronous programming enables the app to continue with other work while waiting for the result.</p><p><strong>The role of </strong><strong>Future in Dart</strong></p><p>A Future represents <strong>a value that will be available later.</strong></p><p>For example data fetched from an API, a response from the database or a delayed action.</p><p>When a function returns a Future, it shows that the data is not available yet but promises it will be.</p><p><strong>async and </strong><strong>await : Making Code Readable</strong></p><p>The async and await keywords help us work with Future s in a readable way. async marks a function as asynchronous while await pauses <em>execution inside that function</em> until the Future completes.</p><p>One thing I noted is that if a function is marked async , it will awalys return a Future .</p><p>This explains why return types suddenly change and why Flutter complains if you forget to handle them properly.</p><p><strong>Why Asynchronous Code Matters for the UI</strong></p><p>Flutter apps are UI-driven. If you block the UI thread while waiting for data; The screen freezes, animations stop and the app feels broken.</p><p>Asynchronous programming prevents this by allowing Flutter to render widgets, handle user interactions and show loading states.</p><p><strong>My Takeaway After Two Weeks of Flutter</strong></p><p>Asynchronous programming is not just a feature in Flutter, it’s a <strong>core concept</strong>.</p><p>I’m still early in my Flutter journey but understanding asynchronous processes has already made me more confident building real-world features like data fetching, loading states and responsive UI. If you’re new to Flutter and async feels overwhelminb right now, keep building, keep breaking things and let the concepts sink in with practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b669273e395" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Flutter & Dart: What I’ve Learned as a Beginner]]></title>
            <link>https://medium.com/@techtinkerbell/getting-started-with-flutter-dart-what-ive-learned-as-a-beginner-c7be7b2647a6?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7be7b2647a6</guid>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 13:06:30 GMT</pubDate>
            <atom:updated>2026-01-17T13:06:30.345Z</atom:updated>
            <content:encoded><![CDATA[<p>When I decided to start learning <strong>Flutter and Dart</strong>, I was curious, excited, and honestly a little nervous. Coming from a background where I had mostly worked with web and backend technologies, stepping into <strong>mobile app development</strong> felt like entering a whole new world.</p><p>In this post, I want to share what I’ve learned so far as a beginner and not as an expert or instructor, but as someone currently walking the path. If you’re just starting out with Flutter, I hope this helps you feel less alone and more confident.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*0JLrb2XC1cctNt1gAjjhiw.jpeg" /></figure><p><strong>Why I Chose Flutter</strong></p><p>Flutter stood out to me for a few key reasons:</p><ol><li>It allows you to build <strong>Android (and iOS) apps from a single codebase</strong></li><li>It’s backed by <strong>Google</strong></li><li>The UI looks beautiful and smooth</li><li>Many developers described it as beginner-friendly</li></ol><p>I also liked the idea of expanding beyond web and backend development and learning how mobile apps actually work under the hood.</p><p><strong>Flutter and Dart — In Simple Terms</strong></p><p>Before diving in, I had to understand what Flutter and Dart actually are.</p><p><strong>Flutter</strong> is a UI framework used to build mobile applications while <strong>Dart</strong> is the programming language used to write Flutter apps.</p><p>What surprised me was how clean Dart’s syntax feels. If you’ve worked with JavaScript or Python before, Dart doesn’t feel alien. It supports async programming, has strong typing, and reads nicely once you get used to it.</p><p><strong>Setting Up Flutter (My Experience)</strong></p><p>Setting up Flutter wasn’t as scary as I expected, but it wasn’t completely smooth either.</p><p>Here’s what I worked with:</p><ol><li>Flutter SDK</li><li>Android Studio</li><li>Android Emulator</li></ol><p>Running flutter doctor for the first time was both helpful and intimidating 😅 — but it clearly showed what I needed to fix. Once everything turned green, seeing my <strong>first Flutter app run on an emulator</strong> felt like a huge win.</p><p>Key Concepts I’ve Learned So Far</p><ol><li><strong>Everything Is a Widget</strong></li></ol><p>This was the biggest mental shift.</p><p>In Flutter:</p><ul><li>Buttons are widgets</li><li>Text is a widget</li><li>Layouts are widgets</li><li>Screens are widgets</li></ul><p>At first, this felt overwhelming, but over time it started making sense. Flutter encourages you to <strong>compose UI using small, reusable widgets</strong>, which actually feels powerful once it clicks.</p><p><strong>2. Stateless vs Stateful Widgets</strong></p><p>Understanding the difference between these two was important:</p><ul><li><strong>StatelessWidget</strong> → UI that doesn’t change</li><li><strong>StatefulWidget</strong> → UI that updates based on user interaction or data</li></ul><p>This helped me understand how Flutter handles <strong>state</strong> and UI updates.</p><p><strong>3. The </strong><strong>build() Method</strong></p><p>Every widget has a build() method, and it returns the UI.</p><p>At first, it felt strange writing UI entirely in code, but now I see how much control it gives. It’s similar to how components work in React, but more structured.</p><p><strong>4. Hot Reload Is a Game Changer</strong></p><p>Being able to make UI changes and instantly see them without restarting the app made learning Flutter <strong>way more enjoyable</strong> and faster.</p><p><strong>What Felt Easy vs What Felt Hard</strong></p><p><strong>What Felt Easy</strong></p><ul><li>Dart syntax</li><li>Creating basic UI widgets</li><li>Hot reload</li><li>Running apps on an emulator</li></ul><p><strong>What Felt Hard</strong></p><ul><li>Understanding the widget tree</li><li>Layout constraints (why something isn’t showing 😭)</li><li>Managing state properly</li><li>Navigation between screens at first</li></ul><p>Knowing that these struggles are <strong>normal</strong> really helped me push through.</p><p><strong>Small Wins That Motivated Me</strong></p><p>Some small milestones that kept me going:</p><ul><li>Building my first screen layout</li><li>Making buttons respond to clicks</li><li>Understanding error messages better</li><li>Seeing my app run on an actual Android emulator</li></ul><p>These small wins matter a lot when you’re learning something new.</p><p><strong>How Flutter Thinking Differs from Web Development</strong></p><p>Coming from web development, Flutter required a mindset shift:</p><ul><li>No HTML or CSS</li><li>Layout is more constraint-based</li><li>Everything is structured inside widgets</li><li>UI and logic often live closer together</li></ul><p>Once I stopped trying to think in “HTML/CSS terms” and embraced widgets, things became easier.</p><p><strong>What I Plan to Build Next</strong></p><p>To continue learning, I plan to build:</p><ul><li>A small <strong>API-powered app</strong></li><li>Authentication screens</li><li>More interactive UI components</li></ul><p>I’ve learned that <strong>building small projects</strong> is the fastest way to improve.</p><p><strong>Advice to Beginners Learning Flutter</strong></p><p>If you’re just starting out:</p><ul><li>Start small</li><li>Don’t try to memorize all widgets</li><li>Read error messages carefully</li><li>Expect confusion — it’s part of the process</li><li>Build, break, fix, repeat</li></ul><p>Progress comes from consistency, not perfection.</p><p><strong>Final Thoughts</strong></p><p>Learning Flutter and Dart has been challenging, exciting, and rewarding so far. I’m still a beginner, but every day I understand a little more than I did yesterday, and that’s what matters.</p><p>If you’re thinking about learning Flutter, I’d say go for it. Be patient with yourself, celebrate small wins, and keep building.</p><p>Thanks for reading ✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7be7b2647a6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sessions vs JWT: Choosing the Right Authentication Strategy]]></title>
            <link>https://medium.com/@techtinkerbell/sessions-vs-jwt-choosing-the-right-authentication-strategy-328772bf4ce4?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/328772bf4ce4</guid>
            <category><![CDATA[jwt-authentication]]></category>
            <category><![CDATA[sessions]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 10 Jan 2026 18:10:28 GMT</pubDate>
            <atom:updated>2026-01-10T18:10:28.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*yZXVVUpKcUw0NO1t4sUD7w.jpeg" /></figure><p>Authentication is one of those things every backend developer touches early, but truly understands much later. Most of us start with sessions, eventually run into JWTs, and then spend some time confused about which one is “better”.</p><p>The truth is: <strong>sessions and JWT solve different problems</strong>, and using the wrong one usually causes more pain than security.</p><p>This post breaks down how each works, where each shines, and how to choose between them in real applications.</p><p><strong>Sessions: State Lives on the Server</strong></p><p>Session-based authentication is the traditional approach, especially in server-rendered applications.</p><p><strong>How it Works</strong></p><ol><li>User logs in with credentials</li><li>Server validates them</li><li>Server creates a session and stores it (memory, Redis, database)</li><li>A session ID is sent to the client (Usually a cookie)</li><li>Every request includes that session ID</li><li>Server looks up the session and identifies the user</li></ol><p><strong>Why Sessions still make sense</strong></p><p>sessions are:</p><ol><li>Simple to reason about</li><li>Easy to invalidate ( log out = delete session)</li><li>Naturally secure whn used with HttpOnly cookies</li><li>Great for monoliths and server-rendered apps</li></ol><p><strong>The downside of sessions</strong></p><p>Sessions introduce server-side state which means:</p><ol><li>Horizontal scaling gets harder</li><li>You need share storage (Redis, DB)</li><li>Load balancers must respect session consistency</li><li>APIs consumed by multiple clients become awkward</li></ol><p><strong>JWT: State Lives with the Client</strong></p><p>Stands for JSON Web Token</p><p><strong>How it works</strong></p><ol><li>User logs in</li><li>Server validates credentials</li><li>Server creates a signed token containing user data</li><li>Token is sent to the client</li><li>Client sends token on every request</li><li>Server verifies signature and trusts the payload</li></ol><p><strong>What’s inside a JWT</strong></p><p>A JWT typically contains:</p><ol><li>User ID</li><li>Token expiration</li><li>Issuer</li><li>Optional scopes or roles</li></ol><h3>Why JWTs are popular</h3><p>JWTs are:</p><ol><li>Stateless</li><li>Easy to scale</li><li>Perfect for APIs</li><li>Client-agnostic (web, mobile, third-party consumers)</li></ol><p><strong>The trade-offs</strong></p><h4>1. Logout is not trivial with JWT</h4><p>With JWT:</p><ol><li>Token remains valid until it expires</li></ol><p>2. You need blacklists, short expiries, or refresh tokens</p><h4>2. Token storage matters more than the token itself</h4><p>JWT is not insecure — <strong>bad storage is</strong>.</p><ol><li>Storing tokens in localStorage</li><li>Exposing tokens to XSS</li><li>Overloading JWT payloads with sensitive data</li></ol><p>JWTs should be:</p><ol><li>Short-lived</li></ol><p>2. Minimal in payload</p><p>3. Ideally stored in HttpOnly cookies if possible</p><h3>Final thoughts</h3><p>Authentication is less about tools and more about <strong>constraints</strong>.</p><p>Sessions optimize for:</p><ol><li>Simplicity</li><li>Control</li><li>Server trust</li></ol><p>JWT optimizes for:</p><ol><li>Distribution</li><li>Statelessness</li><li>Client diversity</li></ol><p>Neither is universally better.</p><p>If you understand <strong>where state lives</strong> and <strong>who you trust</strong>, the choice usually becomes obvious.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=328772bf4ce4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Importance of RESTful API Design & Common Mistakes to Avoid]]></title>
            <link>https://medium.com/@techtinkerbell/the-importance-of-restful-api-design-common-mistakes-to-avoid-2be8a4886746?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2be8a4886746</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[api-integration]]></category>
            <category><![CDATA[api-development]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 14:00:16 GMT</pubDate>
            <atom:updated>2025-07-26T14:00:16.177Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1Usk3nXXTYWWxCBB" /><figcaption>Photo by <a href="https://unsplash.com/@walkator?utm_source=medium&amp;utm_medium=referral">Walkator</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As developers, we’ve all interacted with APIs. Whether we’re consuming them or building them. RESTful APIs are the backbone of most modern web and mobile applications, and designing them well is crucial for scalability, maintainability, and developer happiness.</p><p>In this article, we’ll explore <strong>why good RESTful API design matters</strong>, and some <strong>common pitfalls to avoid</strong> when designing one.</p><p><strong>Why RESTful API Design Matters</strong></p><ol><li><strong>Developer Experience</strong></li></ol><ul><li>Clean, consistent APIs make it easy for developers (including <em>future you</em>) to integrate, test, and maintain features.</li><li>Good design reduces time spent on documentation and support</li></ul><p><strong>2. Scalability</strong></p><ul><li>RESTful conventions ensure predictable behavior across endpoints, making it easier to scale services or transition into microservices.</li></ul><p><strong>3. Security &amp; Performance</strong></p><ul><li>A well-structured API helps enforce best practices like authentication, pagination, and rate limiting.</li><li>REST encourages statelessness, which improves performance and cacheability.</li></ul><p><strong>4. Interoperability</strong></p><ul><li>APIs are often consumed by third parties, mobile apps, or internal teams. A well-designed API reduces the learning curve and integration errors.</li></ul><h3>Common RESTful API Design Mistakes</h3><h3>1. Using Verbs in Endpoints</h3><p>❌ POST /createUser<br> ✅ POST /users</p><p>Your HTTP methods already describe the action (GET, POST, PATCH, DELETE). Keep endpoint paths as <strong>nouns</strong>.</p><h3>2. Ignoring Resource Nesting</h3><p>If a comment belongs to a post, nest it.</p><p>❌ GET /comments?postId=1<br> ✅ GET /posts/1/comments</p><p>It improves clarity and reflects the relationship between resources.</p><h3>3. Inconsistent Naming Conventions</h3><p>Avoid mixing plural/singular or snake/camel cases randomly.</p><p>❌ /userData, /user_profile, /Users<br> ✅ /users, /users/{id}, /users/{id}/profile</p><p>Stick to a consistent pattern across all endpoints.</p><h3>4. Not Using Proper HTTP Status Codes</h3><p>Returning 200 OK for everything? Don&#39;t.</p><ul><li>201 Created for successful POST</li><li>204 No Content for successful DELETE</li><li>400 Bad Request for validation errors</li><li>401 Unauthorized or 403 Forbidden for auth issues</li><li>404 Not Found when a resource doesn’t exist</li></ul><h3>5. Overloading GET Requests</h3><p>Avoid performing actions like updates or deletions in GET requests.<br> <strong>GET is for reading data. Period.</strong></p><h3>6. Ignoring Pagination &amp; Filtering</h3><p>Don’t return all data at once.</p><p>✅ GET /products?page=2&amp;limit=20<br> ✅ GET /orders?status=shipped</p><p>Paginate responses and allow filtering to reduce load on both client and server.</p><h3>7. Poor or No Versioning</h3><p>APIs evolve. Without versioning, old clients may break.</p><p>✅ /api/v1/users<br> Start with versioning, even if it&#39;s just v1.</p><h3>8. Lack of Documentation</h3><p>Even the best APIs are useless if people don’t know how to use them.</p><p>Tools like:</p><ul><li>Swagger/OpenAPI</li><li>Postman collections</li><li>README.md files</li></ul><p>can make your API much easier to adopt.</p><h3>Conclusion</h3><p>RESTful API design isn’t just about structure but also about <strong>communication</strong>. You’re setting the rules for how different systems talk to each other. Good design practices save time, reduce errors, and make collaboration easier.</p><h3>What’s the worst REST API you’ve ever had to use?</h3><p>Or the best one you’ve built?<br> Let me know in the comments below!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2be8a4886746" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Progressive Web Apps With Yii PHP Framework]]></title>
            <link>https://medium.com/@techtinkerbell/building-progressive-web-apps-with-yii-php-framework-f5673992a598?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5673992a598</guid>
            <category><![CDATA[progressive-web-app]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[pwa]]></category>
            <category><![CDATA[pwa-development]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 14 Jun 2025 12:25:36 GMT</pubDate>
            <atom:updated>2025-06-14T12:25:36.889Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kL8T2uva1NI3buvhR2HJUA.png" /><figcaption>PWA Thumbnail</figcaption></figure><p>Progressive Web Apps(PWAs) combine the best of web and mobile applications. They offer native app-like experiences while maintaining the accessibility and reach of web applications. In this blog, we’ll explore how to build a fully functional PWA using PHP’s Yii Framework.</p><p><strong>What are Progressive Web Apps?</strong></p><p>Progressive Web Apps are web applications that use modern web capabilities to deliver app-like experiences to users. They’re progressive because they work for every user, regardless of browser choice and they’re responsive, app-like, safe and installable.</p><p><strong>Key Benefits of PWAs</strong></p><p>PWAs offer numerous advantages over traditional web applications and native mobile apps. They provide offline functionality through service workers, enabling users to access content even without internet connectivity. Push notifications keep users engaged and the ability to install PWAs on device home screens creates a native app-like experience. Most importantly, PWAs are cross-platform compatible, eliminating the need for separate iOS and Android development.</p><p><strong>Core PWA Components</strong></p><p>Understanding the fundamental components of PWAs is crucial for successful implementation. The three pillars of PWA architecture work together to create seamless user experiences.</p><p><strong>Service Workers</strong></p><p>Service workers act as a proxy between your web app and your network, enabling offline functionality and background sync. They run in the background, separate from your main application thread and can intercept network requests, cache responses and deliver cached content when offline.</p><p><strong>Web App Manifest</strong></p><p>The manifest file provides the metadata about your application, icluding its name, icons, theme colors, and display preferences. This JSON file tells the browser about how your web app should when installed on user’s device.</p><p><strong>HTTPS Requirement</strong></p><p>PWAs must be served over HTTPS to ensure security and enable service worker functionality. This requirement protects users from man-in-the-middle attacks and ensures the integrity of cached content.</p><p><strong>Implementing the Web App Manifest</strong></p><p>The manifest file is the first step in making your web app installable. Create a manifest.json file in your web directory.</p><pre>{<br>  &quot;name&quot;: &quot;My Yii PWA Application&quot;,<br>  &quot;short_name&quot;: &quot;YiiPWA&quot;,<br>  &quot;description&quot;: &quot;A Progressive Web App built with Yii Framework&quot;,<br>  &quot;start_url&quot;: &quot;/&quot;,<br>  &quot;display&quot;: &quot;standalone&quot;,<br>  &quot;background_color&quot;: &quot;#ffffff&quot;,<br>  &quot;theme_color&quot;: &quot;#007bff&quot;,<br>  &quot;orientation&quot;: &quot;portrait-primary&quot;,<br>  &quot;icons&quot;: [<br>    {<br>      &quot;src&quot;: &quot;/pwa/icons/icon-72x72.png&quot;,<br>      &quot;sizes&quot;: &quot;72x72&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    },<br>    {<br>      &quot;src&quot;: &quot;/pwa/icons/icon-96x96.png&quot;,<br>      &quot;sizes&quot;: &quot;96x96&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    },<br>    {<br>      &quot;src&quot;: &quot;/pwa/icons/icon-128x128.png&quot;,<br>      &quot;sizes&quot;: &quot;128x128&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    },<br>    {<br>      &quot;src&quot;: &quot;/pwa/icons/icon-192x192.png&quot;,<br>      &quot;sizes&quot;: &quot;192x192&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    },<br>    {<br>      &quot;src&quot;: &quot;/pwa/icons/icon-512x512.png&quot;,<br>      &quot;sizes&quot;: &quot;512x512&quot;,<br>      &quot;type&quot;: &quot;image/png&quot;<br>    }<br>  ]<br>}</pre><p><strong>Integrating Manifest with Yii Views</strong></p><p>In your main layout file(ypically views/layouts/main.php ), add the manifest link:</p><pre>&lt;?php<br>use yii\helpers\Html;<br>use yii\helpers\Url;<br><br>$this-&gt;registerLinkTag([&#39;rel&#39; =&gt; &#39;manifest&#39;, &#39;href&#39; =&gt; Url::to([&#39;/pwa/manifest.json&#39;])]);<br>$this-&gt;registerMetaTag([&#39;name&#39; =&gt; &#39;theme-color&#39;, &#39;content&#39; =&gt; &#39;#007bff&#39;]);<br>$this-&gt;registerMetaTag([&#39;name&#39; =&gt; &#39;apple-mobile-web-app-capable&#39;, &#39;content&#39; =&gt; &#39;yes&#39;]);<br>$this-&gt;registerMetaTag([&#39;name&#39; =&gt; &#39;apple-mobile-web-app-status-bar-style&#39;, &#39;content&#39; =&gt; &#39;default&#39;]);<br>?&gt;</pre><p><strong>Creating Service Workers in Yii</strong></p><p>Service workers are the heart of PWA functionality. Create a comprehensive service worker that handles caching, offline functionality, and background sync.</p><p><strong>Basic Service Worker Structure</strong></p><p>Create web/pwa/sw.js :</p><pre>const CACHE_NAME = &#39;yii-pwa-v1&#39;;<br>const urlsToCache = [<br>  &#39;/&#39;,<br>  &#39;/css/site.css&#39;,<br>  &#39;/js/app.js&#39;,<br>  &#39;/pwa/icons/icon-192x192.png&#39;,<br>  // Add other critical resources<br>];<br><br>// Install event<br>self.addEventListener(&#39;install&#39;, function(event) {<br>  event.waitUntil(<br>    caches.open(CACHE_NAME)<br>      .then(function(cache) {<br>        return cache.addAll(urlsToCache);<br>      })<br>  );<br>});<br><br>// Fetch event<br>self.addEventListener(&#39;fetch&#39;, function(event) {<br>  event.respondWith(<br>    caches.match(event.request)<br>      .then(function(response) {<br>        // Return cached version or fetch from network<br>        return response || fetch(event.request);<br>      })<br>  );<br>});<br><br>// Activate event<br>self.addEventListener(&#39;activate&#39;, function(event) {<br>  event.waitUntil(<br>    caches.keys().then(function(cacheNames) {<br>      return Promise.all(<br>        cacheNames.map(function(cacheName) {<br>          if (cacheName !== CACHE_NAME) {<br>            return caches.delete(cacheName);<br>          }<br>        })<br>      );<br>    })<br>  );<br>});  </pre><p><strong>Registering Service Worker in Yii</strong></p><p>Create a registration script and include it in your layout:</p><pre>// web/js/pwa-register.js<br>if (&#39;serviceWorker&#39; in navigator) {<br>  window.addEventListener(&#39;load&#39;, function() {<br>    navigator.serviceWorker.register(&#39;/pwa/sw.js&#39;)<br>      .then(function(registration) {<br>        console.log(&#39;SW registered with scope: &#39;, registration.scope);<br>      })<br>      .catch(function(error) {<br>        console.log(&#39;SW registration failed: &#39;, error);<br>      });<br>  });<br>}</pre><p>In your main layout:</p><pre>$this-&gt;registerJsFile(Url::to([&#39;/js/pwa-register.js&#39;]), [&#39;position&#39; =&gt; View::POS_END]);</pre><p><strong>Implementing Offline Functionality</strong></p><p>Offline functionality is crucial for PWAs. Implement strategies to handle offline scenarios gracefully.</p><pre>// controllers/OfflineController.php<br>&lt;?php<br>namespace app\controllers;<br><br>use yii\web\Controller;<br><br>class OfflineController extends Controller<br>{<br>    public function actionIndex()<br>    {<br>        return $this-&gt;render(&#39;index&#39;);<br>    }<br>}</pre><p>Create the offline view with helpful information and cached content options.</p><p><strong>Testing and Debugging PWAs</strong></p><p>Thorough testing ensures your PWA works correctly across different scenarios and devices.</p><p><strong>Browser Developer Tools</strong></p><p>Use Chrome DevTools’ Application tab to inspect service workers, cache storage, and manifest files. The Lighthouse audit tool provides comprehensive PWA scoring and suggestions for improvement.</p><p><strong>Testing Offline Functionality</strong></p><p>Test your app’s offline capabilities by using Chrome’s Network tab to simulate offline conditions. Verify that cached resources load correctly and that offline fallbacks work as expected.</p><p><strong>Deployment Configurations</strong></p><p>Deploying PWAs requires attention to HTTPS, caching headers, and service worker updates.</p><p><strong>HTTPS Configuration</strong></p><p>Ensure your Yii application is properly configured for HTTPS in production. Update your web server configuration to redirect HTTP traffic to HTTPS and set appropriate security headers.</p><p><strong>Service Worker Updates</strong></p><p>Implement a strategy for updating service workers when you deploy new versions of your application. Consider versioning your cache names and implementing update notifications for users.</p><p><strong>Install Prompts</strong></p><p>Create custom install prompts to encourage users to add your PWA to their home screen:</p><pre>let deferredPrompt;<br><br>window.addEventListener(&#39;beforeinstallprompt&#39;, (e) =&gt; {<br>  e.preventDefault();<br>  deferredPrompt = e;<br>  showInstallButton();<br>});<br><br>function showInstallPrompt() {<br>  if (deferredPrompt) {<br>    deferredPrompt.prompt();<br>    deferredPrompt.userChoice.then((choiceResult) =&gt; {<br>      if (choiceResult.outcome === &#39;accepted&#39;) {<br>        console.log(&#39;User accepted the install prompt&#39;);<br>      }<br>      deferredPrompt = null;<br>    });<br>  }<br>}</pre><p><strong>Conclusion</strong></p><p>Building Progressive Web Apps with PHP’s Yii Framework combines the power of server-side rendering with modern web capabilities. By implementing service workers, web app manifests, and offline functionality, you can create engaging, app-like experiences that work across all devices and network conditions.</p><p>The key to successful PWA implementation lies in understanding your users’ needs and gradually enhancing your existing web application with progressive features. Start with the basics: service worker registration and manifest implementation then gradually add advanced features like push notifications and background sync.</p><p>Remember that PWAs are about progressive enhancement. Your application should work for all users, regardless of their browser capabilities, while providing enhanced experiences for those with modern browsers that support PWA features.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5673992a598" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Stay Consistent with Learning New Tech as a Developer]]></title>
            <link>https://medium.com/@techtinkerbell/how-to-stay-consistent-with-learning-new-tech-as-a-developer-b9bd1df3e724?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9bd1df3e724</guid>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Thu, 08 May 2025 08:36:41 GMT</pubDate>
            <atom:updated>2025-05-08T08:36:41.010Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>How to Stay Consistent with Learning New Tech as a Developer</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqp9dHHXg-Vwj5TNQO8-Sg.jpeg" /></figure><p>The tech world moves fast. One moment you’re confident with a framework, and the next, there’s a new library everyone is raving about. As a developer, staying up to date can feel overwhelming — but it doesn’t have to be. In this post, I’ll share practical tips that have helped me stay consistent with learning new technologies while managing work, side projects, and life.</p><p><strong>1. Set Clear, Small Learning Goals</strong></p><p>Instead of saying, “I want to learn React”, break it down: Learn JSX syntax, understand state and props, build a small to-do app etc. This approach makes learning less intimidating and helps you track progress.</p><p><strong>2. Schedule Your Learning process</strong></p><p>If you don’t schedule it, it won’t happen. Set aside dedicated time in your week, even if it’s just 30 minutes a day or a few hours on weekends. Consistency beats intensity.</p><p><strong>3. Learn by Building</strong></p><p>Theory without practice fades fast. Choose a small project and build with the new tech. If learning Django, build a blog API. Exploring React? Create a recipe app. Trying out Tailwind CSS? Rebuild your portfolio site. You’ll learn faster, face real challenges, and gain something to show.</p><p><strong>4. Document What You Learn</strong></p><p>Writing is learning. Maintain notes, tweet tips, or write blog posts (like this one!). When you explain a concept in your own words, it sticks better. You help others too.</p><p><strong>5. Join a Community</strong></p><p>Find others learning the same tech. Join Discord servers, groups, or forums. Follow devs on Twitter or LinkedIn. Attend tech tech events. Sharing progress and challenges makes learning more fun and less lonely.</p><p><strong>6. Accept the Gaps</strong></p><p>You don’t have to know everything. Tech is wide and deep. Focus on what’s relevant to your goals and interests. Give yourself grace, and don’t compare your journey to others’.</p><p><strong>Final Thoughts</strong></p><p>Consistency isn’t about grinding 5 hours a day, it’s about showing up regularly, being curious, and making small, steady progress. Whether you’re a beginner or years into your dev journey, staying consistent is the superpower that helps you keep growing.</p><p>What are your favorite tips for staying consistent? I’d love to learn from you too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9bd1df3e724" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating M-Pesa STK Push with Node.js: A Comprehensive Guide]]></title>
            <link>https://medium.com/@techtinkerbell/integrating-m-pesa-stk-push-with-node-js-a-comprehensive-guide-d75323c679fd?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d75323c679fd</guid>
            <category><![CDATA[mpesa-integration]]></category>
            <category><![CDATA[node-js-development]]></category>
            <category><![CDATA[stk]]></category>
            <category><![CDATA[safaricom]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 16:44:45 GMT</pubDate>
            <atom:updated>2025-03-30T16:50:31.642Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1aOmdlx8K7FBp9yEKxYW1w.png" /></figure><p><strong>Introduction</strong></p><p>Mobile money has revolutionized the financial landscape in Africa, with Kenya’s M-Pesa leading the way. For developers and businesses building digital products in East Africa, integrating M-Pesa payments isn’t just a nice-to-have feature — it’s essential.</p><p>In this guide, I’ll walk you through implementing Safaricom’s M-Pesa STK Push (also known as Lipa Na M-Pesa Online) using Node.js and Express. STK Push allows you to initiate payment requests directly to your customers’ phones, creating a seamless payment experience.</p><p><strong>What is STK Push?</strong></p><p>STK Push leverages the SIM Application Toolkit to send a prompt directly to a customer’s phone, asking them to enter their M-Pesa PIN to complete a payment. It eliminates the need for customers to remember paybill numbers, account numbers, or transaction codes, significantly reducing friction in the payment process.</p><p><strong>Prerequisites</strong></p><p>Before we dive into the code, you’ll need:</p><ol><li>A Safaricom Developer Account (register at <a href="https://developer.safaricom.co.ke/">developer.safaricom.co.ke</a>)</li><li>M-Pesa API credentials (Consumer Key and Secret)</li><li>Node.js and npm installed</li><li>Basic knowledge of Express.js</li><li>A publicly accessible URL for callbacks (we’ll use ngrok for development)</li></ol><p><strong>Setting up the Project</strong></p><p>Let’s start by creating a new Node.js project:</p><pre>mkdir mpesa-integration<br>cd mpesa-integration<br>npm init -y<br>npm install express axios dotenv</pre><p>Next, create a .env file to store your API credentials:</p><pre>CONSUMER_KEY=your_consumer_key_here<br>CONSUMER_SECRET=your_consumer_secret_here<br>BUSINESS_SHORT_CODE=174379  # Default sandbox shortcode<br>PASS_KEY=bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919  # Default sandbox passkey<br>CALLBACK_URL=https://your-callback-url.com/api/mpesa/callback</pre><p><strong>Understanding the Core Components</strong></p><p>Before implementing the integration, let’s understand the three critical elements that make the STK Push work:</p><ol><li><strong>Timestamp Generation</strong></li></ol><p>Every request to M-Pesa requires a timestamp in the format YYYYMMDDHHmmss. This timestamp serves two purposes:</p><ul><li>It becomes part of the password generation</li><li>It helps Safaricom identify when the request was made (preventing replay attacks)</li></ul><pre>const getTimestamp = () =&gt; {<br>    const date = new Date();<br>    const year = date.getFullYear();<br>    const month = String(date.getMonth() + 1).padStart(2, &#39;0&#39;);<br>    const day = String(date.getDate()).padStart(2, &#39;0&#39;);<br>    const hours = String(date.getHours()).padStart(2, &#39;0&#39;);<br>    const minutes = String(date.getMinutes()).padStart(2, &#39;0&#39;);<br>    const seconds = String(date.getSeconds()).padStart(2, &#39;0&#39;);<br><br>    return `${year}${month}${day}${hours}${minutes}${seconds}`;<br>};</pre><p><strong>2. Password Generation</strong></p><p>The password for STK Push is a Base64 encoded string combining your business shortcode, a passkey provided by Safaricom, and the timestamp:</p><pre>const getPassword = (timestamp) =&gt; {<br>    const shortCode = process.env.BUSINESS_SHORT_CODE;<br>    const passKey = process.env.PASS_KEY;<br>    const password = `${shortCode}${passKey}${timestamp}`;<br>    return Buffer.from(password).toString(&#39;base64&#39;);<br>};</pre><p>This approach ensures:</p><ul><li>Only you can generate a valid password (you have the PassKey)</li><li>Each request has a unique password (due to the timestamp)</li><li>The password can’t be reused (it’s time-bound)</li></ul><p><strong>3. Access Token Generation</strong></p><p>Before making any API calls, you need to authenticate with Safaricom using OAuth:</p><pre>const getAccessToken = async () =&gt; {<br>    try {<br>        const url = &#39;https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials&#39;;<br>        const auth = Buffer.from(`${process.env.CONSUMER_KEY}:${process.env.CONSUMER_SECRET}`).toString(&#39;base64&#39;);<br><br>        const response = await axios.get(url, {<br>            headers: {<br>                &#39;Authorization&#39;: `Basic ${auth}`,<br>            }<br>        });<br>        return response.data.access_token;<br>    } catch(error) {<br>        console.error(&#39;Error getting access token:&#39;, error);<br>        throw error;<br>    }<br>};</pre><p>The access token is valid for about an hour and should be used for all subsequent API calls.</p><p><strong>Implementing the STK Push</strong></p><p>Now, let’s create a route that initiates the STK Push:</p><pre>router.post(&#39;/stk-push&#39;, async (req, res) =&gt; {<br>  try {<br>    const { phoneNumber, amount } = req.body;<br>    <br>    // Validate inputs<br>    if (!phoneNumber || !amount) {<br>      return res.status(400).json({ error: &#39;Phone number and amount are required&#39; });<br>    }<br>    <br>    // Format phone number (remove leading 0 or +254)<br>    let formattedPhone = phoneNumber;<br>    if (phoneNumber.startsWith(&#39;0&#39;)) {<br>      formattedPhone = `254${phoneNumber.slice(1)}`;<br>    } else if (phoneNumber.startsWith(&#39;+254&#39;)) {<br>      formattedPhone = phoneNumber.slice(1);<br>    }<br>    <br>    // Get access token<br>    const accessToken = await getAccessToken();<br>    <br>    // Prepare STK Push request<br>    const timestamp = getTimestamp();<br>    const password = getPassword(timestamp);<br>    const shortCode = process.env.BUSINESS_SHORT_CODE;<br>    <br>    const url = &#39;https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest&#39;;<br>    const data = {<br>      BusinessShortCode: shortCode,<br>      Password: password,<br>      Timestamp: timestamp,<br>      TransactionType: &#39;CustomerPayBillOnline&#39;,<br>      Amount: amount,<br>      PartyA: formattedPhone,<br>      PartyB: shortCode,<br>      PhoneNumber: formattedPhone,<br>      CallBackURL: process.env.CALLBACK_URL,<br>      AccountReference: &#39;Test Payment&#39;,<br>      TransactionDesc: &#39;Test Payment&#39;<br>    };<br>    <br>    // Make STK Push request<br>    const response = await axios.post(url, data, {<br>      headers: {<br>        &#39;Authorization&#39;: `Bearer ${accessToken}`,<br>        &#39;Content-Type&#39;: &#39;application/json&#39;<br>      }<br>    });<br>    <br>    // Return response to client<br>    return res.json({<br>      success: true,<br>      message: &#39;STK Push initiated successfully&#39;,<br>      data: response.data<br>    });<br>  } catch (error) {<br>    console.error(&#39;Error initiating STK Push:&#39;, error.response?.data || error.message);<br>    return res.status(500).json({<br>      success: false,<br>      message: &#39;Failed to initiate STK Push&#39;,<br>      error: error.response?.data || error.message<br>    });<br>  }<br>});</pre><p><strong>Handling Callbacks</strong></p><p>The STK Push is an asynchronous process. When you initiate it, Safaricom returns a response indicating that the request was accepted, but the actual payment happens later when the customer responds to the prompt on their phone.</p><p>To know the final outcome, we need to implement a callback endpoint:</p><pre>router.post(&#39;/callback&#39;, (req, res) =&gt; {<br>  console.log(&#39;STK Callback response:&#39;, JSON.stringify(req.body));<br>  <br>  // Extract info from callback<br>  const callbackData = req.body.Body.stkCallback;<br>  <br>  // Always respond to Safaricom with a success to acknowledge receipt<br>  res.json({ ResultCode: 0, ResultDesc: &#39;Accepted&#39; });<br>  <br>  // Process the callback data as needed for your application<br>  if (callbackData.ResultCode === 0) {<br>    // Payment successful<br>    const transactionDetails = callbackData.CallbackMetadata.Item;<br>    // Process the successful payment<br>    console.log(&#39;Payment successful&#39;);<br>    <br>    // In a real application, you would:<br>    // 1. Update your database<br>    // 2. Fulfill the order<br>    // 3. Notify the customer<br>    // etc.<br>  } else {<br>    // Payment failed<br>    console.log(&#39;Payment failed:&#39;, callbackData.ResultDesc);<br>  }<br>});</pre><p><strong>The Complete Implementation</strong></p><p>Let’s put everything together in a complete Express.js implementation:</p><pre>const express = require(&#39;express&#39;);<br>const axios = require(&#39;axios&#39;);<br>const dotenv = require(&#39;dotenv&#39;);<br>const router = express.Router();<br><br>dotenv.config();<br><br>// Helper function to get the timestamp in YYYYMMDDHHmmss<br>const getTimestamp = () =&gt; {<br>    const date = new Date();<br>    const year = date.getFullYear();<br>    const month = String(date.getMonth() + 1).padStart(2, &#39;0&#39;);<br>    const day = String(date.getDate()).padStart(2, &#39;0&#39;);<br>    const hours = String(date.getHours()).padStart(2, &#39;0&#39;);<br>    const minutes = String(date.getMinutes()).padStart(2, &#39;0&#39;);<br>    const seconds = String(date.getSeconds()).padStart(2, &#39;0&#39;);<br><br>    return `${year}${month}${day}${hours}${minutes}${seconds}`;<br>};<br><br>// Helper function to generate password<br>const getPassword = (timestamp) =&gt; {<br>    const shortCode = process.env.BUSINESS_SHORT_CODE;<br>    const passKey = process.env.PASS_KEY;<br>    const password = `${shortCode}${passKey}${timestamp}`;<br>    return Buffer.from(password).toString(&#39;base64&#39;);<br>};<br><br>// Function to get OAuth token<br>const getAccessToken = async () =&gt; {<br>    try {<br>        const url = &#39;https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials&#39;;<br>        const auth = Buffer.from(`${process.env.CONSUMER_KEY}:${process.env.CONSUMER_SECRET}`).toString(&#39;base64&#39;);<br><br>        const response = await axios.get(url, {<br>            headers: {<br>                &#39;Authorization&#39;: `Basic ${auth}`,<br>            }<br>        });<br>        return response.data.access_token;<br>    } catch(error) {<br>        console.error(&#39;Error getting access token:&#39;, error);<br>        throw error;<br>    }<br>};<br><br>// Route to initiate STK Push<br>router.post(&#39;/stk-push&#39;, async (req, res) =&gt; {<br>  try {<br>    const { phoneNumber, amount } = req.body;<br>    <br>    // Validate inputs<br>    if (!phoneNumber || !amount) {<br>      return res.status(400).json({ error: &#39;Phone number and amount are required&#39; });<br>    }<br>    <br>    // Format phone number<br>    let formattedPhone = phoneNumber;<br>    if (phoneNumber.startsWith(&#39;0&#39;)) {<br>      formattedPhone = `254${phoneNumber.slice(1)}`;<br>    } else if (phoneNumber.startsWith(&#39;+254&#39;)) {<br>      formattedPhone = phoneNumber.slice(1);<br>    }<br>    <br>    // Get access token<br>    const accessToken = await getAccessToken();<br>    <br>    // Prepare STK Push request<br>    const timestamp = getTimestamp();<br>    const password = getPassword(timestamp);<br>    const shortCode = process.env.BUSINESS_SHORT_CODE;<br>    <br>    const url = &#39;https://sandbox.safaricom.co.ke/mpesa/stkpush/v1/processrequest&#39;;<br>    const data = {<br>      BusinessShortCode: shortCode,<br>      Password: password,<br>      Timestamp: timestamp,<br>      TransactionType: &#39;CustomerPayBillOnline&#39;,<br>      Amount: amount,<br>      PartyA: formattedPhone,<br>      PartyB: shortCode,<br>      PhoneNumber: formattedPhone,<br>      CallBackURL: process.env.CALLBACK_URL,<br>      AccountReference: &#39;Test Payment&#39;,<br>      TransactionDesc: &#39;Test Payment&#39;<br>    };<br>    <br>    // Make STK Push request<br>    const response = await axios.post(url, data, {<br>      headers: {<br>        &#39;Authorization&#39;: `Bearer ${accessToken}`,<br>        &#39;Content-Type&#39;: &#39;application/json&#39;<br>      }<br>    });<br>    <br>    // Return response to client<br>    return res.json({<br>      success: true,<br>      message: &#39;STK Push initiated successfully&#39;,<br>      data: response.data<br>    });<br>  } catch (error) {<br>    console.error(&#39;Error initiating STK Push:&#39;, error.response?.data || error.message);<br>    return res.status(500).json({<br>      success: false,<br>      message: &#39;Failed to initiate STK Push&#39;,<br>      error: error.response?.data || error.message<br>    });<br>  }<br>});<br><br>// Callback route to receive STK Push response<br>router.post(&#39;/callback&#39;, (req, res) =&gt; {<br>  console.log(&#39;STK Callback response:&#39;, JSON.stringify(req.body));<br>  <br>  // Extract info from callback<br>  const callbackData = req.body.Body.stkCallback;<br>  <br>  // Always respond to Safaricom with a success to acknowledge receipt<br>  res.json({ ResultCode: 0, ResultDesc: &#39;Accepted&#39; });<br>  <br>  // Process the callback data as needed for your application<br>  if (callbackData.ResultCode === 0) {<br>    // Payment successful<br>    const transactionDetails = callbackData.CallbackMetadata.Item;<br>    // Process the successful payment<br>    console.log(&#39;Payment successful&#39;);<br>  } else {<br>    // Payment failed<br>    console.log(&#39;Payment failed:&#39;, callbackData.ResultDesc);<br>  }<br>});<br><br>module.exports = router;<br><br>// In your app.js or index.js file:<br>const app = express();<br>app.use(express.json());<br>app.use(&#39;/api/mpesa&#39;, router);<br><br>const PORT = process.env.PORT || 3000;<br>app.listen(PORT, () =&gt; {<br>  console.log(`Server running on port ${PORT}`);<br>});</pre><p><strong>Testing the Integration</strong></p><p>To test your implementation, you’ll need a publicly accessible URL for the callback. During development, you can use ngrok:</p><pre>npm install -g ngrok<br>ngrok http 3000</pre><p>Then update your .env file with the ngrok URL:</p><pre>CALLBACK_URL=https://your-ngrok-url/api/mpesa/callback</pre><p>Now, make a POST request to your /api/mpesa/stk-push endpoint:</p><pre>{<br>  &quot;phoneNumber&quot;: &quot;254708374149&quot;,<br>  &quot;amount&quot;: &quot;1&quot;<br>}</pre><p>In the sandbox environment, Safaricom provides specific test phone numbers and credentials.</p><p><strong>Conclusion</strong></p><p>Integrating M-Pesa STK Push into your Node.js application opens up a world of possibilities for businesses in East Africa. The implementation isn’t overly complex, but understanding the key components — timestamp generation, password creation, and OAuth authentication — is essential for a successful integration.</p><p>Remember that while we’ve focused on the sandbox environment in this guide, moving to production requires additional steps, including applying for production credentials from Safaricom and ensuring your system meets all security requirements.</p><p>With this implementation, you’re well on your way to providing a seamless payment experience for your customers in Kenya and beyond.</p><p><strong>Additional Resources</strong></p><p>Github Repository: <a href="https://github.com/Faith-K-commits/mpesa-stk-push">Mpesa STK Push API Integration</a></p><p><em>This blog post was written as an educational resource for developers looking to integrate M-Pesa with their Node.js applications. If you have any questions or feedback, feel free to leave a comment below.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d75323c679fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Django REST API For Managing Programming Articles]]></title>
            <link>https://medium.com/@techtinkerbell/building-a-django-rest-api-for-managing-programming-articles-21500887eae5?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/21500887eae5</guid>
            <category><![CDATA[drf]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Sat, 24 Aug 2024 15:24:48 GMT</pubDate>
            <atom:updated>2024-08-24T15:24:48.210Z</atom:updated>
            <content:encoded><![CDATA[<p>In this tutorial, I’ll walk you through the process of building and deploying a Django-based REST API that allows you to manage programming articles. This project covers CRUD operations (Create, Read, Update, Delete) and includes advanced features such as filtering articles by programming language, keywords, and tags. By the end of this article, you’ll have a fully functional API deployed to Heroku.</p><h3>Why Django for REST APIs?</h3><p>Django is a high-level Python web framework that encourages rapid development and clean, pragmatic design. When combined with Django REST Framework (DRF), it becomes a powerful tool for building RESTful APIs quickly and efficiently. Django provides built-in tools for data validation, authentication, and database management, making it an excellent choice for backend development.</p><p><strong>Project Overview</strong></p><p>The goal of this project is to create an API that developers can use to manage programming articles. The API will allow users to:</p><ol><li><strong>Create</strong> new articles.</li><li><strong>Retrieve</strong> all articles or articles of a specific programming language.</li><li><strong>Update</strong> existing articles.</li><li><strong>Delete</strong> articles.</li><li><strong>Filter</strong> articles by programming language, keywords, and tags.</li></ol><p>This project is a practical example of how to use Django and Django REST Framework to build a robust, scalable API.</p><p><strong>Setting Up the Project</strong></p><ol><li><strong>Creating a django project</strong></li></ol><p>Start by creating a new django project and app.</p><pre>django-admin startproject articles_api<br>cd articles_api<br>django-admin startapp articles<br>pip install djangorestframework</pre><p>Next, add the articles app and rest_framework to your INSTALLED_APPS in settings.py.</p><p>2. <strong>Setting Up the Models</strong></p><p>We’ll create a model called Article that includes fields for the title, description, programming language, and tags. The tags field will use a ManyToManyField to allow each article to have multiple tags.</p><pre>from django.db import models<br><br>class Tag(models.Model):<br>    name = models.CharField(max_length=50, unique=True)<br><br>class Article(models.Model):<br>    title = models.CharField(max_length=250, unique=True)<br>    description = models.TextField()<br>    programming_language = models.CharField(max_length=100)<br>    tags = models.ManyToManyField(Tag, related_name=&#39;articles&#39;, blank=True)</pre><p>3. <strong>Creating the Serializers</strong></p><p>Serializers in Django REST Framework convert complex data types, like Django models, into native Python data types that can be easily rendered into JSON.</p><pre>from .models import Tag, Article<br>from rest_framework import serializers<br><br>class TagSerializer(serializers.ModelSerializer):<br>    class Meta:<br>        model = Tag<br>        fields = [&#39;name&#39;]<br><br>class ArticleSerializer(serializers.ModelSerializer):<br>    tags = TagSerializer(many=True, read_only=True)<br>    tags_input = serializers.CharField(write_only=True)<br><br>    class Meta:<br>        model = Article<br>        fields = [&#39;title&#39;, &#39;description&#39;, &#39;programming_language&#39;, &#39;tags&#39;, &#39;tags_input&#39;]<br><br>    def create(self, validated_data):<br>        tags_data = validated_data.pop(&#39;tags_input&#39;)<br>        tags_list = [tag.strip() for tag in tags_data.split(&#39;,&#39;)]<br>        article = Article.objects.create(**validated_data)<br><br>        for tag_name in tags_list:<br>            tag, created = Tag.objects.get_or_create(name=tag_name)<br>            article.tags.add(tag)<br><br>        return article<br><br>    def validate(self, data):<br>        errors = []<br>        for field, value in data.items():<br>            try:<br>                self.fields[field].run_validators(value)<br>            except serializers.ValidationError as e:<br>                errors.append({&#39;field&#39;: field, &#39;message&#39;: str(e)})<br><br>        if errors:<br>            raise serializers.ValidationError({&quot;errors&quot;: errors})<br>        return data</pre><p><strong>4. Building the API Views</strong></p><p>Now, let’s create views to handle the CRUD operations. We’ll use function-based views provided by Django REST Framework for this purpose.</p><pre>from .serializers import ArticleSerializer<br>from rest_framework.decorators import api_view<br>from rest_framework.response import Response<br>from rest_framework import status<br>from .models import Article<br><br>@api_view([&#39;POST&#39;, &#39;GET&#39;])<br>def articles(request):<br>    if request.method == &quot;POST&quot;:<br>        serializer = ArticleSerializer(data=request.data)<br>        if serializer.is_valid():<br>            article = serializer.save()<br>            return Response({<br>                &quot;status&quot;: &quot;success&quot;,<br>                &quot;message&quot;: &quot;Article posted successfully&quot;,<br>                &quot;data&quot;: serializer.data<br>            }, status=status.HTTP_201_CREATED)<br>        return Response({<br>            &quot;status&quot;: &quot;Bad Request&quot;,<br>            &quot;message&quot;: &quot;Article did not post&quot;,<br>            &quot;errors&quot;: serializer.errors,<br>        }, status=status.HTTP_400_BAD_REQUEST)<br><br>    elif request.method == &quot;GET&quot;:<br>        try:<br>            articles = Article.objects.all()<br>            if not articles:<br>                return Response({<br>                    &quot;status&quot;: &quot;error&quot;,<br>                    &quot;message&quot;: &quot;No articles found&quot;<br>                }, status=status.HTTP_404_NOT_FOUND)<br><br>            serializer = ArticleSerializer(articles, many=True)<br>            return Response({<br>                &quot;status&quot;: &quot;success&quot;,<br>                &quot;message&quot;: &quot;Articles fetched successfully&quot;,<br>                &quot;data&quot;: serializer.data<br>            }, status=status.HTTP_200_OK)<br><br>        except Exception as e:<br>            return Response({<br>                &quot;status&quot;: &quot;error&quot;,<br>                &quot;message&quot;: str(e)<br>            }, status=status.HTTP_400_BAD_REQUEST)<br><br>@api_view([&#39;PATCH&#39;])<br>def update_article(request, pk):<br>    try:<br>        article = Article.objects.get(pk=pk)<br>    except Article.DoesNotExist:<br>        return Response({<br>            &quot;error&quot;: &quot;Item not found&quot;<br>        }, status=status.HTTP_404_NOT_FOUND)<br>        <br>    serializer = ArticleSerializer(article, data=request.data, partial=True)<br>    if serializer.is_valid():<br>        serializer.save()<br>        <br>        return Response({<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;message&quot;: &quot;Article updated successfully&quot;,<br>            &quot;data&quot;: serializer.data<br>        }, status=status.HTTP_200_OK)<br>    else:<br>        return Response({<br>            &quot;error&quot;: serializer.errors<br>        }, status=status.HTTP_400_BAD_REQUEST)<br><br>@api_view([&#39;DELETE&#39;])<br>def delete_article(request, pk):<br>    try:<br>        article = Article.objects.get(pk=pk)<br>        article.delete()<br>        return Response({&#39;message&#39;: &#39;Article deleted successfully.&#39;}, status=status.HTTP_204_NO_CONTENT)<br>    except Article.DoesNotExist:<br>        return Response({&#39;error&#39;: &#39;Item not found.&#39;}, status=status.HTTP_404_NOT_FOUND)</pre><p><strong>5. Implementing Filtering and Searching</strong></p><p>Django REST Framework provides powerful tools for filtering and searching. We’ll use Django’s Q objects to enable searching for articles by keywords, programming language, and tags. Add the follwing code to the code in views.py</p><pre>from django.db.models import Q<br><br>@api_view([&#39;GET&#39;])<br>def get_articles_by_language(request, language):<br>    try:<br>        # Filter case insensitively<br>        articles = Article.objects.filter(programming_language__iexact=language)<br>        if not articles:<br>            return Response({<br>                &quot;status&quot;: &quot;error&quot;,<br>                &quot;message&quot;: f&quot;no {language} articles found&quot;,<br>            }, status=status.HTTP_404_NOT_FOUND)<br>        serializer = ArticleSerializer(articles, many=True)<br>        return Response({<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;message&quot;: f&quot;{language} articles retrieved successfully&quot;,<br>            &quot;data&quot;: serializer.data<br>        }, status=status.HTTP_200_OK)<br>        <br>    except Exception as e:<br>        return Response({<br>            &quot;status&quot;: &quot;errors&quot;,<br>            &quot;message&quot;: str(e),<br>        }, status=status.HTTP_400_BAD_REQUEST)<br>    <br>@api_view([&#39;GET&#39;])<br>def search_articles(request):<br>    keywords = request.GET.get(&#39;keywords&#39;, &#39;&#39;)<br>    language = request.GET.get(&#39;language&#39;, &#39;&#39;)<br>    tags = request.GET.get(&#39;tags&#39;, &#39;&#39;)<br>    <br>    queryset = Article.objects.all()<br>    if keywords:<br>        queryset = queryset.filter(<br>            Q(title__icontains=keywords) | Q(description__icontains=keywords)<br>        )<br>        <br>    if language:<br>        queryset = queryset.filter(programming_language__iexact=language)<br>    <br>    if tags:<br>        tags_list = tags.split(&#39;,&#39;)<br>        for tag in tags_list:<br>            queryset = queryset.filter(tags__icontains=tag.strip())<br>            <br>    serializer = ArticleSerializer(queryset, many=True)<br>    return Response({<br>        &#39;status&#39;: &#39;success&#39;,<br>        &#39;message&#39;: &#39;Articles retrieved successfully&#39;,<br>        &#39;data&#39;: serializer.data<br>    }, status=status.HTTP_200_OK)</pre><p><strong>6. Configuring URLs</strong></p><p>Map the views to URLs in the urls.py file:</p><pre>from django.urls import path<br>from . import views<br><br>app_name = &#39;tips&#39;<br><br>urlpatterns = [<br>    path(&#39;api/articles/&#39;, views.articles, name=&quot;articles&quot;),<br>    path(&#39;api/articles/language/&lt;str:language&gt;/&#39;, views.get_articles_by_language, name=&quot;get_articles_by_language&quot;),<br>    path(&#39;api/articles/search/&#39;, views.search_articles, name=&quot;search_articles&quot;),<br>    path(&#39;api/articles/&lt;int:pk&gt;/update/&#39;, views.update_article, name=&quot;update_articles&quot;),<br>    path(&#39;api/articles/&lt;int:pk&gt;/delete/&#39;, views.delete_article, name=&quot;delete_article&quot;),<br>]</pre><p><strong>7. Testing the API</strong></p><p>With the views and URLs in place, you can now test the API using tools like Postman or any other that you prefer. Test all CRUD operations and filtering features to ensure everything is working as expected. Don’t forget to start the server on the console using python manage.py runserver</p><p><strong>8. Deploying to Heroku</strong></p><p>As this is my first time deploying I searched for beginner friendly articles on medium and came came across this <a href="https://medium.com/analytics-vidhya/deploying-django-app-on-heroku-with-github-fb3e3aaaa633">article</a> that worked for me.</p><p>The link to the live site is <a href="https://articles-api-bc0e23cce04c.herokuapp.com/api/articles/">here</a>.</p><p>Also you can checkout the project’s github repository <a href="https://github.com/Faith-K-commits/articles-api">here</a> where you’ll see all the usage and results of the API endpoints in the README file.</p><p>Thank you for reading till the end. I’d appreciate your reviews, in the comments. Bye!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21500887eae5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding useEffect and Fetch in React]]></title>
            <link>https://medium.com/@techtinkerbell/understanding-useeffect-and-fetch-in-react-4668cac94af2?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4668cac94af2</guid>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Fri, 09 Aug 2024 13:44:48 GMT</pubDate>
            <atom:updated>2024-08-09T13:45:36.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4jx4t2JuBvL-EpgpblKdbQ.png" /><figcaption>React logo</figcaption></figure><p>When building React applications, data fetching and state management are crucial tasks. Two concepts that often come up are useEffect and the Fetch API. While both are essential in managing data flow, they serve different purposes. In this blog post, we&#39;ll explore what useEffect and Fetch API are, when to use each, and how they work together.</p><p><strong>What is </strong><strong>useEffect?</strong></p><p>useEffect is a React hook that runs side effects in functional components. It can be used for a variety of tasks, such as fetching data, updating the DOM, or subscribing to services. The useEffect hook runs after every render by default, but you can control its behavior by passing a dependency array.</p><p><strong>Example Use Case for </strong><strong>useEffect</strong></p><p>Imagine you have a component that needs to fetch data when it first mounts. This is a classic use case for useEffect. By passing an empty dependency array ([]), you ensure that the fetch operation only happens once, after the initial render:</p><pre>import React, { useEffect, useState } from &quot;react&quot;;<br><br>function TransactionList() {<br>  const [transactions, setTransactions] = useState([]);<br><br>  useEffect(() =&gt; {<br>    fetch(&quot;http://localhost:8001/transactions&quot;)<br>      .then(response =&gt; response.json())<br>      .then(data =&gt; setTransactions(data));<br>  }, []); // Empty array ensures this runs only once, after the initial render<br><br>  return (<br>    &lt;div&gt;<br>      {transactions.map(transaction =&gt; (<br>        &lt;div key={transaction.id}&gt;{transaction.description}&lt;/div&gt;<br>      ))}<br>    &lt;/div&gt;<br>  );<br>}</pre><p><strong>What is </strong><strong>fetch?</strong></p><p>fetch is a JavaScript function used to make HTTP requests. It allows you to request data from a server and process the response. fetch is often used inside useEffectbut fetch itself is not React-specific as it can be used anywhere in JavaScript.</p><p><strong>Example Use Case for </strong><strong>fetch</strong></p><p>If you need to make a DELETE or PATCH request to update or remove a record in your JSON file or database, you would still use fetch. However, whether you include this inside useEffect or trigger it based on an event depends on the scenario.</p><p><strong>When to Use </strong><strong>useEffect vs. </strong><strong>fetch</strong></p><p><strong>Using </strong><strong>useEffect</strong></p><ol><li><strong>Initial Data Fetching</strong>: When you need to load data as soon as a component mounts, useEffect is the right choice. It ensures the fetch operation only occurs once (or based on dependencies you specify).</li></ol><p><strong>2. Side Effects Based on State or Props</strong>: If you want to fetch data or trigger some other side effect whenever certain state or props change, useEffect lets you specify these dependencies, making it an ideal tool for these scenarios.</p><p><strong>Using </strong><strong>fetch</strong></p><ol><li><strong>Triggered by Events</strong>: When you need to perform actions like submitting a form, deleting a record, or updating an item based on user interactions, fetch is typically used directly inside the event handler functions. You can choose to update the state directly within the event handler.</li></ol><pre>const handleDelete = id =&gt; {<br>  fetch(`http://localhost:8001/transactions/${id}`, { method: &quot;DELETE&quot; })<br>    .then(() =&gt; setTransactions(transactions.filter(transaction =&gt; transaction.id !== id)));<br>};</pre><p>In this example, fetch is used inside the handleDelete function to delete a transaction from the server. Since this action is user-triggered (not a side effect of rendering), useEffect is not necessary here.</p><p><strong>Combining </strong><strong>useEffect and </strong><strong>fetch</strong></p><p>In many cases, you’ll combine useEffect and fetch to manage both initial data loading and subsequent updates based on user interactions. The key is understanding that useEffect is about handling side effects relative to the component&#39;s lifecycle, while fetch is the tool for making network requests.</p><p><strong>Conclusion</strong></p><p>In React development, useEffect and fetch often work hand-in-hand, but each has its specific role. Understanding when to use useEffect versus directly using fetch helps you write more predictable, maintainable, and efficient React applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4668cac94af2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Destructuring in Javascript]]></title>
            <link>https://medium.com/@techtinkerbell/demystifying-destructuring-in-javascript-a305bda493d7?source=rss-47fc24d3353a------2</link>
            <guid isPermaLink="false">https://medium.com/p/a305bda493d7</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[destructuring]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Faith Kariuki]]></dc:creator>
            <pubDate>Thu, 25 Jul 2024 07:33:31 GMT</pubDate>
            <atom:updated>2024-07-25T07:33:31.942Z</atom:updated>
            <content:encoded><![CDATA[<p>Destructuring is a powerful feature in javascript that allows developers to unpack values from arrays or properties from objects into distinct variables. This feature introduced in ECMAScript 6 (ES6), can make your code more readable and concise. In this blog post, we’ll explore the concept of destructuring, how it works, and some practical examples.</p><p><strong>What is Destructuring?</strong></p><p>Destructuring is a syntax in javascript that makes it possible to extract data from arrays and objects into separate variables. It can be particularly useful when dealing with complex data structures or when you want to assign values to multiple variables in a clean and efficient manner.</p><p><strong>Destructuring arrays</strong></p><p>The basic syntax for destructuring arrays is straightforward. You use square brackets [] to define the variables that will hold the values from the array.</p><pre>const numbers = [1, 2, 3, 4, 5];<br><br>// Destructuring assignment<br>const [first, second, third] = numbers;<br><br>console.log(first); // Output: 1<br>console.log(second); // Output: 2<br>console.log(third); // Output: 3</pre><p><strong>Skipping Elements</strong></p><p>You can skip elements in the array by leaving a space between the commas.</p><pre>const numbers = [1, 2, 3, 4, 5];<br><br>const [first, , third] = numbers;<br><br>console.log(first); // Output: 1<br>console.log(third); // Output: 3</pre><p><strong>Default Values</strong></p><p>You can also assign default values to variables if the array doesn’t contain enough elements.</p><pre>const numbers = [1, 2];<br><br>const [first, second, third = 3] = numbers;<br><br>console.log(third); // Output: 3</pre><p><strong>Destructuring Objects</strong></p><p>Object destructuring is done using curly braces {}. You can extract properties from an object and assign them to variables with the same name as the property.</p><pre>const person = {<br>  name: &#39;Alice&#39;,<br>  age: 30,<br>  city: &#39;New York&#39;<br>};<br><br>const { name, age, city } = person;<br><br>console.log(name); // Output: Alice<br>console.log(age); // Output: 30<br>console.log(city); // Output: New York</pre><p><strong>Renaming Variables</strong></p><p>If you want the variables to have different names, you can use the : syntax to rename them.</p><pre>const person = {<br>  name: &#39;Bob&#39;,<br>  age: 25,<br>  city: &#39;Los Angeles&#39;<br>};<br><br>const { name: personName, age: personAge, city: personCity } = person;<br><br>console.log(personName); // Output: Bob<br>console.log(personAge); // Output: 25<br>console.log(personCity); // Output: Los Angeles</pre><p><strong>Swapping Variables</strong></p><p>Destructuring can also be used to swap values between two variables.</p><pre>let a = 1;<br>let b = 2;<br><br>[a, b] = [b, a];<br><br>console.log(a); // Output: 2<br>console.log(b); // Output: 1</pre><p><strong>Function Parameters</strong></p><p>You can destructure function parameters directly, making the code cleaner and more readable.</p><pre>function displayUser({ name, age, city }) {<br>  console.log(`Name: ${name}, Age: ${age}, City: ${city}`);<br>}<br><br>const user = {<br>  name: &#39;Dana&#39;,<br>  age: 22,<br>  city: &#39;Nairobi&#39;<br>};<br><br>displayUser(user); // Output: Name: Dana, Age: 22, City: Nairobi</pre><p><strong>Extracting data from API responses</strong></p><p>Destructuring is particularly useful when working with API responses, where you may only need specific pieces of data.</p><pre>fetch(&#39;https://api.example.com/user&#39;)<br>  .then(response =&gt; response.json())<br>  .then(({ name, email }) =&gt; {<br>    console.log(`Name: ${name}`);<br>    console.log(`Email: ${email}`);<br>  });</pre><p><strong>Conclusion</strong></p><p>Destructuring in Javascript is a versatile feature that can greatly simplify your code, making it more concise and readable. Whether you’re working with arrays or objects, destructuring helps you quickly access and manipulate data.</p><p>If you enjoyed this post and found it helpful, Please share it with your friends or colleagues. Feel free to leave your thoughts or questions in the comments below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a305bda493d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>