This is a Next.js application bootstrapped with create-next-app. It uses Prisma for database access, Zod for validation, React useState for state management, and the Geist font from Vercel.
Follow these steps to get your development environment set up.
git clone https://github.com/salvik21/TodoList.git
cd your-reponpm installCreate a .env file in the root directory:
DATABASE_URL="file:./dev.db"
Using SQLite for local development.
Run the following to set up Prisma:
npx prisma initReplace the contents of prisma/schema.prisma with:
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Todo {
id String @id @default(uuid())
title String
completed Boolean @default(false)
createdAt DateTime @default(now())
}Then generate the client and run the first migration:
npx prisma migrate dev --name init
npx prisma generatenpm install zod
useStateis included in React and does not require installation.
fetchis built-in in browsers and available globally in Next.js.
npm run devOpen http://localhost:3000 to view the app.
- Framework: Next.js
- Language: TypeScript
- ORM: Prisma
- Validation: Zod
- State Management: React
useState - Data Fetching: Native
fetch - Fonts: Geist
- Deployment: Vercel
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npx prisma studio # Open Prisma GUI
npx prisma migrate dev --name NAME # Create and apply migrationDeploy easily with Vercel.
Refer to Next.js deployment docs for more options.
You're ready! You now have a running Next.js app with:
- Prisma-powered database
- Zod schema validation
- React
useStatefor managing state - Clean UI using Geist font
Happy coding! 🎉