SeeRepo with Next.js
SeeRepo recognizes a Next.js app from the next package in its package.json. It works with the App Router and the Pages Router, and with monorepos: each package is read with its own framework.
What SeeRepo reads
App Router
- Every
pagefile is a screen. - Every
routefile is an action. Routes underapi/cron/are things that run on their own. - Webhooks are API doors for machines: SeeRepo spots them by their path, or by the signature check inside them (Stripe's
constructEvent, Svix, Shopify's HMAC). So are.well-known, anapi/mcproute, the sitemap,robotsand Open Graph images. - A file that starts with
'use server'is an action: your server actions. middlewareandinstrumentationare doors too, andlayout,loadinganderrorfiles are special files of the router.
Pages Router
- Files under
pages/are screens, andpages/api/are actions. _appand_documentare doors.
Who comes in
A screen that requires a session is for Signed-in people; one that doesn't is for Visitors. Webhooks come from Machines.
An example from our test bank
vercel/nextjs-subscription-payments, a Next.js App Router starter with Supabase and Stripe, read at a fixed commit:
- 4 screens, 4 actions and 1 API door (
app/api/webhooks/route.ts, Stripe's webhook) - 5 data models from its Supabase migration: customers, prices, products, subscriptions and users
- Services found with their proof: Supabase (8 files) and Stripe (7 files)
- 3 screens for visitors and 1 that requires a session (
app/account/page.tsx)
Good to know
- Data models are read from Prisma, Supabase migrations and Mongoose. Drizzle models aren't read yet: in our bank,
nextjs/saas-starteruses Drizzle and its map shows no data models. - Services come from three signals: the packages you import, the names of your environment variables and the URLs in your code.
- See also Supabase, Prisma and Mongoose.