<?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 Nick Holbrook on Medium]]></title>
        <description><![CDATA[Stories by Nick Holbrook on Medium]]></description>
        <link>https://medium.com/@ndh175?source=rss-1e9c015acc7b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fo59YJkTAVsgDtNub-C_TQ.jpeg</url>
            <title>Stories by Nick Holbrook on Medium</title>
            <link>https://medium.com/@ndh175?source=rss-1e9c015acc7b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 13:05:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ndh175/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[Structuring Serverless Projects]]></title>
            <link>https://medium.com/swlh/structuring-serverless-projects-2a9a82f7732d?source=rss-1e9c015acc7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a9a82f7732d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[dev]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Nick Holbrook]]></dc:creator>
            <pubDate>Thu, 11 Jun 2020 09:53:21 GMT</pubDate>
            <atom:updated>2020-06-11T12:20:28.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGQzawNWXGtZSHqhtxhEuQ.png" /></figure><h4>The Ultimate Guide to Setting Up Projects using the Serverless Framework</h4><p>One of the first problems I often run into when learning a new framework is learning the existing conventions and code patterns on how to structure your project. Through reading numerous blog posts and past experience with other frameworks — not to mention hours of trial and error — I’ve managed to come up with a optimal folder structure for complex projects. This post will go through how to setup your project to adhere to this convention, as well as my rationale for designing it like I did.</p><p><em>This post is written using python and AWS — although you should be able to adapt it to work with node.js or any other language without a problem.</em></p><h3>Requirements</h3><p>These are some of top requirements that I needed my project setup to support:</p><ul><li>Separation of code into logical modules</li><li>Sharing dependencies between modules</li><li>Sharing code between modules</li><li>Separation of endpoints by resource within modules</li><li>Offline endpoint testing support</li></ul><h3>Overview</h3><p>Before we dive into specifics, here’s a overview of how we’ll be setting up our project. At a high level, we’re separating out code into <strong>primary modules</strong> and <strong>submodules</strong>. Primary modules will each of their own serverless project. This helps to separate business logic into discrete components that can be tested and deployed independently of other modules. This adheres to the Serverless’ team’s own suggestions, who recommends the following.</p><blockquote>Always seek to break up your Application into smaller Services, to safely separate the cloud resources they contain. This way, we’re not risking the entire Application if the deployment of a Service should fail or fall into an erroneous state, and we’re not making a monolith that is hard to approach, collaborate on and maintain.</blockquote><blockquote>When determining how to separate your Services, seek to generally group cloud resources by their business domain while specifically separating cloud resources that you deploy often (e.g. code, functions) from resources that should be deployed infrequently and cautiously (e.g. databases, VPCs)</blockquote><h3>Introduction</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f7c46fb3c40b245faa788c87becb04c/href">https://medium.com/media/3f7c46fb3c40b245faa788c87becb04c/href</a></iframe><h4>Shared Packages</h4><p>Directly within our src folder we first have any code that needs to be shared throughout the app or between different Primary Modules. These are just standard python packages, but we won’t go into the specifics of creating these in this post.</p><h4>Layers</h4><p>On this same level, we also have a directory containing our layers.<strong> Lambda Layers</strong> are used to include shared dependencies or code between multiple lambda functions without having to include them in our deployment package. This will speed up future development, as well as helping you avoid errors that can occur when you install and package dependencies with your code. Below is an example of how you can define layers and configure your functions to use them in your serverless.yml.</p><blockquote>To use a layer with a function in the same service, use a CloudFormation Ref. The name of your layer in the CloudFormation template will be your layer name <a href="https://en.wikipedia.org/wiki/Letter_case#Title_Case">TitleCased</a> (without spaces) and have LambdaLayerappended to the end.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de1d2458767d69716b37c1cb16a748f0/href">https://medium.com/media/de1d2458767d69716b37c1cb16a748f0/href</a></iframe><p>For more information on using serverless layers, visit:</p><p><a href="https://www.serverless.com/framework/docs/providers/aws/guide/layers/#aws---layers">Serverless Framework - AWS Lambda Guide - Layers</a></p><h4>Primary Modules (or Services)</h4><p>Next we have the modules directory. Within this, we have our code separated into <strong>primary modules</strong> (or as the serverless teams refers to them — services). As we touched on earlier, these modules are separated based on business domain and is done to prevent a single deployment from taking down your entire platform. Each <strong>primary module</strong> contains it’s own serverless.yml file, and is it’s own separate serverless project. This means that you will deploy and test each module independently of each other. Because of this, you want to make sure you aren’t to aggressive with separating your code at this level.</p><p>For code that simply needs to be separated by resource, we have submodules which we’ll touch on next.</p><h4>Submodules</h4><p>Within each<strong> primary module</strong>, we further separate our code into logical groups of endpoints. How exactly this is determined is up to you, but I typically create a <strong>submodule</strong> for each database resource I’ll be interacting with. You can also separate this based on application components, or whatever else makes the most sense for your use case.</p><p>Each <strong>submodule</strong> is fairly basic only contains the endpoints and and their associated logic. I typically name these files <em>functions.yml</em> and <em>handler.py.</em></p><p>A typical <em>functions.yml</em> file will look something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/36d0f3188d970705163c766baef4e977/href">https://medium.com/media/36d0f3188d970705163c766baef4e977/href</a></iframe><p>As you can see, even though the <em>handlers.py</em> file is in the same directory as the <em>functions.yml</em> file, you still need to reference its functions using it’s path relative to the <strong>primary modules’</strong><em> </em>root directory. This is because during runtime, all of your functions are imported to your <em>serverless.yml</em>, and are ran from there.</p><p>The <em>handlers.py</em> contains the actual code for these endpoints. It’s a good practice to separate all reusable portions into a package that can be used throughout your app (such as a helpers function to parse the body). This is a example of what the function stubs will look like for a httpApi event, but this will vary based on what’s triggering your functions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5718085a7b224f3fd4941c731892a48e/href">https://medium.com/media/5718085a7b224f3fd4941c731892a48e/href</a></iframe><h3>Offline Testing / Deployment</h3><p>In order to support offline endpoint testing (using serverless-offline) and deploying to AWS, you’ll need to have your dependencies and modules installed locally (ideally using venv) and in your layer under the lib/requirements/python/lib/python3.8/site-packages directory. Here’s and example of a example of a basic setup script that will take care of this for you.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40fe3c95a27cd0c37e6c8dc3740ca939/href">https://medium.com/media/40fe3c95a27cd0c37e6c8dc3740ca939/href</a></iframe><p>Once the dependencies are installed, you should now be able you test and deploy your application. Keep in mind that since each <strong>primary module</strong> is it’s serverless project, you’ll need to run the relevant commands from the root directory of the module, not the repository.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a9a82f7732d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/structuring-serverless-projects-2a9a82f7732d">Structuring Serverless Projects</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an SDK for iOS in Swift]]></title>
            <link>https://medium.com/swlh/building-an-sdk-for-ios-in-swift-688d13f0a6fb?source=rss-1e9c015acc7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/688d13f0a6fb</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[cocoapods]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Nick Holbrook]]></dc:creator>
            <pubDate>Wed, 03 Jun 2020 13:31:54 GMT</pubDate>
            <atom:updated>2020-06-08T00:29:37.499Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lsQxKK9byL-B7xB5w9F8Gw.png" /></figure><p>Recently, I was working on a project that would entail clients configuring and integrating our service with their existing mobile applications. At first, I thought it would be a simple enough process that they would be able to figure it out themselves with just some simple documentation. As we added more functionality, however, the work on their side became increasingly more complex to a point where we realized this was no longer a workable solution.</p><p>We realized that by continuing with our initial hands-off approach, we would be opening up the door to countless unforeseen issues down the road and potentially a sub-par end user experience if out parters incorrectly configured the application.</p><p>This led us to the eventual decision that the best approach would to build our own SDK that we would then be able to distribute to client — drastically reducing the time and effort spent by their development team, as well as reducing the scope of errors that might pop up during the initial setup process.</p><p>This post will go through the process of setting up a simple iOS package, talk about some common pitfalls you might run into during the process, explore how to test locally, and finally publish to SPM (Swift Package Manager).</p><h3>Creating a New Package</h3><h4>Xcode</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTZLiC5HzDWUXHceyyGtBA.png" /><figcaption>Creating a new swift package with Xcode</figcaption></figure><p>Creating a new package from inside Xcode takes about 5 seconds. Navigate to <em>File &gt; New &gt; Swift Package</em>, then save the package wherever you want.</p><h4>Command Line</h4><p>Alternatively, you can create a package from the command line by running:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/abe1357a34829eee328fc3ec904fc978/href">https://medium.com/media/abe1357a34829eee328fc3ec904fc978/href</a></iframe><h4>Configuring your Swift Package</h4><blockquote>Swift packages don’t use .xcproject or .xcworkspace but rely on their folder structure and use the Package.swift file for additional configuration. The following code listing shows a simple package manifest</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/abab404e434074419c97526fd7c3a87b/href">https://medium.com/media/abab404e434074419c97526fd7c3a87b/href</a></iframe><h4>The Code</h4><p>At this point you’ll have a file called MediumSDK.swift (or whatever your package is called) under the Sources directory. This is where we’ll store the code that needs to be included in our SDK.</p><p>At this point, you would add whatever functionality you needed for your SDK here. For my project, I needed a custom preconfigured WKWebView that I could send to our partners. Here’s a stripped down version of something similar to what I ended up using.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e354ea4c34dc96cf4a6d62c1ce712c4b/href">https://medium.com/media/e354ea4c34dc96cf4a6d62c1ce712c4b/href</a></iframe><p>You would then add this file under <em>Sources/MediumSDK</em>, or<em> Sources/YourPackageNameHere</em>. A couple things to note when adding a custom class like this:</p><ul><li>Make sure your class (or protocol or function) is <strong>public</strong> or else your project that is importing it won’t be able to access it</li><li>Inside of Xcode, make sure to build the package before publishing to git. This will reveal errors that you otherwise wouldn&#39;t have noticed and will save you tons of debugging time</li><li>Test locally before pushing to git (I’ll go into how to do this next)</li></ul><h3>Deployment Options</h3><h4>Local Testing</h4><p>Before publishing your package anywhere, you definitely want to make sure to integrate and test it with an Xcode project locally.</p><p>Doing this is pretty simple. First you’ll want to make sure your files are being tracked by git and you have the most recent changes committed. Once that’s taken care of, you’re ready to import the package into an Xcode project for testing.</p><p>Find and copy the absolute path to your package, then go to <em>File &gt; Swift Packages &gt; Add Package Dependency…,</em> and enter file://{path} as the url. At this point you can choose what branch, commit id, or version you want to use. Continue and it will automatically install and link your project as well as any dependencies.</p><p>If you make any changes to your code, make sure to commit them then update the package within Xcode. You can do this by navigating to <em>File &gt; Swift &gt; Packages &gt; Update To Latest Package Versions</em>.</p><h4>Publishing to SPM (Swift Package Manager)</h4><p>Once you’re ready to publish to SPM, the process is almost as easy as it was to test locally. Simply push your local commits to GitHub (or any other code repo) and you can follow the process above just replacing the local filepath with the repo URL.</p><h4>Publishing to CocoaPods</h4><p>Another very popular package manager is CocoaPods. Publishing to CocoaPods is a bit more complicated than SPM, but if you’re looking to make it as easy as possible for other develops to integrate your package I would definitely recommend looking into it.</p><p>Heres a link to the documentation on the CocoaPods website if you’re interested:</p><p><a href="https://guides.cocoapods.org/making/making-a-cocoapod.html">CocoaPods Guides</a></p><h4>For additional info, check out:</h4><p><a href="https://developer.apple.com/documentation/xcode/creating_a_standalone_swift_package_with_xcode">Creating a Standalone Swift Package with Xcode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=688d13f0a6fb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/building-an-sdk-for-ios-in-swift-688d13f0a6fb">Building an SDK for iOS in Swift</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Should I use AWS Chalice for my next project?]]></title>
            <link>https://medium.com/@ndh175/should-i-use-aws-chalice-for-my-next-project-e445f262a49b?source=rss-1e9c015acc7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e445f262a49b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Nick Holbrook]]></dc:creator>
            <pubDate>Sun, 10 May 2020 02:24:48 GMT</pubDate>
            <atom:updated>2020-05-10T02:24:48.485Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2wHhv5Vp62IbZuaoK4vtg.jpeg" /></figure><p>When looking to build and deploy a new API on AWS, you’re inevitably faced with an onslaught of options when it comes to your choice of frameworks. If you spend any amount of time looking around, you’re most likely to run into AWS Chalice.</p><p>For those of you unfamiliar, Chalice is a Python Serverless Microframework designed to quickly build and deploy applicaitons on AWS Lambda and API Gateway. In theory, it’s definitely a strong contender. It’s a tool built and maintained by Amazon Web Services, and according to them you can be up and running in a little as 30 seconds. That sounds good and all, but how does it perform with real world usage?</p><p>This article will take a look at some of Chalice’s strengths and limitations, and hopefully will help you decide whether or not it’s the right choice for you.</p><h3>What you need to know before choosing Chalice</h3><p><strong>Chalice is not a very flexible framework.</strong></p><p>Chalice is designed for building simple API’s that don’t need much in terms of configuration. Certain things you would take granted in nearly every other framework — like changing the names of the certain files and a configureable project structure — simply aren’t allowed with Chalice. Chalice enforces a strict folder hierarchy and naming conventions which can be problematic when building an API with any degree of complexity.</p><p><strong>Limited deployment options.</strong></p><p>The developers of Chalice envisioned the majority of their projects to be deployed using their built in command line tool. By simply running <em>chalice deploy</em>, the framework will provision all the necessary resources on AWS and return a live url that you can instantly use to start testing your endpoints.</p><p>Seems pretty cool at first glance, right? While it’s definitely a neat party trick, that same simplicity can make things infinitely harder once you need to as much as change a single API Gateway setting. Because of the hands off approach Chalice takes, it blindly overwrites any existing settings and redeploys the resources each time you deploy the project. This wouldn’t be a problem if chalice had comprehensive support with the various Lambda / API Gateway settings, but they are sorely lacking in that department and only support a handful.</p><p>In their credit, they did foresee this issue and have rudimentary Terraform and CloudFormation support. You can also use Chalice to setup a basic Continuous Deployment pipeline, although similar to other Chalice aspects the configurability is severly limited.</p><h3>Chalice alternatives</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eS-pt45zwIKxh1dsqrbBVQ.png" /></figure><p><a href="https://github.com/awslabs/serverless-application-model"><strong>SAM</strong></a>: AWS Serverless Application Model, or SAM, is a official deployment framework from Amazon. You configure your application in a .yaml file, which is then translated into CloudFormation and deployed via a Cloudformation stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Sh3VlzOHYiBNFFcmty_PA.png" /></figure><p><a href="https://www.serverless.com/"><strong>Serverless</strong></a>: Serverless is a platform agnostic framework for deploying serverless applications similar to with SAM, you configure your application via a .yaml file which is then translated into CloudFormation and deployed into a CloudFormation stack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*i9UvaPyDBzCqciOpaM8H5w.png" /></figure><p><a href="https://github.com/Miserlou/Zappa"><strong>Zappa</strong></a>: Zappa is a framework designed to make it as easy as possible to transition from existing Flask or Django apps to serverless on Lambda and API Gateway. Although it’s a great solution if you are migrating from one of the aforementioned frameworks, I wouldn’t recommend building a new service from scratch on Zappa.</p><h3>So is Chalice right for me?</h3><p>Ultimately, the decision on whether or not to use Chalice lies within the scope of your project and what goals it eventually needs to accomplish. For simple API’s that need little configuration and just need to return data from a database, this framework is a great option for standing up services and getting a functional URL unbelievably quick. Don’t get wrong, you are completely able to make Chalice work with more complicated services. You just need to be prepared to run into limitations of the framework that will require time and some creative thinking to bypass.</p><p><strong>As long as you know what you are getting yourself into and still think Chalice could be a viable option for your project, I would strongly recommend looking into it further.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e445f262a49b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>