Coding Horizon

AI Finds The Five Files That Explain Any Codebase

The video makes one kind of checkable claim, and it makes it repeatedly: that a repository announces what it is through conventions you can recognise before you have read any of its code. An app directory and a config file mean one framework, a prisma folder means one data layer, spec files and a test config mean a test suite, and a handful of commands will confirm or destroy any of it in seconds.

Those conventions are what is on screen, so those are what is sourced here: the file names, the default locations, the commands and what each command actually does. Everything else in the video is method rather than fact.

Framework conventions the picture reads off the tree

Route handlers live at app/api/**/route.ts, and export one function per HTTP method. The Next.js file convention reference for route.js states that “A route file allows you to create custom request handlers for a given route. The following HTTP methods are supported: GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS”, and shows export async function POST(request: Request) {} as the handler shape. The same page notes Route Handlers were introduced in version 13.2.0. Source: Next.js docs, File conventions, route.js https://nextjs.org/docs/app/api-reference/file-conventions/route

A route handler sets a session cookie through the Set-Cookie header. The same reference gives the pattern directly: “you can return a new Response using the Set-Cookie header”, with headers: { 'Set-Cookie': ... } on the returned response. Source: as above.

The config file is next.config.js, next.config.mjs or next.config.ts. The Next.js CLI reference names all three as the config file the framework loads. Source: Next.js docs, CLI, next typegen https://nextjs.org/docs/app/api-reference/cli/next

next dev serves on port 3000 unless told otherwise. The CLI reference lists -p or --port <port> with “Default: 3000, env: PORT”, and states “By default, Next.js uses http://localhost:3000 during development and with next start”. Source: as above.

Prisma’s schema is at prisma/schema.prisma. The schema overview says it “is typically a single file called schema.prisma”, and the location page gives the default lookup order as ./prisma/schema.prisma first, then ./schema.prisma. Sources: Prisma docs, Prisma schema overview https://www.prisma.io/docs/orm/prisma-schema/overview and Prisma docs, Schema location https://www.prisma.io/docs/orm/prisma-schema/overview/location

Spec files and a test config are what a Vitest suite looks like. Vitest’s default include is ['**/*.{test,spec}.?(c|m)[jt]s?(x)'], which is why a *.spec.ts file is picked up without being registered anywhere, and the config file it looks for is vitest.config.ts, which overrides vite.config.ts. Sources: Vitest docs, include https://vitest.dev/config/include and Vitest docs, Configuring Vitest https://vitest.dev/config/

The checks the video says to run

rg is ripgrep, and its default output carries line numbers. ripgrep’s own help text for -n, --line-number reads “Show line numbers (1-based). This is enabled by default when stdout is connected to a tty”, checked against ripgrep 14.1.1 on the machine this was written on. The project README also states “By default, ripgrep will respect gitignore rules and automatically skip hidden files/directories and binary files”, which is why a search in an unfamiliar repo does not drown in build output. Source: ripgrep https://github.com/BurntSushi/ripgrep

tsc --noEmit type checks without producing files. The TypeScript reference for the option describes it as “Do not emit compiler output files like JavaScript source code, source-maps or declarations”, with the stated use case of TypeScript serving “as a source code type-checker”. Source: TypeScript docs, noEmit https://www.typescriptlang.org/tsconfig/noEmit.html

eslint . lints the current directory. The ESLint command line reference gives npx eslint . and notes that the file arguments can be omitted entirely because “ESLint will use .”. Source: ESLint docs, Command Line Interface https://eslint.org/docs/latest/use/command-line-interface

The package scripts are evidence, and they live in one place. npm’s scripts documentation states that “The "scripts" property of your package.json file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts”, and gives pretest, test, posttest as the order npm test runs. Source: npm docs, scripts https://docs.npmjs.com/cli/v11/using-npm/scripts

The hidden rule the video draws as a real constraint

A client component importing a server only module fails at build time. Next.js documents the server-only package for exactly this: import it “into a file that contains server-only code”, and then “if you try to import the module into a Client Component, there will be a build-time error”. The docs add that Next.js handles the import internally to give a clearer message rather than using the package contents. Source: Next.js docs, Server and Client Components https://nextjs.org/docs/app/getting-started/server-and-client-components

Not checked