Skip to main content

Summary

SMO1 is our cat-themed URL shortener (smo1.io). Today we completed a deep audit and rewrite of the three shared TypeScript packages that other SMO1 apps will import: types, configuration, and utilities. The packages had significant errors — wrong data shapes, fake features, incorrect limits — that would have caused bugs the moment any app tried to use them.

What was wrong

The shared packages were written speculatively and had drifted from what the backend (purr-api) actually supports. Key problems:
  • Advertised features that don’t exist: Password-protected links, temporary links, webhooks, custom domains for free users — none of these are real features. If a frontend had consumed these types, users would see UI for things they can’t actually use.
  • Wrong usage limits: The free tier was listed at 100 links/month. The actual limit is 5. Shipping this would either over-promise to free users or break enforcement.
  • Missing subscription tier: The early_adopter tier (our early supporters program — 50 links/month with API access) wasn’t represented at all.
  • Security exposure: The API key type included a keyHash field that the backend intentionally never sends to clients. If this leaked into a frontend, it could suggest we’re mishandling secrets.

What was fixed

All three packages were rewritten to match the backend exactly:
  • Types: 323 lines, covering every data structure the API returns — links, users, dashboard data, analytics, API keys, achievements, billing
  • Config: Correct feature flags, tier limits matching the pricing model, proper achievement categories
  • Utils: Fixed URL slug validation, correct tier limit lookups, replaced a fake “cat mood calculator” with the real link status system
Everything passes — 169 tests, clean build, clean type-check.

Why this matters

No app is importing these packages yet — they all define types locally. That’s actually good news: it means we caught these errors before they shipped to production. When meow-web (the dashboard) and other apps adopt the shared packages, they’ll get correct types from day one.

Business context

  • 6 repositories were triaged: 1 issue closed, 4 rescoped, 8 updated with current status, 1 new issue created
  • Zero breaking changes to any deployed app — all fixes are in the unreleased shared packages
  • Branch: feat/align-types-with-api in catnip-packages, ready for review and merge