Skip to main content
ProductsDesktop toolsTASTECADDrawing reviewTASTEFILESFile managementTASTEFTPFile transferTASTESSHRemote workspaceTASTEZIPCompression and extractionTASTEWINMFile managementDeveloper toolsTASTECODERust integrated development environmentTASTESTUDIOIntegrated development and test environmentTASTEETLData integration (ETL)ServersTASTEREMOTERemote desktop serverTASTEGEOGeospatial serverTASTEMAILMail workspaceInvestingTASTESTOCKStock auto-trading desktop appGet startedDownloadsDocumentationBuyAll products
Marketplace
News
TechNewsToday's dev newsDeveloper docsProgramming languagesRustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWeb front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngularServer frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · ExpressApp & desktop frameworksTauriFlutterReact NativeElectronAlgorithmsAlgorithm basicsCore algorithmsAdvanced algorithmsPractical algorithms
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcaseCommunity guide
Work with usTech transferWebsite buildDesktop app buildRelease and payment pipelineSales partnerContact
ServicesRemote desktopCustom installer packages
TASTEDEV
Products

Desktop tools

TASTECADComplex drawings, opened with easeTASTEFILESJust the files you need, as fast as possibleTASTEFTPThe tidiest path for your filesTASTESSHA stronger link between you and your serversTASTEZIPPack faster, unpack saferTASTEWINMA keyboard-first file manager with two panes

Developer tools

TASTECODEEdit, build, debug and test Rust apps in one windowTASTESTUDIOFrom editing to remote tests and approved AI fixesTASTEETLMove data while you watch the values

Servers

TASTEREMOTEA remote desktop you run on your own serverTASTEGEORebuilding a GeoServer-compatible geospatial server in RustTASTEMAILTake back control of your email

Investing

TASTESTOCKStock auto-trading that follows the rules you set: when, and what

Get started

DownloadsLatest builds of every productDocsHow to use each productBuySubscriptions and perpetual licencesAll productsEvery product at a glance
All products
MarketplaceNews
Tech

News

Today's dev newsOfficial announcements on languages, frameworks, GitHub and AIDeveloper docsGuides to languages, frameworks and algorithms

Programming languages

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

Frameworks

Web front-end frameworksNext.jsReactVue.js · NuxtSvelteKitAngular
Server frameworksSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
App & desktop frameworksTauriFlutterReact NativeElectron

Algorithms

Algorithm basicsComplexity analysis · Sorting · Searching · Basic data structures · Trees and heapsCore algorithmsGraph traversal · Shortest paths & minimum spanning trees · Dynamic programming · Greedy algorithms · Divide and conquer · BacktrackingAdvanced algorithmsString algorithms · Math and number theory · Bit manipulation · Segment trees · Union-findPractical algorithmsCoding interview strategy · LRU cache · Rate limiting · Consistent hashing
All development docs
Community
ProjectsDiscover builders and their workDevelopment logsDecisions and lessons learnedPromptsReusable instructionsAI tool issuesProblems and workarounds for Claude, Codex, GeminiShowcaseFinished resultsCommunity guideHow we build in the open
Work with us
Tech transferNative apps in Rust and eguiWebsite build10 languages, accounts, docs and downloadsDesktop app buildRust and egui, no WebViewRelease and payment pipelineSigning, MSI, deb, rpm, AppImage, hashesSales partnerRecommend us and earn 30%ContactBuilds, partnerships and investment
Services
Remote desktopReach your computer from a browserCustom installer packagesOnly the features you need, settings preloaded
Buy
EN
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
Log in
Log in
TASTEDEV

From small tools to better development.

support@tastedev.netSupport TASTEDEV
ProductsProduct lineupBuyDocsDownloadsMarketplaceSupport
CommunityProjectsDevelopment logsPromptsAI tool issuesShowcase
PoliciesAbout usPrivacy policyTerms of serviceSubscription termsRefund policyCommunity guidelines
AccountLog inSign up
Visitors
Today
Yesterday
Total views
Company
GXSOFT
Representative
CHOI YOUNG GU
Business registration number
853-44-00368
Address
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
Phone
+82-10-4404-1523
Email
whitecalvin@tastedev.net
Privacy officer
CHOI YOUNG GU

© 2026 TASTEDEVProduct information is based on verified development sources.Released · improving

Next.js docs
Next.js
Getting Started with Next.jsProject StructureCore ConceptsData and StateTestingDeployment
Discussions

Next.js guide · 2/6

Project Structure

