Skip to content

salvik21/TodoList

Repository files navigation

🚀 Next.js + Prisma Starter

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.


📦 Getting Started

Follow these steps to get your development environment set up.

1. Clone the repository

git clone https://github.com/salvik21/TodoList.git
cd your-repo

2. Install dependencies

npm install

3. Setup environment variables

Create a .env file in the root directory:

DATABASE_URL="file:./dev.db"

Using SQLite for local development.

4. Initialize Prisma

Run the following to set up Prisma:

npx prisma init

Replace 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 generate

5. Install additional libraries

npm install zod

useState is included in React and does not require installation.
fetch is built-in in browsers and available globally in Next.js.

6. Start the development server

npm run dev

Open http://localhost:3000 to view the app.


🧱 Tech Stack

  • Framework: Next.js
  • Language: TypeScript
  • ORM: Prisma
  • Validation: Zod
  • State Management: React useState
  • Data Fetching: Native fetch
  • Fonts: Geist
  • Deployment: Vercel

📚 Useful Commands

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 migration

📦 Deployment

Deploy easily with Vercel.
Refer to Next.js deployment docs for more options.


✅ Done!

You're ready! You now have a running Next.js app with:

  • Prisma-powered database
  • Zod schema validation
  • React useState for managing state
  • Clean UI using Geist font

Happy coding! 🎉

About

Todo list pracse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors