{
  "version": "https://jsonfeed.org/version/1",
  "title": "ai on Cliff538 ",
  "icon": "https://avatars.micro.blog/avatars/2025/10/1700855.jpg",
  "home_page_url": "https://cliff538.com/",
  "feed_url": "https://cliff538.com/feed.json",
  "items": [
      {
        "id": "http://cliff538.micro.blog/2026/04/18/custom-oura-ring-data-board.html",
        "title": "Custom Oura Ring Data Board ",
        "content_html": "<p>Poking around, I found out that Oura ring has a robust API, so I wanted to see what Claude Code could do with it. It took an afternoon of fiddling, but it seems to be a robust custom data board with about 4 years of data, that updates itself 3 times a day to a SQLite database. It runs on my Mac Mini home server.</p>\n<p>I can download my CSV data from the data board, and I also set it up to run a monthly report that makes an Apple Note for me and files it away. I had it run monthly reports for the past 4 years, and it&rsquo;s an excellent way to digest sleep data.</p>\n<p>The best part is a second page on the dashboard called the Correlation Explorer, where you can see how tag data affects your sleep. You do have to remember to add tags, late meals, massage, medication, sauna, vaccinations, etc., and you can start to see what is helping and hurting your rest. You can see the evidence on my board. On this note, my wife swears that a hot shower before bed helps you fall asleep faster. That&rsquo;s the next test that will be tracked with tags. We shall see.</p>\n<p>I know a lot of people don&rsquo;t like A.I., but I&rsquo;m still in awe of the things I can build with it. This is so far beyond my skill level. And the data analysis that I can now do is truly helping my sleep. The older I&rsquo;ve gotten, the worse my sleep has been. I&rsquo;ve increased my sleep by one hour per night just from the Oura ring data.</p>\n<p>I like the Oura ring app, and they have their own web view that is really nice, but being able to customize what you want to see and how is pretty neat.</p>\n<p>If you have any trouble with sleep, I highly recommend using the Oura ring for 6 months or so, using tags, and figuring out what helps and hurts your sleep.</p>\n<img src=\"uploads/2026/2026-04-16-12.15-photo.png\" width=\"600\" height=\"1555\" alt=\"Auto-generated description: A comprehensive dashboard displays health and activity metrics, including sleep patterns, heart rate, and daily movements, against a gradient background.\">\n<img src=\"uploads/2026/2026-04-18-3.24-photo.png\" width=\"600\" height=\"784\" alt=\"Auto-generated description: A correlation explorer displays numerical data linking various tags to different aspects of sleep quality, showcasing metrics such as baseline scores, tags for better sleep, and tags for worse sleep on a gradient background.\">\n<p>For the curious, here are some technical details.</p>\n<p>The Stack Snapshot:</p>\n<ul>\n<li><strong>Next.js 14 (App Router) + TypeScript + Tailwind</strong> on the frontend and API layer.</li>\n<li><strong>SQLite via <code>better-sqlite3</code></strong> &ndash; synchronous API, ~23MB database holding ~4.4 years of history.</li>\n<li><strong>Node.js v22</strong>, brew-pinned on the prod host.</li>\n<li><strong>PM2</strong> managing the Next.js process on port 3001 (alongside a sibling &ldquo;Status Board&rdquo; app on 3000).</li>\n<li><strong>launchd</strong> for scheduled jobs (not cron &ndash; it&rsquo;s macOS).</li>\n<li><strong>Tailscale</strong> for access; the dashboard has no public internet exposure.</li>\n<li>About <strong>2,800 lines</strong> across the key files (ingest, queries, schema, pages), <strong>22 React components</strong>.</li>\n</ul>\n<p>The Data Pipeline:</p>\n<p>Pulls 16 endpoints from Oura&rsquo;s v2 API on a <strong>14-day incremental window</strong> per run. Deliberately <strong>skips <code>heartrate</code> and <code>interbeat_interval</code></strong> &ndash; those would 10x the DB for no visible dashboard benefit, and can be backfilled later if HRV analysis ever happens.</p>\n<ul>\n<li><strong>Idempotent by design.</strong> Every row is an <code>INSERT OR REPLACE</code> on the Oura-assigned document ID (with <code>UNIQUE(day)</code> constraints on daily tables). Re-running ingest is a safe no-op; late-arriving recomputes overwrite stale scores.</li>\n<li><strong>Two-column storage pattern.</strong> Each table has explicit parsed columns for fast queries <em>plus</em> a <code>raw TEXT NOT NULL</code> column holding the entire API JSON. If I want to derive a new column later, I don&rsquo;t need to re-pull the API &ndash; just run a query over the raw JSON. Full-fidelity audit log, zero lossy transformations.</li>\n<li><strong>Every run is logged</strong> to an <code>ingest_runs</code> table (endpoint, start/end dates, status, doc counts, errors). Makes it trivial to see &ldquo;did the 8am run land last night&rsquo;s sleep yet?&rdquo; &ndash; which I used twice this week.</li>\n<li><strong>~150 API requests, ~5 seconds per run</strong> &ndash; well under Oura&rsquo;s 5000 req / 5 min limit, which leaves tons of room for backfill runs.</li>\n</ul>\n<p>Scheduling:</p>\n<p><code>launchd</code> fires <code>npm run ingest</code> <strong>three times daily</strong> (8:00, 12:00, 16:00). The multiple fires exist because Oura&rsquo;s detailed sleep endpoint publishes ~1&ndash;3h post-wake, so the 8am run catches the score, later runs catch the detail. A separate monthly <code>launchd</code> job fires on the 1st at 9:15am to produce a digest.</p>\n",
        "date_published": "2026-04-18T16:49:49-06:00",
        "url": "https://cliff538.com/2026/04/18/custom-oura-ring-data-board.html",
        "tags": ["photo","learning","coding","ai"]
      },
      {
        "id": "http://cliff538.micro.blog/2026/01/29/building-an-online-microblog-editor.html",
        "title": "Building An Online Micro.blog Editor",
        "content_html": "<p>Inspired by <a href=\"https://micro.blog/numericcitizen\">@numericcitizen</a> and his editor, I set out to use <a href=\"https://vercel.com\">Vercel</a> and build a custom Micro.blog editor for my 3 blogs.</p>\n<p>I made a free (hobby) account at Vercel and then got to work in Claude Code. Told it what I wanted, and for the first try, it was pretty good. It took me about 4 hours working with CC to iron out all the kinks. The biggest problems were with the media folder, uploading photos, and making cross-posting work correctly. But we got through all the issues, and it is working very nicely.</p>\n<img src=\"uploads/2026/cleanshot-2026-01-28-at-21.51.392x.png\" width=\"600\" height=\"578\" alt=\"Auto-generated description: A blog editor interface displaying a media library, draft post options, and fields for title, categories, and markdown content.\">\n<p>I can choose which blog to post to, and it automatically populates the media folder, cross-posting options, and categories. I can send it to MB as a draft or a post. I can save the drafts locally as a JSON file and/or download all files.</p>\n<p>Hats off to <a href=\"https://micro.blog/manton\">@manton</a> for a nice API to work with, <a href=\"https://micro.blog/numericcitizen\">@numericcitizen</a> for the inspiration, and Claude Code for the ease in making something like this, because it is way beyond my skill level.</p>\n<p>I put the web app behind a password-protected splash screen, since it is custom to my blogs only. I can only imagine the havoc if someone nefarious got into this. There are other security measures I can deploy as well. Vercel has been easy to use and understand. Their hobby plan seems sufficient for now. Interesting note: Vercel has its own AI agent. Once you connect your GitHub account, it can send its own pull requests. I let it send a PR for adding analytics, and it worked very well. Kind of fun to watch it all take place over on GitHub.</p>\n<p>I&rsquo;m going to use this for a while and see if it sticks. It&rsquo;s really not needed because there is such a nice Mac App for MB that this is not necessary, but it sure shows you the possibilities. One area where it may come in handy is on the road with just my iPad; I can use the Web App to post.</p>\n<p>I think my next project may be making an iOS app.</p>\n",
        "date_published": "2026-01-29T09:38:39-06:00",
        "url": "https://cliff538.com/2026/01/29/building-an-online-microblog-editor.html",
        "tags": ["photo","learning","coding","ai"]
      },
      {
        "id": "http://cliff538.micro.blog/2026/01/28/claude-code-makes-a-cliff.html",
        "title": "Claude Code Makes A Cliff538 Status Board ",
        "content_html": "<p>I know, way too many posts out there about AI Agents making apps. But, in my opinion, this is what they are for. My coding skills are at a hobby level, and now I can code using English, and it&rsquo;s really fast and really good.</p>\n<p>Today, &ldquo;we&rdquo; made an online Cliff538 Status Board web app. Not a single mistake was made; it went very smoothly. The only changes were asking whether certain APIs allowed more information to be displayed, and cosmetic changes to improve the look. I have a spare iPad on my desktop that keeps the page up and refreshing for me. Overkill, I know, but it&rsquo;s a hobby. It&rsquo;s damn fun.</p>\n<p>It refreshes every 30 seconds, runs locally on my Mac Mini, and is accessed using Tailscale.</p>\n<p>I love it.</p>\n<p>I can see more custom apps in my near future. This really cements the purchase of the Mac Mini as a home server; this web app running locally hardly uses any resources. &ldquo;We&rdquo; code locally on my office Mac and push to GitHub, then I screen share into the mini and have it download changes from GitHub. It&rsquo;s a very nice system.</p>\n<p>I will soon investigate <a href=\"https://vercel.com\">Vercel</a> as an option for a VPS.</p>\n<p>Lately, another good use for Claude/ChatGPT has been to upload my HTML and CSS files for cleanup, commenting, adding a nice Table of Contents, etc. It makes me feel better to have my personal blog web pages neat and organized.</p>\n<p>Well, that&rsquo;s it until the next web app or, hopefully, an iPhone app soon. I&rsquo;ve taken many <a href=\"https://www.hackingwithswift.com\">courses</a> on iOS apps and Swift, and it never clicked for me; it&rsquo;s a very hard language. I much more enjoy Python, HTML, CSS, and some JS. Excited to see how Claude and I work together on that.</p>\n<p>It&rsquo;s been a wonderful day futzing with this.</p>\n<p>I can&rsquo;t have you check out the live web app because it&rsquo;s not on the internet, just on my Tailscale Network, but here is a screenshot:</p>\n<img src=\"uploads/2026/cleanshot-2026-01-28-at-13.49.182x.png\" alt=\"Auto-generated description: A dark-themed dashboard displays various analytics, service monitors, and user activities, along with social media updates and photography sections.\">\n",
        "date_published": "2026-01-28T15:29:36-06:00",
        "url": "https://cliff538.com/2026/01/28/claude-code-makes-a-cliff.html",
        "tags": ["photo","learning","coding","ai"]
      }
  ]
}
