Nakodo looks at creators on YouTube, Instagram and TikTok, and at businesses from open map listings. Four kinds of thing, and one channels table:
export const channels = pgTable ( " channels " , { // YouTube channel ID (UC...); on other platforms the platform and the // lowercase handle, e.g. "tiktok:name" id : text (). primaryKey (), platform : text ({ enum : PLATFORMS }). notNull (). default ( " youtube " ),
Enter fullscreen mode
Exit fullscreen mode
So a primary key can read as any of these:
UCsBjURrPoezykLs9EqgamOA instagram:home.barista tiktok:coffee.nerd web:08f194ad1b1ec1d60386bb3bb6e1e0a7
Enter fullscreen mode
Exit fullscreen mode
YouTube IDs have no prefix because they came first and because they already carry a shape nobody else uses. Everything added since names itself. The whole type test is one character:
export function platformOf ( channelId : string ): Platform { if ( ! channelId . includes ( " : " )) return " youtube " ; const prefix = channelId .…