Robin Wieruch
Read post

Resource Names for Enterprise TypeScript Monorepos

Multi-service TypeScript monorepos often suffer from inconsistent resource naming — each team invents its own string interpolation patterns. Inspired by the Google API Design Guide, this post proposes treating resource names as first-class structured data with shared encode/decode utilities. Relative resource names follow a `collection/id` hierarchy, while full resource names prepend `//service.domain/` for cross-service identification. Resource types (`service.domain/TypeName`) handle 'what kind' of resource. A typed `ServiceName` union prevents typos at compile time, and domain-specific constants are constructed via `encodeResourceType` rather than hardcoded. The utilities live in a shared monorepo package, giving every service a single source of truth for resource identity.

    #general-programming#architecture#typescript#microservices
Mar 30•8m read time•From robinwieruch.de
Post cover image
Table of contents
The Problem with String InterpolationResource Names as a ConventionFull Resource Names for Cross-Service IdentificationResource Types: What Kind of ResourceTyped Service NamesDomain Constants Instead of Magic StringsOrganizing the Utility in a Monorepo
1.8K Impressions
Robin Wieruch's image
Robin Wieruch

Robin Wieruch is a software engineer and author known for his tutorials, books, and courses on JavaS...

1.3K Followers

•

1.7K Upvotes

rwieruch's user avatar
Robin Wieruch
@rwieruch
Joined Feb 21. 2022
1.5K

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard