Next.js Configuration
The Next.js configuration is defined innext.config.ts at the project root:
Key Configuration Options
TypeScript Settings
false in production for stricter type checking.
ESLint Settings
Image Optimization
Adding a New Image Source
To allow images from a new domain:Component Configuration
Thecomponents.json file configures the shadcn/ui component system:
Configuration Properties
style: Component variant style (“default” or “new-york”)rsc: Enable React Server Componentstsx: Use TypeScriptbaseColor: Base color palette (“neutral”, “slate”, “gray”, etc.)cssVariables: Use CSS variables for themingprefix: Optional prefix for component class names
Path Aliases
The aliases configuration maps import paths to file system locations:Icon Library
Project Structure
The source code is organized in thesrc/ directory:
Key Directories
app/
Contains the Next.js App Router pages and layouts. The [lang] directory enables dynamic routing for internationalization.
components/
Reusable React components:
ui/- shadcn/ui components (Button, Card, Dialog, etc.)- Custom components for specific features
dictionaries/
JSON files containing translations for each supported language.
lib/
Shared utilities and helper functions:
dictionaries.ts- Loads translationsutils.ts- Common utilities (includingcn()for class merging)
Middleware Configuration
Thesrc/middleware.ts file configures request handling:
Matcher Configuration
The matcher defines which routes the middleware applies to:/api/*- API routes/_next/static/*- Static assets/_next/image/*- Image optimization/images/*- Public images/favicon.ico- Favicon
Environment Variables
Create a.env.local file in the project root for environment-specific configuration:
Variable Prefixes
NEXT_PUBLIC_*- Exposed to the browser- No prefix - Server-side only
Using Environment Variables
TypeScript Configuration
Thetsconfig.json in the project root configures TypeScript:
Path Mapping
Thepaths configuration enables the @/ import alias:
Tailwind Configuration
Tailwind CSS is configured intailwind.config.ts. See the Theming page for detailed information about customizing colors, fonts, and styles.
Build Configuration
Build the project for production:.next/ directory.
Build Output
- Static pages are pre-rendered
- Server components are bundled separately
- Client JavaScript is code-split automatically
- Images are optimized on-demand
Development
Start the development server:http://localhost:3000 with:
- Fast Refresh for instant feedback
- Hot Module Replacement
- Error overlay for debugging