Computer Science

Computer Science

In this section, we explore the world of programming, algorithms, networks, and infrastructure

ProgrammingAlgorithmsComputer NetworksTechnologyInfrastructureSoftware EngineeringHardware Engineering

دسته‌بندی‌های مرتبط

مقالات منتخب

Error Handling in Next.js – Expected Errors, Uncaught Exceptions, and Error Boundaries

Next.js categorizes errors into expected errors and uncaught exceptions. This article explains how to handle form errors with useActionState, show custom 404 pages with notFound, and define error boundaries for unexpected exceptions. It also covers event handler errors, startTransition exceptions, and global error handling in the root layout.

/persian/article-fa/nextjs-error-handling-expected-errors-boundaries-404-global

Styling in Next.js – Tailwind, CSS Modules, Global Styles, and CSS Ordering

Next.js offers multiple ways to style your application, including Tailwind CSS, CSS Modules, global stylesheets, external packages, Sass, and CSS-in-JS. This article walks through how to set up each method, manage stylesheet ordering, and understand the differences between development and production behavior.

/persian/article-fa/nextjs-css-styling-tailwind-modules-global-ordering

Image Optimization in Next.js – Local and Remote Images with the <Image> Component

Next.js provides a powerful <Image> component that extends the native <img> element with built-in optimization features. This article explores how to use the component for local and remote images, prevent layout shifts, enable lazy loading, and configure remote image domains securely.

/persian/article-fa/nextjs-image-optimization-local-remote-blur-placeholder

Font Optimization in Next.js – Self-Hosting Google and Local Fonts with next/font

The next/font module in Next.js enables automatic font optimization by self-hosting Google and local fonts. This eliminates external requests, improves privacy, and prevents layout shift. This article explains how to use next/font with Google fonts, local font files, and multiple font variants for better performance and design flexibility.

/persian/article-fa/nextjs-font-optimization-google-local-self-hosting-performance

Metadata and OG Images in Next.js – SEO, Shareability, and Dynamic Generation

Next.js provides powerful tools for defining metadata and Open Graph (OG) images to improve SEO and social sharing. This article explains how to use static and dynamic metadata, special files like favicon and opengraph-image, and generate OG images using JSX and CSS with ImageResponse.

/persian/article-fa/nextjs-metadata-og-images-seo-sharing-dynamic-generation

Route Handlers in Next.js – Custom Request Handling with Web APIs and Typed Context

Route Handlers in Next.js allow you to define custom HTTP request handlers directly within the app directory. This article explains how to create route.ts files, use supported HTTP methods like GET and POST, leverage NextRequest and NextResponse, control caching, and type route parameters using RouteContext.

/persian/article-fa/nextjs-route-handlers-api-request-response-context

Proxy in Next.js – Redirects, Rewrites, and Header Control Before Request Completion

Proxy in Next.js allows you to intercept and modify requests before they complete. This article explains how to use proxy.ts to perform redirects, rewrites, and header modifications based on incoming requests. It also outlines best practices, limitations, and how to configure path matching for route-specific proxy logic.

/persian/article-fa/nextjs-proxy-redirect-rewrite-header-control

Deploying Next.js – Node.js Server, Docker Container, Static Export, and Platform Adapters

Next.js can be deployed as a Node.js server, Docker container, static export, or adapted to platform-specific infrastructure. This article explains each deployment method, feature support, development tips, and how to upgrade to the latest or canary versions of Next.js..

/persian/article-fa/nextjs-deployment-node-docker-static-adapters-upgrade

Adding Analytics to Your Next.js Application – Web Vitals, Error Tracking, and External Reporting

Next.js offers built-in tools for measuring performance and reporting analytics. This article explains how to use the useReportWebVitals hook, set up instrumentation-client for global tracking, and send metrics to external services like Google Analytics or custom endpoints.

/persian/article-fa/nextjs-analytics-web-vitals-client-instrumentation-google-reporting

Implementing Authentication in Next.js – Secure Sign-Up, Validation, and Session Management

Authentication in Next.js involves verifying user identity, managing sessions, and controlling access to routes. This article walks through building a secure sign-up form using Server Actions and useActionState, validating fields with Zod, and creating user accounts with hashed passwords. It also highlights best practices and tips for improving user experience.

/persian/article-fa/nextjs-authentication-signup-validation-session-management

Session Management in Next.js – Stateless Cookies, Database Sessions, Encryption, and Secure Logout

Session management in Next.js ensures that a user's authenticated state persists across requests. This article explains how to create, store, refresh, and delete sessions using stateless cookies or database-backed sessions. It covers JWT encryption with Jose, secure cookie settings, and best practices for performance and security.

/persian/article-fa/nextjs-session-management-cookies-database-encryption-logout

Authorization in Next.js – Optimistic Checks, Data Access Layer, and Role-Based Control

Once a user is authenticated, authorization in Next.js determines what routes and data they can access. This article explains optimistic and secure checks, using Proxy for early redirects, building a centralized Data Access Layer (DAL), applying Data Transfer Objects (DTOs), and rendering components based on user roles in Server Components.

/persian/article-fa/nextjs-authorization-access-control-user-role-dal