Public assets and source organization
The public directory contains assets intended to be directly accessible by URL, such as a logo or a sample text file. It is not a directory for private data. Application source may be organized under app or src/app; public and project-level configuration remain outside src. If a root app directory exists, src/app is ignored; choose one App Router root. Public assets have a conservative default cache policy, so do not assume long-lived immutable caching for every file.
Map an asset to its public URL
public/ covers/ moss.pngsrc/ app/ page.tsx layout.tsxThe asset is addressed as /covers/moss.png, not /public/covers/moss.png. The page route remains / even though its source is inside src. This example assumes the image exists and no base path is configured.
Use a meaningful image alternative
Within a catalog component, <img src="/covers/moss.png" alt="Green illustrated cover of Moss" /> describes a fictional meaningful cover. For decorative imagery use empty alt when nearby content already conveys the meaning. The next/image component is introduced later; the ordinary HTML example illustrates the path only.
Common mistake
Never place configuration secrets, source credentials, private customer exports or drafts in public. Direct URL access can bypass application UI.
Try it yourself
Given public/icons/search.svg and src/app/help/page.tsx, write the asset and UI URLs.
Example status: static walkthrough; Next.js build and browser behavior have not been executed in this authoring environment.