<?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 James on Medium]]></title>
        <description><![CDATA[Stories by James on Medium]]></description>
        <link>https://medium.com/@nzjames?source=rss-211f08370b29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cvfst-jrbimkRmih.png</url>
            <title>Stories by James on Medium</title>
            <link>https://medium.com/@nzjames?source=rss-211f08370b29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:48:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nzjames/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[service-get-feed-url-list]]></title>
            <link>https://medium.com/@nzjames/service-get-feed-url-list-a4ceaed4027a?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4ceaed4027a</guid>
            <category><![CDATA[devlog]]></category>
            <category><![CDATA[rss]]></category>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Sat, 10 Mar 2018 08:14:54 GMT</pubDate>
            <atom:updated>2018-03-10T08:15:40.908Z</atom:updated>
            <content:encoded><![CDATA[<p>Following yesterday’s list of things, to add users and scale I need the system that processes feeds to be more robust.</p><p>Currently I’m using step functions with an inline script that queries <em>all </em>the rss feeds in the DB and passes them on to the main get feed lambda.</p><p>Step functions cost more than zero dollars so it’s something to think about in terms of the value they add. Maybe, maybe not.</p><p>Next step her is to re-write the service-get-feed-url-list as a module instead of an inline function. In conjunction with this the feeds need updating to reflect their frequency either by an RSS spec type frequency param or something I can average out from the posts in the feed. This can be refreshed somehow periodically.</p><p>Then with a modified list of feeds and frequency, map the get feed function to use this.</p><p>Need to figure out the actual scheduling based on the frequency. One of the goals here is to manage capacity on writing to dynamo, try and level out the spikes.</p><p>With that in mind maybe a high freq lambda ~5 minutes that can get the next ~10 feeds to process. The No. of feeds to process can scale up and I can scale dynamo write capacity with this but it will be constant and not spiky.</p><p>So when feeds are got. Maybe they should set a next query time and the cron job can just get the oldest next query time.</p><p>NB: even feeds that update super frequently eg 10 times an hour don’t need to be updated this quickly. It’s not a goal at the moment to be realtime.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4ceaed4027a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A list of things]]></title>
            <link>https://medium.com/@nzjames/a-list-of-things-6926551ee25d?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/6926551ee25d</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devlog]]></category>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Fri, 09 Mar 2018 06:14:18 GMT</pubDate>
            <atom:updated>2018-03-09T06:20:30.831Z</atom:updated>
            <content:encoded><![CDATA[<p>Analogue Reader is the working title of my new app. And it’s a reasonable prototype of what I want it to become. It needs a bunch of work to get to a launchable state but probably less than I think. What follows is a list of things I’ve built for Analogue Reader and maybe a list of the next most important things to do. There’s no more context than this. As the sub line of the blog reads bad at writing.</p><h4>Concept UI</h4><p>The most recent thing of been wasting time on is a concept UI and basic design language for the app. This has been mostly a distraction justified by the desire to understand the value of the Tailwind CSS library. My working assumption is that the concept UI becomes the base of a consistent App UI.</p><h4>Admin</h4><p>A funny thing about using a NoSQL DB is that you don’t always get the responses you expect. While I was debugging really poor feed responses I decided to mock up a simple admin to check feeds and recent articles. The bug turned out to be a timeout on the Lambda but the Admin proved useful to get a good understanding of Dynamo querying and using a single API gateway endpoint with a proxy configuration and managing routing through a single lambda. This UI by design has no style to keep me grounded in the goal of an open accessible application. It’s a separate UI but backed by the same functions project used for the main app.</p><h4>Prototype App</h4><p>Has the main feed a list of feeds where articles can be read. A manage page to add and remove feeds. Register and signin pages. This has a goal of being a super lean PWA but currently is very much prototype code. It doesn’t use any transpilation but uses a lot of ES6+ including runtime module resolution</p><h4>Functions</h4><p>For the admin a single function and a few modules for the client a lot of route handlers. And some library functions. And a Dynamo layer called DB</p><p>One (group of) functions is the ability to resolve a high res logo or icon from a feed by visiting the page of the first article and looking for an apple-touch-icon resource and caching it in S3</p><h4>AWS services currently in use</h4><ul><li>S3 for functions and caching images</li><li>API gateway</li><li>Cognito</li><li>Dynamo</li><li>Lambda</li><li>SNS</li><li>Step functions</li><li>Cloudwatch</li></ul><p>This has all been hand rolled in one account.</p><h3>Next</h3><p>This list is what I think needs doing</p><ul><li>Fix the schedule task currently running twice an hour to resolve all feeds to either run per feed or batch similar feeds together. This was the cause of bad data, basically the article resolver was timing out. This strategy needs to scale out to a lot of feeds so might needs a nearly n runs per feed.</li><li>Cloud formation templates to enable spinning up and tearing down whole stacks of the app</li><li>Consolidate API gateway into single endpoint for the main app and introduce routing.</li><li>Add read through caching to the client to show last know set of articles and increase perceived performance.</li><li>Re-build user/accounts to have a better username system and to consider billing.</li><li>Create specific account just for the app.</li><li>Chose domain and deploy app with certificate.</li><li>Wire in subscription + upgrade + downgrade + termination</li><li>Consolidate concept UI and bring across to main app.</li><li>Write initial PWA support.</li><li>Cache images/ rescale for mobile</li><li>Add json feed support</li><li>identify why some feeds don’t write articles eg NASA</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6926551ee25d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Some notes on AWS Cognito]]></title>
            <link>https://medium.com/@nzjames/some-notes-on-aws-cognito-276b59f72313?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/276b59f72313</guid>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Tue, 09 Jan 2018 10:01:55 GMT</pubDate>
            <atom:updated>2018-01-09T10:01:55.643Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Cognito looks like an attractive way to add authentication into a web app. I recalled that it is used in the <a href="https://aws.amazon.com/getting-started/serverless-web-app/">Serverless Web Application</a> tutorial on AWS and while at the time of doing that exercise I didn’t take it all in the tutorial provides a pretty good jumping off point to go and figure it all out.</p><p>Configuring the User Pools in AWS is pretty straightforward, the only gotcha I had was enabling link verification requires a domain name to be configured in the App integration. Once I found this note on a stray GitHub issue it was easy to get up and running with the boilerplate pages and functions for register, verify and sign in.</p><p>Previously I had missed how the user pool is attached to an API as an authorizer. This is pretty simple to configure and sweet to see the response from the test method when you paste in a valid auth token obtained from tutorial app page.</p><p>Integrating this into the my App as a header seemed a little more challenging, using the tutorial as a jumping off point they use pretty vanilla JS, bootstrap, JQuery etc. and globals. While this would have been good enough to get it into my app it wouldn’t set up the best foundation for authentication and identity management. It was also a timely reminder that I’m writing my first ES6 module based app with runtime module resolution. This provided a good opportunity to re-factor some code structure and rename a few things and port the relevant cognito methods across to be accessible via es6 imports.</p><p>It’s been a surprising evening with no major regressions and a lot of working code. The main feed now has authentication token when requesting data. Next step is to write some test lambdas to figure out how the user data can be accessed on the back end and how to use this to create custom feeds.</p><p>Supplementary; I put this code down for a few weeks while the whether has been good and while the app has kept working the amount of new news seemed low. Investigating the cause of this suggests it related to limits using scan on DynamoDB and this makes sense, I’ve very little design in my data model at present. It was useful to be reminded that dynamo is a key value store and not a SQL or NoSQL DB and more like Cassandra. Good info to have to hand as I start to build a model for users and think about ways to performantly denormalise the data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=276b59f72313" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Still hacking not writing]]></title>
            <link>https://medium.com/@nzjames/still-hacking-not-writing-c55db7ba93f4?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/c55db7ba93f4</guid>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Sun, 10 Dec 2017 09:34:21 GMT</pubDate>
            <atom:updated>2017-12-10T09:34:21.197Z</atom:updated>
            <content:encoded><![CDATA[<p>An interesting position to be in is being a novice. Having not much AWS experience, instead of procrastinating on the need to learn how things work before I commit to building them — I’m just fucking doing it. This feel like how I used to learn and leaning into having no idea as being a good thing as opposed to it leading to feeling inadequate or an imposter is so refreshing.</p><p>Having no idea, but having a hunch that infrastructure in AWS even serverless should be considered transient and stacks should be spun up and torn down as needed and that building this into my product from the get go makes sense — sent me down the path of looking at Serverless Application Model? (SAM) as a way of doing infrastructure-as-code. SAM is an abstraction on AWS Cloudformation and seemed promising, until my first real attempt at a serverless stack including and API Gateway configuration turned out to not be able to configure CORS via code. There was a github issue, there were work arounds but I’ll come back to this when it seems to do everything I need or at least more than it does today. For now it’s all console.</p><p>I thought about names, Respect stuck with me for a few hours. I thought about exploring Māori words and there are some interesting ones around respect and also reading. I might investigate this track a bit further.</p><p>Off the back of the SAM tutorial I had going I had enough inspiration to try and put the list of feeds being requested every 30 minutes into a DB table. This took way longer than it should have and really showed through one of my habits of understanding the bare minimum of how to do something. I got it going along with an awful vanilla HTML form and hey! I can add new feeds now. — Also learnt about putting table names in lambda environment variables, this seems like a good idea.</p><p>I think I’ve finally fixed sorting. This has always been bust and I’ve kinda fixed it but then adding more feeds showed it was proper broken. So today, deleted all articles and started re-saving them as 8601 dates inc timezone data. I added a created date, this seemed useful. I copied but didn’t think about sorting dates being a little more complicated than I thought. Also with dates and new feeds I stumbled on articles posted in the future or more likely without timezone information and for the day that New Zealand is already well into. So for future posts I’m setting the date to the current time as it would have been published in the last 30 minutes or so since the article getter thing has run. — Just found a bug with this, I’m using the date as the sort key and creates a duplicate article for each run until the future becomes the past. Hm….</p><p>Bonus: since adding more feeds, I’m seeing the icons for them so my early work getting the icon pipeline working seems worth it :big_grin:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c55db7ba93f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[So I wrote the first post so I could write about APIs]]></title>
            <link>https://medium.com/@nzjames/so-i-wrote-the-first-post-so-i-could-write-about-apis-da0bcb76b024?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/da0bcb76b024</guid>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Tue, 05 Dec 2017 08:42:00 GMT</pubDate>
            <atom:updated>2017-12-05T08:42:00.821Z</atom:updated>
            <content:encoded><![CDATA[<p>I know how important good API design is. I’ve not built many myself but I’ve used some awful ones and I’ve used a few good ones. The one that I use every day that I think is great is the GitHub API. Even if the majority of my usage is via their web site it’s easy to see how consistent and predictable the core public API is and whenever I’ve needed to script something against the API it’s always been pleasant to use.</p><p>So my API at present is something like /{list+} and this is passed to a function and news articles get returned. At minimum first pass this app will need to support getting multiple feeds, groups of feeds, adding/organising feeds, user settings, etc. Thinking about users should they support “teams” or “organisations”. I have no idea at the moment but there is probably some value in mapping out a candidate API so when it comes to add features they can be done in a consistent way and not be based on whatever convention I have in my head at the time of implementing.</p><p>I know github support GraphQL but I’m picking my battles and that one isn’t one for today. The <a href="https://developer.github.com/v3/#schema">GitHub API v3</a> documentation is awesome! As an aside I’m already hitting article ordering problems depending on whether I run a “get-feed” from my local test env or on AWS and one of the first things the GitHub API documents is date formats, Well worth a read I’m dreading my future post on dates.</p><p>Reading the GitHub API documentation I’ve got a bunch of inspiration on how to design the API even though the domain is completely different (c’mon it’s the internet — it will be lists of things and detail pages).</p><p>At its simplest at least for the getting the feeds I’m thinking of</p><p>/feeds/[username]/ list/dashboard of feeds</p><p>/feeds/[username]/hour stream of feeds with an hourly frequency eg news sites.</p><p>/feeds/[username]/day stream of feeds with a daily frequency eg active bloggers.</p><p>/feeds/[username]/[groupname]/ stream of feeds based on user defined group. Could be public private etc.</p><p>This is pretty loose and if anyone ever reads this I’ll probably need to change my tagline to “Bad at writing. Bad at Software” but at least writing it down has helped me plan my next step which is extending beyond a single endpoint /{list+/.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da0bcb76b024" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First post! But not quite the beginning.]]></title>
            <link>https://medium.com/@nzjames/first-post-but-not-quite-the-beginning-cee10751f3b6?source=rss-211f08370b29------2</link>
            <guid isPermaLink="false">https://medium.com/p/cee10751f3b6</guid>
            <dc:creator><![CDATA[James]]></dc:creator>
            <pubDate>Tue, 05 Dec 2017 07:56:17 GMT</pubDate>
            <atom:updated>2017-12-05T07:56:17.436Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m exploring an idea. Scratching an itch as they say. I‘ve been a web enthusiast — an aligned with standards kind of developer for a long time. And I long for a simpler web where websites just work and content loads fast.</p><p>After drastically reducing my Twitter usage due to social media fatigue I wandered how to fill the gap of the value I got from its service. It was my primary news source for everything. I want to explore if I can make an RSS reader that has a stream feel to it and which is instant in its speed.</p><p>I have a boat load of ideas and learning goals and this is the start of the journey. It’s easy to write code, solve one more bug, add one more feature. It’s much harder to manage a product. This is the first goal and it means planning, writing and sharing the journey. This could be the last blog post — I hope it isn’t.</p><p>I’m doing this all in on AWS infrastructure, I don’t get to dive very deep as part of my day job and it seems negligent not to learn more than how to put objects in S3.</p><p>So it’s not quite the beginning, I’ve been hacking away for a month or so and I have something, it’s not what I want but it’s nearly useful enough that I keep coming back each day to add the next feature to make it more useful.</p><p>So far I’ve got an API gateway, some functions, an event, a database table and some objects in S3 and this is enough to create a news feed. It’s not performant yet, it probably wont scale, its untested, a little buggy and only exists in production and I’m willing to share it (I wonder if that means I always need to keep this version running?)</p><p><a href="http://com.zeronode.feed.ui.prod.s3-website-us-west-2.amazonaws.com/">Analogue Feed</a></p><p>As of writing it can resolve a number of RSS/Atom feeds do a little bit of processing to nab nice site icons and re-jig the content available in the RSS feed to be formatted into something that fits well in a stream. That’s it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cee10751f3b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>