Skip to content

cp-dharti-r/nextjs-server-side-validation

Repository files navigation

Next.js: How to validate forms on the server side using Zod

Strengthening Your Next.js Applications with Robust Server-Side Validation

This project demonstrates how to implement server-side validation in a Next.js application using Zod, a TypeScript-first schema declaration and validation library. Zod helps enforce types and validate inputs on the server, enhancing type safety and robustness in Next.js applications.


Getting Started

Prerequisites

Ensure you have the following installed:

  • Node.js (v18 or higher)
  • Next.js (v14 or higher)
  • Zod (v3.22 or higher)

Install dependencies:

npm install

Run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

You can start editing the page by modifying src/app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published