Prompt Todo version 2

 

๐Ÿง  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: Next.js Todo Application (Modern, Scalable)

Privacy Policy