<?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 StephenScript on Medium]]></title>
        <description><![CDATA[Stories by StephenScript on Medium]]></description>
        <link>https://medium.com/@Stephenpharmd?source=rss-b4e85ce7e991------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nJPv_ZaPMveLGsIWYyZPjw.png</url>
            <title>Stories by StephenScript on Medium</title>
            <link>https://medium.com/@Stephenpharmd?source=rss-b4e85ce7e991------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 08:00:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Stephenpharmd/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[The Magic of Axios-Retry: Enhancing API Request Resiliency]]></title>
            <link>https://medium.com/@Stephenpharmd/the-magic-of-axios-retry-enhancing-api-request-resiliency-87f1b61fa411?source=rss-b4e85ce7e991------2</link>
            <guid isPermaLink="false">https://medium.com/p/87f1b61fa411</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[StephenScript]]></dc:creator>
            <pubDate>Tue, 23 May 2023 19:17:54 GMT</pubDate>
            <atom:updated>2023-05-23T19:17:54.416Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K53qMrZi_LcUdmG4m5Q6mQ.jpeg" /></figure><p>Imagine you’re waiting on a new pair of shoes in the mail. Sometimes, due to circumstances beyond their control— maybe there’s a fierce storm or a road closure — the postal service has to turn around and mark the package as undelivered. But you need those new Jordans today! Can’t the package delivery be re-attempted?!</p><p>Enter Axios-Retry: It adds resiliency to your applications by automatically retrying failed requests and ensures that your users receive the s̶h̶o̶e̶s̶ data they’re expecting.</p><h4>Getting Started with Axios-Retry</h4><p>To begin taking advantage of Axios and Axios-Retry, install them using NPM:</p><pre>npm i axios axios-retry</pre><p>Then, in your Node.js file, import Axios and Axios-Retry:</p><pre>// CommonJS<br>const axios = require(&#39;axios&#39;);<br>const axiosRetry = require(&#39;axios-retry&#39;);<br><br>// ES6 Modules<br>import axios from &#39;axios&#39;;<br>import axiosRetry from &#39;axios-retry&#39;;</pre><p>Once you have Axios and Axios-Retry in your project, you configure Axios-Retry by passing in the Axios instance and an options object. The most important parameter to set is ‘retries’, which determines how many times a failed request should be retried:</p><pre>axiosRetry(axios, { retries: 3 });</pre><p>But the beauty of Axios-Retry lies in its flexibility. You could also specify a retryDelay function that controls the delay between retries, or a retryCondition to set conditions under which a failed request is retried. By default, Axios-Retry retries the request if it encounters a network or 5xx error.</p><pre>/* === Optional configuration options === */<br><br>// Custom retry delays<br><br>// Retries 1000ms on first retry, 2000ms on second retry, etc.<br>axiosRetry(axios, { retryDelay: (retryCount) =&gt; {<br>  return retryCount * 1000;<br>}});<br><br>// Exponential back-off delay option<br>axiosRetry(axios, { retryDelay: axiosRetry.exponentialDelay });<br><br>// Custom callback upon request retry<br><br>// Logs retry count to console<br>axiosRetry(axios, { onRetry: (count) =&gt; console.log(`Retry attempt ${count}...`)});</pre><p>You can also use Axios-Retry on customized Axios client instances. This is my favorite way to use the library to keep my code clean and modular:</p><pre>// axios-client.js<br><br>import axios from &quot;axios&quot;;<br>import axiosRetry from &quot;axios-retry&quot;;<br><br>const client = axios.create({options});<br><br>axiosRetry(client, {<br>  // retry request up to 3 times <br>  retries: 3,<br>  // wait 1000ms and an additional 1000ms for each subsequent request<br>  retryDelay: (retryCount) =&gt; 1000 * retryCount,<br>  // retry on every failed request regardless of reason<br>  retryCondition: () =&gt; true,<br>  // log retries for monitoring of request issues<br>  onRetry: (retryCount) =&gt; console.log(`Request timed out. Retrying... (${retryCount})`),<br>});<br><br>export default client;</pre><p>Let’s illustrate the power of Axios-Retry with a simple code example that fetches data from a public API, the JSONPlaceholder:</p><pre>import client from &#39;./axios-client.js&#39;;<br><br>/* in this scenario, the request fails 2 times before returning data */<br><br>cleint.get(&#39;https://jsonplaceholder.typicode.com/posts&#39;)<br>  .then(function(response) {<br>    console.log(&#39;Success!&#39;);<br>    console.log(response.data);<br>  })<br>  .catch(function(error) {<br>    console.log(&#39;Failure!&#39;);<br>    console.log(&#39;NO DATA FOR YOU!&#39;);<br> });<br><br>/* CONSOLE OUTPUT <br><br>=== With Axios-Retry ===<br><br>Request timed out. Retrying... (1)<br>Request timed out. Retrying... (2)<br>Success!<br>[{JSON DATA}]<br><br>=== Without Axios-Retry ===<br><br>Failure!<br>NO DATA FOR YOU!<br><br>*/</pre><p>With Axios-Retry, your application automatically retries if the request to the API fails, increasing the chances of successfully getting the required data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iA1BEEemIpjdjOWG" /><figcaption>Request headers IRL</figcaption></figure><p>In summary, Axios-Retry is an invaluable tool for enhancing the resilience of your Node.js applications. It helps ensure your API requests are not lost due to temporary issues, enhancing the reliability of your application and improving the user experience. It’s like having a dedicated postal worker that won’t rest until every ‘letter’ (API request) is successfully delivered.</p><p>As you move forward with your Node.js projects, don’t forget to consider implementing Axios-Retry. Happy coding, and may your requests always find their way to their destinations!</p><p>#axios, #axiosretry, #javascript, #nodejs, #programming, #coding, #API, #webdevelopment, #backend, #resiliency, #httprequests, #codingbestpractices</p><p>Thank you for taking the time to read this article. Please feel free to 👏 clap to show your support and share it within your network!</p><p>If you’re interested in more insights about programming, coding best practices, and the ever-evolving tech landscape, please hit the follow button.</p><p>Remember, we’re all here to learn, grow, and help each other out. Stay curious, and happy coding!</p><p>Stephen Rivas</p><p>https://stephenrivas.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87f1b61fa411" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Navigate the Ideation Stage of Software Development]]></title>
            <link>https://medium.com/better-programming/how-to-navigate-the-ideation-stage-of-software-development-e5bfdc9bfe31?source=rss-b4e85ce7e991------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5bfdc9bfe31</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[StephenScript]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 17:04:17 GMT</pubDate>
            <atom:updated>2023-02-09T19:04:15.358Z</atom:updated>
            <content:encoded><![CDATA[<h4>Bring something new and exciting to the world</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EwhkbXVFpWyNakqUrhc8jg.png" /></figure><p>Every great product starts as a great idea, but great ideas don’t just happen. They are born through a process of understanding a market, identifying a need, and finding a unique solution to fill that need.</p><p>This process is known as <em>ideation</em>. It can be easily underestimated because of how nebulous it can feel when compared to other aspects of engineering. But it is the traversing of the foggy ocean of possibilities that makes ideation one of the most challenging parts of product development.</p><p>Recently, my team and I built <a href="https://medium.com/p/93dc3a75eb8b/edit">DockerWatch</a>, a developer tool created under the tech accelerator OSLabs. In this article, I will recount our experience and provide insights we learned through the process that you can take with you in your next development project.</p><h3><strong>Getting Started</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fKf-47qrbwdXvX6X1zIvQ.jpeg" /><figcaption>Honeybees leaving the hive in search of sweet, sweet ideas.</figcaption></figure><p>Our team dedicated one week to the process of ideation, and we’re glad we did. A lot of work went into development, and if we hadn’t built a strong foundation of purpose for what we were building from its inception, the entire project would have collapsed from hollow market demand.</p><p>Before you can start building, you need to know <em>why </em>you are building. Our team split in many directions to cover as much ground as possible, researching new topics and markets, all in search of a problem worth solving.</p><p>As new ideas were considered and new markets and technologies were explored, we would meet for standup and share what we learned. Pros and cons were thrown onto a whiteboard, and slowly we chipped away at ideas until few remained:</p><h3><strong><em>ImagePal</em></strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uC67pUSnmok28ZxR9yMkwQ.jpeg" /></figure><p>At the beginning of our thought journey, our team found a need we were all excited about: sustainability. From a <a href="https://www.businessinsider.com/making-net-zero-possible-the-hidden-impact-of-digital-ads-2022-7">startling article</a> written by Insider, the average digital ad campaign emits as much CO2 as 160 round-trip flights from Paris to New York City! Advertisers are interested in reducing this usage, but don’t know how to do it yet. Most notably, among ad campaigns, images, and video content produces the most CO2 emissions.</p><p>Our team now had a problem to solve and a market with a potential client base. We deliberated on the scope of the project and decided on creating an application that would take images served on web pages and change the way they were presented to users. Our application would improve the efficiency of, and ultimately lower CO2 emissions from, the process of serving images.</p><p>We were excited about the direction of our project, and spent several days refining its scope when we made some harsh realizations:</p><ul><li>A very <a href="https://github.com/lovell/sharp">successful JavaScript library</a> already existed for managing image resizing on the server-side</li><li>Employing compression algorithms is a highly complicated task and is best optimized with lower-level languages</li><li><a href="https://nextjs.org/">Next.js</a>, a newer React library, already holds several image optimizations within its Image component</li></ul><p>While sketching out lossless methods of compression on a whiteboard, it became increasingly apparent that creating such a product would be grossly outside the scope of our short development cycle. Despite the many hours of research and discussion that went into the development of ImagePal, we made the painful decision to let it go and move on to other ideas.</p><h3><strong><em>ReacType</em></strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fRV-JC5M-zfpxRb5dNQ_tw.png" /></figure><p>When our team was exploring Next.js for its image optimizations, we found several other features that make it an exciting new framework to explore. With server-side rendering, route-prefetching, and hot-module reloading, we were eager to find what Next had to offer. We were certain we could identify a problem to solve amongst developers of this budding framework.</p><p>In our research, we stumbled upon <a href="https://github.com/open-source-labs/ReacType">ReacType</a>, an IDE for prototyping React projects using a graphical interface. The tool even allowed for exporting of code to be used in a code editor for further editing. We found the tool useful and considered iterating on the project to add support for the Next projects. Reactide is an <a href="https://www.electronjs.org/">Electron</a>-based application, so we installed the program and began exploring its features. Again, we stumbled on some blockers that prevented us from wishing to pursue the project further:</p><ul><li>ReacType had been iterated on many times by several separate groups of developers, so the codebase was large and had a considerable technical debt to manage</li><li>The application was difficult to install and crashed several times during use, indicating a glaring need for extensive debugging before iteration could even begin</li><li>Lastly, and most significantly, we found that Next.js support had already been added in a previous iteration of the project, leaving few new features for us to add with our own iteration</li></ul><p>Ultimately, we decided against developing NextIDE. A similar product had already been made, and iteration on that project would require significant time investment while offering fewer opportunities to build something new. We wanted to make a product that was uniquely our own, so we made the hard choice to move on to the next idea (no pun intended).</p><h3><strong><em>DockerVision</em></strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5xOYoC9VneSeM2WnwV-dAA.png" /></figure><p>Our team explored the DevOps space and found that there were several options for monitoring container metrics. However, for Docker, there were limited options for tracking <em>historical</em> data.</p><p>Docker Desktop by default tracks <em>real-time</em> container data only. Some applications do track historical container data, but are either using a paid subscription model or have cumbersome installation processes, making them difficult to use. Amidst these opportunities in the market, we set out to design a free, accessible Docker container monitoring tool that would track container performance metrics <em>over time</em>. Carving a unique niche into the market of container dev tools, DockerVision ultimately became our latest open-source product, <a href="https://github.com/oslabs-beta/docker-watch-app">DockerWatch</a>.</p><h3><strong>Takeaways</strong></h3><p>Ideation takes significant consideration and research. It can be intimidating to try to come up with a new idea in a world where it seems that all new ideas have been had. Likewise, it can be disheartening to wade through the ideation process only to find established solutions already exist for the problem you wish to solve.</p><p>However, it is important to keep in mind that although a solution may already exist for a problem, the <em>way </em>in which it has been implemented can be an area for improvement and invention. As well, creating a small, incremental feature can be enough to make your own product stand out from the competition. Through thoughtful consideration and persistence in the realm of ideation, your next product can bring something new and exciting to the world!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5bfdc9bfe31" width="1" height="1" alt=""><hr><p><a href="https://medium.com/better-programming/how-to-navigate-the-ideation-stage-of-software-development-e5bfdc9bfe31">How to Navigate the Ideation Stage of Software Development</a> was originally published in <a href="https://betterprogramming.pub/">Better Programming</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to monitor your Docker containers better with DockerWatch]]></title>
            <link>https://medium.com/@Stephenpharmd/how-to-monitor-your-docker-containers-better-with-dockerwatch-d8a30dbfa7b4?source=rss-b4e85ce7e991------2</link>
            <guid isPermaLink="false">https://medium.com/p/d8a30dbfa7b4</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[StephenScript]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 13:22:03 GMT</pubDate>
            <atom:updated>2023-01-12T15:55:43.530Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1WWgP9R1rhLha_i1cTz7kA.png" /><figcaption>It’s time to see Docker container performance in a whole new way.</figcaption></figure><p>Containerization of applications has simplified the deployment process for developers while making the user experience more reliable and secure. But how can developers track the resource utilization of their containerized applications to ensure performance for their users? Enter DockerWatch.</p><p><strong>Table of Contents</strong></p><ol><li><a href="#f99a">What is Docker?</a></li><li><a href="#b8e2">Why Container Resource Management Matters</a></li><li><a href="#a540">How DockerWatch Works</a></li><li><a href="#f358">Installing and Using DockerWatch</a></li><li><a href="#45e3">Contributing to DockerWatch Product Development</a></li></ol><p><strong>What is Docker?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*5Qpq2ADsZiSIrIjebCcjaA.png" /></figure><p>Docker is a service that allows developers to make a customized package, or container, of their application. The container includes all the necessary components to run the application in the exact same way it was run during development. This method of software deployment creates a fast and light-weight solution for serving an application to a user with dependable results. Docker can also group multiple smaller applications (micro services) together, allowing for complex products to be reliably deployed.</p><p>From a <a href="https://survey.stackoverflow.co/2022/#section-most-loved-dreaded-and-wanted-other-tools">2022 survey</a> conducted by stackoverflow.com, Docker is one of the most popular tools among developers, and it is steadily increasing in popularity from year to year. It’s for this reason that creating developer tools for the Docker ecosystem is an exciting space, as the impact of these products can have a wide impact in the development community.</p><p><strong>Why Container Resource Management Matters</strong></p><p>Deployed software products to be served to end users are typically hosted on a server or cloud environment, such as AWS. The cost of these services depends on the resources utilized by the hosted containers.</p><p>Docker does allow for some customization to limit how much of a resource a container can use, but this is not a complete solution. A container that exceeds its predefined limits will be less performant or may be shut down altogether, leading to a diminished user experience. Prevention is the best medicine, and so it is best for a developer to monitor the resource utilization of their application <strong>before</strong> releasing to production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FO4o-VTZRL1z9VRS3cj-mQ.png" /><figcaption>DockerWatch monitoring 12 containers in real-time.</figcaption></figure><p><a href="https://docker.watch/">DockerWatch</a> is an open-source product used to make the tracking of resource management easier. The application displays real-time and historic performance of CPU utilization, memory, hard disk utilization, and network usage, allowing a developer to identify and resolve performance opportunities before fully deploying their product.</p><p><strong>How DockerWatch Works</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gVzKFIY9IrTZDizynACDQw.png" /></figure><p>DockerWatch is a fully containerized application itself, and is made up of four micro services:</p><ul><li>a database container</li><li>a sensor container</li><li>an api container</li><li>a web container</li></ul><p>The sensor collects data from the Docker daemon and stores it in the a locally hosted time series database. The API container queries for data from the database upon request from the web container. Performance metrics for all active containers are monitored for as long as the DockerWatch container is running.</p><p><strong>Installing and Using DockerWatch</strong></p><p>Because DockerWatch is deployed through Dockerhub, installation is incredibly simple. With Docker installed on the local system, run the following command in the terminal:</p><pre>curl https://raw.githubusercontent.com/oslabs-beta/docker-watch-app/main/install.yaml | docker-compose -p dockerwatch -f - up -d</pre><p>Next, navigate to localhost:8855 and click on any container to view accumulated performance metrics. Stats are recorded every five seconds, and can be viewed from ranges of 1 minute to up to seven days!</p><p>Currently, DockerWatch fully supports Mac and Linux operating systems only. Windows environments may not have access to all features offered by the application.</p><p><strong>Contributing to DockerWatch Product Development</strong></p><p>DockerWatch launched on January 12, 2023 and is currently in active development through the OSlabs Beta community initiative. The application is licensed under the terms of the MIT license, making it a fully open source product. Developers are welcome to contribute to the codebase and expand on its features.</p><p>Please visit the <a href="https://github.com/oslabs-beta/docker-watch-app">Github repository</a> if you’d like to contribute. Feel free to reach out to our team with any questions or concerns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8a30dbfa7b4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>