๐ฅ PROMPT: Next.js Todo Application (Modern, Scalable)
- Get link
- X
- Other Apps
๐ง 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 ๐
Perfect choice ๐
Here’s the converted prompt for a LOCAL-ONLY Todo Application in Next.js — no 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
windowaccess (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
- Get link
- X
- Other Apps
Comments
Post a Comment