Menu

Six market sections on our site come out of three files, and half of them end in a card that is not a site
📰

Six market sections on our site come out of three files, and half of them end in a card that is not a site

DEV Community: nextjs·Daniel Pertu·about 14 hours ago
#Anjip5ZY
#devtonextjs#devto#dev#europe#sites
Reading 0:00
15s threshold

notifio.app/alerts is the hub page for a desktop app that watches rental search pages. It has one card per site we have written a guide for, grouped into sections. I went looking for how those groups are decided, because the answer turned out to be three separate things that only agree by accident.

Counting what is actually there:

15 site pages

3 TypeScript files holding them (431 + 380 + 548 = 1,359 lines)

6 market keys in the union that groups them

6 sections rendered on the hub

7 distinct region strings inside those sections

3 cards on the page that are not sites

The last line is the one I did not expect.

Three files, six groups, and no relationship between them

The sites live in a directory split by geography:

src/lib/alerts/ ├── index.ts ← the barrel, the MARKETS list, the helpers ├── types.ts ← the AlertSite type └── sites/ ├── netherlands.ts 431 lines, 5 sites ├── uk.ts 380 lines, 4 sites └── europe.ts 548 lines, 6 sites

Enter fullscreen mode

Exit fullscreen mode

The grouping on the page…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.