๐Ÿ”ฅ PROMPT: Next.js Todo Application (Modern, Scalable)

 

๐Ÿง  ROLE

You are a Senior Full-Stack Engineer and Next.js 15+ expert.
Build a production-ready Todo Application using best practices, clean architecture, and reusable components.


๐ŸŽฏ GOAL

Create a fast, responsive, and scalable Todo App that supports authentication, real-time updates, and clean UX.


๐Ÿงฉ TECH STACK (MANDATORY)

  • Framework: Next.js 15+ (App Router)

  • Language: TypeScript

  • Styling: Tailwind CSS

  • State Management: Zustand

  • Forms & Validation: React Hook Form + Zod

  • Data Fetching: TanStack Query

  • Database: PostgreSQL

  • ORM: Prisma

  • Auth: NextAuth (Google SSO + Credentials)

  • Deployment Ready: Vercel

  • API: Next.js Route Handlers

  • Linting: ESLint + Prettier


๐Ÿงฑ CORE FEATURES

✅ Authentication

  • Google OAuth login

  • Email & password login

  • Protected routes (middleware)

  • User-specific todos


๐Ÿ“ Todo Management

  • Create, edit, delete todos

  • Mark todo as completed / pending

  • Due date support

  • Priority levels (Low, Medium, High)

  • Category / Tag support

  • Search & filter todos

  • Sort by date, priority, status


๐Ÿ“Š UI / UX

  • Fully responsive (mobile-first)

  • Sidebar navigation

  • Dark / light mode toggle

  • Empty states & loading skeletons

  • Toast notifications

  • Keyboard shortcuts (Enter to add, Cmd/Ctrl + K to search)


⚡ Performance & DX

  • Server Components where applicable

  • Optimistic UI updates

  • Debounced search

  • Reusable UI components

  • Clean folder structure


๐Ÿ—‚️ DATABASE SCHEMA (PRISMA)

User - id - name - email - image - createdAt Todo - id - title - description - completed - priority - dueDate - userId - createdAt - updatedAt

๐Ÿงญ APP STRUCTURE

app/ ├─ auth/ ├─ dashboard/ │ ├─ todos/ │ ├─ layout.tsx ├─ api/ │ ├─ todos/ │ ├─ auth/ components/ ├─ ui/ ├─ todo/ lib/ ├─ prisma.ts ├─ auth.ts store/ ├─ todoStore.ts

๐Ÿ” API REQUIREMENTS

  • POST /api/todos – Create todo

  • GET /api/todos – Fetch user todos

  • PUT /api/todos/:id – Update todo

  • DELETE /api/todos/:id – Delete todo

All APIs must:

  • Be authenticated

  • Validate input with Zod

  • Handle errors properly


๐Ÿงช EXTRA (OPTIONAL BUT RECOMMENDED)

  • Drag & drop reordering

  • Offline support (local cache)

  • Analytics dashboard (completed vs pending)

  • Export todos as CSV

  • PWA support


๐Ÿ“ฆ DELIVERABLES

  • Complete Next.js project

  • Prisma schema + migrations

  • Environment variable examples

  • README with setup & deployment steps

  • Production-ready code (no placeholders)


๐Ÿš€ FINAL INSTRUCTION

Follow clean code principles, write scalable components, and ensure the app can be extended into a paid SaaS product later.


If you want, I can also:

  • ๐Ÿ”ฅ Convert this into a local-only app

  • ๐Ÿ’ฐ Turn this into a paid SaaS prompt

  • ๐Ÿ“ฑ Create a React Native version

  • ๐Ÿง  Add AI features (smart task suggestions)

Just tell me ๐Ÿ‘

Convert this into a local-only app

Perfect choice ๐Ÿ‘
Here’s the converted prompt for a LOCAL-ONLY Todo Application in Next.jsno backend, no auth, no server, fully browser-based, fast, and privacy-friendly.

You can paste this as-is into an AI code generator.


๐Ÿ”ฅ PROMPT: Local-Only Todo Application (Next.js)

๐Ÿง  ROLE

You are a Senior Frontend Engineer and Next.js 15+ expert.
Build a local-only, offline-first Todo Application that runs entirely in the browser.


๐ŸŽฏ GOAL

Create a fast, minimal, privacy-first Todo App where all data is stored locally and never leaves the user’s device.


๐Ÿงฉ TECH STACK (MANDATORY)

  • Framework: Next.js 15+ (App Router)

  • Language: TypeScript

  • Styling: Tailwind CSS

  • State Management: Zustand

  • Forms: React Hook Form

  • Validation: Zod

  • Storage: localStorage (with hydration handling)

  • Deployment: Vercel (static compatible)

๐Ÿšซ NO BACKEND
๐Ÿšซ NO DATABASE
๐Ÿšซ NO AUTHENTICATION


๐Ÿงฑ CORE FEATURES

๐Ÿ“ Todo Management

  • Create, edit, delete todos

  • Mark as completed / pending

  • Due date support

  • Priority (Low / Medium / High)

  • Tags / categories

  • Drag & drop reorder

  • Bulk actions (mark all complete, delete completed)


๐Ÿ” Search & Filter

  • Search by title or tag

  • Filter by:

    • Completed / Pending

    • Priority

    • Category

    • Due date (Today / This Week / Overdue)

  • Sort by:

    • Created date

    • Due date

    • Priority


๐ŸŽจ UI / UX

  • Fully responsive (mobile-first)

  • Sidebar navigation

  • Light / Dark mode (saved locally)

  • Smooth animations

  • Empty states & skeleton loaders

  • Toast notifications

  • Keyboard shortcuts


⚡ Offline-First Behavior

  • Persist todos to localStorage

  • Load data safely after hydration

  • Auto-save on every change

  • Graceful handling if storage is unavailable


๐Ÿ—‚️ STATE STRUCTURE (ZUSTAND)

Todo { id: string title: string description?: string completed: boolean priority: 'low' | 'medium' | 'high' dueDate?: string tags: string[] createdAt: string }

๐Ÿง  ZUSTAND STORE REQUIREMENTS

  • Add / update / delete todo

  • Toggle completion

  • Reorder todos

  • Persist & rehydrate from localStorage

  • Versioned storage (for future migrations)


๐Ÿงญ APP STRUCTURE

app/ ├─ layout.tsx ├─ page.tsx components/ ├─ todo/ │ ├─ TodoItem.tsx │ ├─ TodoList.tsx │ ├─ TodoForm.tsx ├─ ui/ store/ ├─ useTodoStore.ts lib/ ├─ storage.ts ├─ constants.ts

๐Ÿ” DATA HANDLING RULES

  • Use client components only

  • Guard window access (typeof window !== 'undefined')

  • Prevent hydration mismatch

  • No server actions

  • No API routes


๐Ÿงช OPTIONAL (BONUS FEATURES)

  • PWA support (offline installable)

  • Import / Export todos (JSON)

  • Undo / redo

  • Daily productivity stats

  • Focus mode


๐Ÿ“ฆ DELIVERABLES

  • Complete Next.js project

  • Clean, reusable components

  • Well-documented Zustand store

  • Local persistence logic

  • README with setup instructions


๐Ÿš€ FINAL INSTRUCTION

This app must:

  • Work 100% offline

  • Be blazing fast

  • Respect user privacy

  • Be easily extendable later into a SaaS app

Comments

Popular posts from this blog

Prompt Todo version 2

Privacy Policy