Next.js uses file-system routing: folder and file names decide your URLs and how the UI is composed. Where you put a file is therefore part of your application's design. This chapter covers the top-level folders, configuration files, special file names and the conventions you will use every day.

Top-level folders and files

A project created with create-next-app looks roughly like this (details depend on the options you chose):

my-app/
  app/
    layout.tsx        root layout
    page.tsx          home page /
    globals.css       global styles
    favicon.ico
  public/             static files such as images
  next.config.ts      Next.js configuration
  tsconfig.json       TypeScript configuration
  eslint.config.mjs   lint configuration
  package.json
  next-env.d.ts       generated type declarations
Folder or filePurpose
appThe App Router: routes, layouts and pages
publicStatic files served as-is. public/logo.png is available at /logo.png
srcOptional. If chosen, app lives in src/app
next.config.tsFramework settings such as image domains, redirects and output mode
.env*Environment variable files
proxy.tsCode that runs before a request is handled. Earlier releases call this file middleware.ts

Special file names

Inside app, only files with reserved names have special meaning. Each folder (route segment) can contain:

FileMeaning
page.tsxThe UI for that URL. A route is public only when this file exists
layout.tsxShared UI that wraps child routes and keeps its state across navigation
loading.tsxUI shown while content loads (a Suspense fallback)
error.tsxUI shown when a child throws (must be a Client Component)
not-found.tsxUI for notFound() calls and unknown URLs
route.tsA Route Handler that returns an HTTP response instead of UI
template.tsxLike a layout, but re-created on every navigation

Because of this rule you can safely colocate components, styles and tests inside route folders: anything that is not page.tsx or route.ts is never exposed as a URL.

Dynamic routes and folder conventions

Square brackets in a folder name capture part of the URL as a parameter. In recent releases params is passed as a Promise, so you await it.

// app/blog/[slug]/page.tsx  ->  /blog/hello-world
export default async function PostPage({
  params,
}: {
  params: Promise<{ slug: string }>;
}) {
  const { slug } = await params;
  return <h1>Post: {slug}</h1>;
}

The folder naming conventions are:

  • [slug]: a single dynamic segment
  • [...slug]: a catch-all segment that matches several levels (/docs/a/b/c)
  • [[...slug]]: an optional catch-all that also matches the URL without parameters
  • (marketing): a route group in parentheses. It does not appear in the URL and is used to split layouts or organize files
  • _components: a private folder starting with an underscore, excluded from routing entirely

next.config.ts

Framework configuration lives in next.config.ts (or .js, .mjs) at the project root. Writing it in TypeScript gives you autocompletion for every option.

// next.config.ts
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
  images: {
    remotePatterns: [{ protocol: "https", hostname: "images.example.com" }],
  },
  async redirects() {
    return [{ source: "/old-blog/:slug", destination: "/blog/:slug", permanent: true }];
  },
};

export default nextConfig;

Import aliases and environment variables

The paths setting in tsconfig.json maps @/ to the project root (or src), so you can write import { db } from "@/lib/db" instead of long relative paths. create-next-app configures this alias by default.

Environment variables are loaded from files such as .env, .env.local, .env.development and .env.production. Secrets usually go in .env.local, which should not be committed.

# .env.local
DATABASE_URL=postgres://user:pass@localhost:5432/app
NEXT_PUBLIC_SITE_NAME=My App

Only variables whose names start with NEXT_PUBLIC_ are included in browser code. Everything else is readable on the server only, so never give that prefix to secrets such as database URLs or API keys.

Metadata files

The app directory also supports conventional files for search engines and social sharing. Dropping in favicon.ico, icon.png or opengraph-image.png generates the matching tags automatically, while robots.ts and sitemap.ts produce their content from code.

// app/sitemap.ts
import type { MetadataRoute } from "next";

export default function sitemap(): MetadataRoute.Sitemap {
  return [
    { url: "https://example.com", lastModified: new Date() },
    { url: "https://example.com/about", lastModified: new Date() },
  ];
}

Summary

  • URLs follow the folder structure of app, and a route is public only when it has a page.tsx or route.ts.
  • Special files such as layout, loading, error and not-found divide up the UI responsibilities.
  • Folder conventions like [slug], (group) and _private handle dynamic URLs and organization.
  • Keep framework settings in next.config.ts and secrets in .env.local, and prefix only browser-safe values with NEXT_PUBLIC_.
Questions about this chapter?
Previous chapterGetting Started with Next.jsNext chapterCore Concepts

0 comments

Top commentsNewest first

Sign in · Sign in to leave a comment.