<?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 Benjamin Eruvieru on Medium]]></title>
        <description><![CDATA[Stories by Benjamin Eruvieru on Medium]]></description>
        <link>https://medium.com/@benjamineruvieru?source=rss-5bf074c1a347------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Cv8QFgOMKVEtUbnmUelw5A.png</url>
            <title>Stories by Benjamin Eruvieru on Medium</title>
            <link>https://medium.com/@benjamineruvieru?source=rss-5bf074c1a347------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:21:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@benjamineruvieru/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[How to Convert Images to Pdf in React Native: A Complete Guide for Mobile Developers]]></title>
            <link>https://medium.com/@benjamineruvieru/how-to-generate-pdf-from-images-and-views-in-react-native-a-complete-guide-for-mobile-developers-b047f3ad4946?source=rss-5bf074c1a347------2</link>
            <guid isPermaLink="false">https://medium.com/p/b047f3ad4946</guid>
            <category><![CDATA[image-to-pdf-converter]]></category>
            <category><![CDATA[react-native-pdf]]></category>
            <category><![CDATA[pdf-generation]]></category>
            <category><![CDATA[pdf-from-image]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Benjamin Eruvieru]]></dc:creator>
            <pubDate>Fri, 31 Jan 2025 23:58:11 GMT</pubDate>
            <atom:updated>2025-02-02T09:18:17.696Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_sUDHD6lMMseKHj8Fk7y8w.png" /></figure><p>PDF generation is a crucial feature for many mobile applications, whether you’re building a document scanner, creating reports, or allowing users to save content for offline viewing. In this comprehensive guide, we’ll explore two powerful approaches to generating PDFs in React Native: converting images directly to PDF and capturing views as images before converting them to PDF format.</p><h3>Method 1: Converting Images to PDF Using react-native-pdf-from-image</h3><p>Let’s start with the straightforward approach of converting images to PDF using the <a href="https://www.npmjs.com/package/react-native-pdf-from-image">react-native-pdf-from-image</a> library.</p><h3>Installation</h3><p>First, install the required dependency:</p><pre>npm install react-native-pdf-from-image<br># or using yarn<br>yarn add react-native-pdf-from-image</pre><p>For iOS, you’ll need to install the pods:</p><pre>cd ios &amp;&amp; pod install</pre><h3>Basic Implementation</h3><p>Here’s a simple example of converting multiple images to a single PDF:</p><pre>import { createPdf } from &#39;react-native-pdf-from-image&#39;;<br><br>const images = [&#39;path/to/image1.jpg&#39;];<br><br>const { filePath } = createPdf({<br>  imagePaths: images,<br>  name: &#39;myPdf&#39;,<br>  paperSize: &#39;A4&#39;<br>});</pre><p>Note: When using the old architecture, make sure to await the createPdf function as it returns a Promise.</p><pre>import { createPdf } from &#39;react-native-pdf-from-image&#39;;<br><br>// Old Architecture<br>const generatePdf = async () =&gt; {<br>  const images = [&#39;path/to/image1.jpg&#39;];<br>  const { filePath } = await createPdf({<br>    imagePaths: images,<br>    name: &#39;myPdf&#39;<br>  });<br>};</pre><h3>Method 2: Converting Views to PDF Using react-native-view-shot</h3><p>Sometimes you need to convert an actual React Native view into a PDF. This requires a two-step process: first capturing the view as an image using react-native-view-shot, then converting that image to PDF.</p><h3>Installation</h3><p>Install both required libraries:</p><pre>npm install react-native-view-shot react-native-pdf-from-image<br># or using yarn<br>yarn add react-native-view-shot react-native-pdf-from-image</pre><h3>Implementation</h3><p>Here’s a complete example showing how to capture a view and convert it to PDF:</p><pre>import ViewShot from &#39;react-native-view-shot&#39;;<br>import { createPdf } from &#39;react-native-pdf-from-image&#39;;<br><br>const ViewToPDFComponent = () =&gt; {<br>  // Reference to the ViewShot component<br>  const viewShotRef = useRef(null);<br><br>  const generatePDFFromView = async () =&gt; {<br>    try {<br>      // Step 1: Capture the view as an image<br>      const imageURI = await viewShotRef.current.capture();<br><br>      <br>      // No need to await if on new arch<br>      const { filePath } = await createPDF({<br>        imagePaths: [imageURI],<br>        name:&#39;MyPdf&#39;,<br>        pageSize: &#39;A4&#39; // Optional<br>      });<br><br>      console.log(&#39;View successfully converted to PDF:&#39;, pdfFile);<br>    } catch (error) {<br>      console.error(&#39;Error converting view to PDF:&#39;, error);<br>    }<br>  };<br><br>  return (<br>    &lt;View&gt;<br>      &lt;ViewShot ref={viewShotRef} options={{ format: &#39;jpg&#39;, quality: 0.9 }}&gt;<br>        {/* Your view content goes here */}<br>        &lt;View style={styles.container}&gt;<br>          &lt;Text style={styles.title}&gt;This will be converted to PDF&lt;/Text&gt;<br>          &lt;Image source={require(&#39;./your-image.png&#39;)} /&gt;<br>          {/* Add any other components you want in the PDF */}<br>        &lt;/View&gt;<br>      &lt;/ViewShot&gt;<br>      <br>      &lt;Button <br>        title=&quot;Generate PDF&quot; <br>        onPress={generatePDFFromView} <br>      /&gt;<br>    &lt;/View&gt;<br>  );<br>};<br><br>const styles = StyleSheet.create({<br>  container: {<br>    padding: 20,<br>    backgroundColor: &#39;white&#39;<br>  },<br>  title: {<br>    fontSize: 24,<br>    marginBottom: 16<br>  }<br>});</pre><h3>How It Works</h3><ol><li><strong>Capture the View:</strong> The ViewShot component wraps the view you wish to convert to PDF. When the button is pressed, it calls capture(), which returns the file URI of the captured image.</li><li><strong>Generate the PDF:</strong> Using the createPdf function from react‑native‑pdf‑from‑image, the captured image URI is passed as an array. The PDF is generated and stored at the returned file path.</li></ol><p>This method is especially useful when you want to export a complex view — such as a summary screen, report, or custom layout — as a PDF document.</p><h3>Conclusion</h3><p>Generating PDFs in React Native doesn’t have to be complicated. With <a href="https://www.npmjs.com/package/react-native-pdf-from-image"><strong>react-native-pdf-from-image</strong></a> for direct image conversion and <a href="https://www.npmjs.com/package/react-native-view-shot"><strong>react-native-view-shot</strong></a> for dynamic views, you can easily create professional PDFs tailored to your app’s needs. Start implementing these solutions today and enhance your app’s functionality!</p><p><strong>Like this guide? Share it with your network and stay tuned for more React Native tutorials!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b047f3ad4946" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rebirth of Kicks Citi: A Major Makeover with Serverless Architecture, React Native, and Beyond]]></title>
            <link>https://medium.com/@benjamineruvieru/the-rebirth-of-kicks-citi-a-major-makeover-with-serverless-architecture-react-native-and-beyond-39a2c52bdf12?source=rss-5bf074c1a347------2</link>
            <guid isPermaLink="false">https://medium.com/p/39a2c52bdf12</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[microinteractions]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws-sam]]></category>
            <dc:creator><![CDATA[Benjamin Eruvieru]]></dc:creator>
            <pubDate>Wed, 03 Jan 2024 16:10:24 GMT</pubDate>
            <atom:updated>2024-01-03T16:10:24.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vgXQjcpZktX-vyZzcz1fMw.png" /></figure><p>Okay, fellow code warriors and react native developers, gather ‘round the campfire because I’m about to tell you a tale of epic proportions. It’s a tale of rebirth, redemption, and of course, shoes. Lots and lots of shoes. Buckle up, because we’re going on a journey to revamp Kicks Citi, the e-commerce marketplace that was starting to resemble my grandpa’s closet — dusty, disorganized, and in desperate need of a fashion intervention.</p><h4><strong>Kicks Citi: From Cinderella to Swamp Thing</strong></h4><p>Ah, Kicks Citi. Let’s just say this wasn’t my proudest coding moment. You see, it was my very first React Native project, and trust me, it was all wild horses and tumbleweeds. After gaining a lot of experience over the years, it became clear that tweaking, and attempting more code refactoring just wouldn&#39;t cut it — our beloved Kicks Citi project needed more than a touch-up; it needed a complete makeover. The time had come to bid farewell to the old and embrace the new. A fresh start, a clean slate, and a chance to redefine Kicks Citi’s digital destiny. Let’s dive into the riveting saga of how a novice’s project evolved into a seasoned developer’s masterpiece.</p><h4>Exploring the capabilities of AWS for serverless architecture and cloud computing</h4><p>Embarking on the Kicks Citi overhaul meant more than just a frontend facelift; it entailed a pivotal shift in the backend from Firebase to the vast, cloud-powered landscape of AWS.</p><p>The heartbeat of the revamped system lies in AWS services like Lambda, S3, API Gateway, AWS SES, AWS Event Scheduler, and the Serverless Application Model (SAM).</p><p>SAM played a starring role in this project, aiding in local testing of lambda functions before deployment. Its most significant contribution, however, was seamlessly integrating continuous integration and deployment (CI/CD) with GitHub Actions pipeline to my backend. Now, updating or creating new lambda functions is as straightforward as coding on my local system and pushing changes to my GitHub repository, with SAM orchestrating the entire process automatically.</p><p>Nevertheless, it’s essential to acknowledge that SAM posed significant challenges during the project overhaul, serving as the battleground where I confronted the majority of obstacles. Achieving success with SAM was no easy feat, but however I came out on top.</p><h4>Architectural Symphony: Structuring AWS Services for a Dynamic Backend Ensemble with MongoDB as the Maestro</h4><p>Here is how my serverless architecture looks: My backend application code runs on Lambda functions situated behind the powerful API Gateway. Images are stored in S3, and CloudFront takes center stage for efficient image caching. To handle email communication, I employ AWS Simple Email Service (SES), while MongoDB serves as the database.</p><p>To manage routine operations with finesse, I rely on AWS Event Scheduler — a silent hero working behind the scenes. The deep dive into the technical intricacies of my AWS structure is a subject reserved for another day and another blog post.</p><h4>React Native: The Cross-Platform Shoe-slinger</h4><p>We couldn’t just have a fancy backend without a stunning frontend, right? That’s where the need to rebuild the React Native project from scratch came in, this time using best practices and performance optimizations, to give a native-like feel.</p><p>I didn’t stop there. A sprinkle of animations here, a dash of micro-interactions there — Kicks Citi’s new UI/UX became as stylish as those limited edition Nikes. User experience was no longer an afterthought; it became the heart and sole (pun intended) of the project.</p><p>But it’s not just about looks. I amped up the app with cutting-edge features such as push notifications, code push for instant OTA updates, deep linking, and the implementation of an affiliate and reward system. Oh, and for those iPad or tablet enthusiasts, worry not. I made sure the app responds like a pro on those larger screens, giving you a seamless experience no matter your device.</p><p>In a nutshell, the revamped Kicks Citi app isn’t just visually stunning — it’s a carefully crafted symphony of features. Each tap, swipe, and notification is part of a journey designed to engage, reward, and keep you coming back for more. Navigating the world of sneakers is now as thrilling and addictive as scoring the latest limited edition kicks.</p><h4>Lessons Learned and the Future of Kicks Citi</h4><p>As the curtains fall on this digital odyssey, I’m left with a bag full of lessons learned, a revamped Kicks Citi, and the satisfaction of a job well done. This project was like a crash course in leveling up — from figuring out the ins and outs of the AWS stack to becoming a code push maestro in React Native and diving into the world of micro-interactions. Each twist and turn added to the transformative ride.</p><p>As I close this chapter, the future seems promising, the tech foundation is rock-solid, and who knows what exciting projects might pop up next in my virtual inbox. Until our coding paths cross again, happy coding!</p><p>Get Kicks Citi</p><p>https://www.kicksciti.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39a2c52bdf12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviving Abandoned Projects: The Inspiring Story of Coballo, the Ultimate Collaboration Platform…]]></title>
            <link>https://medium.com/@benjamineruvieru/reviving-abandoned-projects-the-inspiring-story-of-coballo-the-ultimate-collaboration-platform-6d3ea633f3c0?source=rss-5bf074c1a347------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d3ea633f3c0</guid>
            <category><![CDATA[alx-blog]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Benjamin Eruvieru]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 21:35:40 GMT</pubDate>
            <atom:updated>2023-10-09T17:38:38.081Z</atom:updated>
            <content:encoded><![CDATA[<h3>Reviving Abandoned Projects: The Inspiring Story of Coballo, the Ultimate Collaboration Platform for Developers</h3><h3>Hey fellow developers, I wanted to share with you all about an exciting project I was a part of recently, and let me tell you, it was no walk in the park. Introducing Coballo, the ultimate platform for developers to connect and collaborate on abandoned projects.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cvgRWGvYWgSUdG5bdA-W_A.png" /></figure><p>You know how it is, we’ve all been there. You start a new project, you’re all excited and can’t wait to dive in, but then life happens, or you realize you’re not as skilled as you thought, or maybe you just got too busy with other things. Before you know it, your project is abandoned, collecting dust in a forgotten corner of your computer. Well, that’s where Coballo comes in. Our goal is to reduce the number of abandoned projects in the developer community and to give developers the opportunity to work on something new and exciting.</p><p>Now, I won’t lie to you, this project was not easy. I served as the mobile developer using React Native. Building an app from scratch is no easy feat, let me tell you that. I also set up the database storage and worked on connecting the mobile frontend and backend. My fellow developers, Akinwonjowo Dennis and Nnaemeka Joseph, they were not slacking off either. Akinwonjowo took on the role of the backend developer, responsible for writing the majority of the server and client code and setting up the backend logic, while Nnaemeka was the frontend developer and he was responsible for designing the beautiful web interfaces using HTML, CSS and JavaScript.</p><p>The idea for Coballo was born when Dennis met several developer friends and discovered that each of them had one or more abandoned projects due to a lack of skills or resources. He was inspired to create a platform that could connect developers with similar interests and skills to work on these abandoned projects together. With a sense of shared responsibility, we believe that more projects will be completed and fewer ideas will be lost. We used Python Flask to develop the API routes, MySQL to set up storage, and SQLAlchemy for relational mapping. On the frontend, we used HTML, CSS and JavaScript and AJAX to send requests to the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DPDFk500J1o235XJg9MLjA.png" /></figure><p>The most difficult technical challenge we faced was how to properly manage the relationships between the various objects in the project, particularly the one-to-many relationship between users and projects. In order to make sure that each project had only one user and that users could have multiple projects, we had to be very careful in the way we set up the database and wrote the code. But we were able to accomplish that with a lot of careful planning and debugging.</p><p>Through working on this project, I’ve learned a lot about the importance of teamwork and communication, especially when working on a complex project like this. I also learned a lot about the importance of planning and organization, as well as the importance of being flexible and open to change.</p><p>In conclusion, Coballo is a platform that connects developers to collaborate on abandoned projects, it’s for developers who want to work on something new and exciting, and it’s for developers who want to help others avoid the fate of an abandoned project.</p><p>A bit about me, I am Oghenekaro Benjamin Eruvieru, a React Native mobile developer, and a problem solver, I love to take on complex projects that challenge me to learn and grow as a developer, and Coballo was definitely one of those projects. I am always on the lookout for new opportunities to push my boundaries and improve my skills. I believe that by sharing our knowledge and expertise we can help to make the developer community stronger and more vibrant.</p><p>Read Post Here: <a href="https://benjamineruvieru.com/blog/Lv0kJUbTycXPFhzTaNuc">https://benjamineruvieru.com/blog/Lv0kJUbTycXPFhzTaNuc</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d3ea633f3c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What happens when you type google.com in your browser and press Enter?]]></title>
            <link>https://medium.com/@benjamineruvieru/what-happens-when-you-type-google-com-in-your-browser-and-press-enter-d2e2b0f72dc1?source=rss-5bf074c1a347------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2e2b0f72dc1</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[ip-address]]></category>
            <category><![CDATA[servers]]></category>
            <dc:creator><![CDATA[Benjamin Eruvieru]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 22:57:06 GMT</pubDate>
            <atom:updated>2023-10-09T17:55:07.038Z</atom:updated>
            <content:encoded><![CDATA[<p>Millions of people type URLs into their browsers every day, yet little is known about what actually occurs behind the scenes.</p><p>This article’s goal is to clearly describe what happens in the background when you enter a url into your browser. So without further ado, let’s dive into this voyage step by step!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/361/1*oLpk97yg7XZKp8gGoyEBvQ.png" /></figure><h3><strong>Browser looks up domain IP addresses</strong></h3><p>Just as anyone setting out on a journey must first know where they are going, the same is true for your browser, which must first determine the IP address of the server hosting the website. This is accomplished through the use of a DNS query, in which your computer (DNS client) requests the IP address of the domain name from a DNS server.</p><h3><strong>How we get there: The TCP/IP connection</strong></h3><p>It is now time to establish a connection with the IP address, which is done by adhering to the HTTPS protocol specified in the URL. This protocol, which is a secure variant of the Hypertext Transfer Protocol (HTTP), is a component of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol family.</p><p>TCP/IP uses a procedure known as the TCP 3-way handshake to establish the connection between two hosts (the client and the server). This when the client and the server both synchronize or SYN, and acknowledge or ACK, one another. The first SYN packet contains the initial sequence number that the client chooses. Additionally, the server selects its own beginning sequence number, raises the client’s SYN number, sends the SYN/ACK packet, and waits for the client to ACK before raising the client’s SYN number, then the TCP socket connection is established.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*OUW8gkeakbeUltagT817KA.gif" /></figure><h3><strong>Connection Refused? — The Firewall</strong></h3><p><strong>Firewalls are designed to restrict incoming and outgoing traffic. </strong>It is intended to thoroughly examine incoming communication in accordance with pre-established rules and filter traffic from untrusted or dubious sources in order to thwart assaults. The firewall evaluates each user request, and if it isn’t malicious or suspicious, it permits the connection to the load balancer-assigned web server. If the connection is blocked then there will not be an exchange of data over the network.</p><h3>Load-balancer</h3><p>Websites, as I previously mentioned, are stored on servers. And your browser and the servers exchange data through the HTTPS protocol after the connection has been established. Everything has been running smoothly up until now, but what if the server suddenly receives a large number of requests?</p><p>Without a load balancer, a website that receives a lot of requests from users will experience downtime and have a single point of failure (SPOF). A load-balancer is a software program that distributes network requests between the different servers associated with it, based on a <strong>load-balancing algorithm</strong> like the most common, the round-robin, that distributes the incoming load alternating between all the servers evenly and consequentially. So in order to improve the performance of the website, numerous servers must be implemented. Then, using a load balancer, user requests are distributed among the servers.</p><h3>The response</h3><p>At this point your request is at google’s web servers. A web server just manages HTTP/HTTPS requests and serves static content, including plain text files, pictures, and simple HTML pages. Web servers like Nginx or Apache are two examples.</p><p>Behind a web server and in front of a database management system runs an application server. Its fundamental objective is to produce dynamic content that supports the creation and delivery of applications by giving them the business logic they need.</p><p>Using these two sorts of servers, your response is then generated and sent to your browser, which then displays it.</p><h3>Data Management</h3><p>The Database Management System (DBMS), is a program that enables interaction with databases — organized collections of structured data stored in computer systems — to define, manipulate, retrieve, and manage the data in response to requests. In this case, the database will provide the user with any information he requests from google.com and preserve any information, such as account creation information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*KeHj2b7nTiVLcwzrHcIziQ.png" /></figure><h3>Recap</h3><p>After you type in a URL into your browser and press Enter, the browser conducts a DNS query to determine the domain name’s IP address. Following the discovery of the IP, the browser establishes a TCP/IP connection, the firewall analyzes the request, and the load balancer distributes it to the web server and application server which then sends back your response.</p><p>And that’s all! Wasn’t the voyage hectic but exciting? The “tricks” concealed behind a website search on your browser are now known to you. Every step that was outlined is the same for every working website, thus if you try it with one and there is a component missing, you will likely get an error message rather than the website you were looking for.</p><p>Read This Post: https://www.benjamineruvieru.com/blog/SWz28cp5phk2qA5WjgXK</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2e2b0f72dc1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>