CodingIdeas.ai
← Browse All Ideas

Build Guide

How to Build a To-Do App

There are 7 things every to-do app needs to get right — and most tutorials skip 4 of them.

Beginner1–3 days

A to-do app is the "Hello World" of product development. Build it right and you'll learn CRUD, auth, real-time sync, and offline support — the foundation of every serious web app.

Data model

The core tables you'll need before writing any UI.

Userid, email, created_at
Listid, user_id, name, color, created_at
Taskid, list_id, title, completed, due_date, priority (low/med/high), position, created_at

Build order

The sequence that minimises rewrites — build in this order.

1

Static UI

Build the task list UI with hardcoded data first — input field, task row, checkbox, delete button. No state yet, just HTML/CSS.

2

Add React state

Replace hardcoded data with useState. Wire up add, complete, and delete. Store tasks in an array of objects with id, title, completed.

3

Persist to localStorage

Add a useEffect that writes tasks to localStorage on every change, and reads them back on mount. Now tasks survive a page refresh.

4

Add due dates and priority

Extend the task object with dueDate and priority. Add a date picker input and a priority selector to the add-task form. Highlight overdue tasks in red.

5

Add lists / projects

Create a List concept — tasks belong to a list. Add a sidebar to switch between lists. Store the active list ID in state.

6

Swap localStorage for Supabase

Create a tasks and lists table in Supabase. Replace all localStorage reads/writes with Supabase queries. Add Clerk for auth so tasks are per-user.

7

Drag-and-drop reorder

Add a position integer to each task. Use @dnd-kit/core to handle drag events. On drop, update the position of all affected tasks in a single batch upsert.

Build it with AI — Architect Prompt

Paste this into Claude, Cursor, Windsurf, or any AI coding tool. It includes the full context of this guide — data model, build order, and pitfalls — so the AI starts with everything it needs.

ClaudeCursorWindsurfCopilotGemini
architect-prompt.txt
<context>
App: To-Do App
Difficulty: Beginner
Estimated build time: 1–3 days

Data model:
  User: id, email, created_at
  List: id, user_id, name, color, created_at
  Task: id, list_id, title, completed, due_date, priority (low/med/high), position, created_at

Recommended build order:
  1. Static UI — Build the task list UI with hardcoded data first — input field, task row, checkbox, delete button. No state yet, just HTML/CSS.
  2. Add React state — Replace hardcoded data with useState. Wire up add, complete, and delete. Store tasks in an array of objects with id, title, completed.
  3. Persist to localStorage — Add a useEffect that writes tasks to localStorage on every change, and reads them back on mount. Now tasks survive a page refresh.
  4. Add due dates and priority — Extend the task object with dueDate and priority. Add a date picker input and a priority selector to the add-task form. Highlight overdue tasks in red.
  5. Add lists / projects — Create a List concept — tasks belong to a list. Add a sidebar to switch between lists. Store the active list ID in state.
  6. Swap localStorage for Supabase — Create a tasks and lists table in Supabase. Replace all localStorage reads/writes with Supabase queries. Add Clerk for auth so tasks are per-user.
  7. Drag-and-drop reorder — Add a position integer to each task. Use @dnd-kit/core to handle drag events. On drop, update the position of all affected tasks in a single batch upsert.

Known pitfalls to avoid:
  - Skipping optimistic updates — your UI should update instantly on click, not wait for the database round-trip. Use React Query's mutate + onSuccess pattern.
  - Storing order as an index integer — when you delete item 3 of 10, you have to renumber 4–10. Use a float-based ordering (1.0, 2.0, 1.5 for between) or the LexoRank algorithm instead.
  - Not debouncing title edits — if you save on every keystroke you'll hammer your database. Debounce the save by 500ms.

Tech stack (intermediate): Next.js + Supabase + Clerk auth + React Query for optimistic updates
</context>

<role>
You are a Senior Full-Stack Engineer and product architect who has shipped production To-Do Apps before. You know exactly where developers get stuck and how to structure the project to avoid rewrites.
</role>

<task id="step-1-clarify">
Before writing any code or spec, ask me 3–5 clarifying questions that will meaningfully change the architecture. Focus on: scale expectations, auth requirements, platform (web / mobile / both), must-have vs nice-to-have features for the MVP, and any hard constraints (budget, deadline, existing infrastructure).

<example>
BAD: "What tech stack do you want to use?" — too broad, doesn't change architecture decisions.
GOOD: "Do you need real-time sync across devices, or is single-device with periodic refresh acceptable? This decides whether we use WebSockets or simple REST polling and significantly affects infrastructure complexity."
</example>
</task>

<task id="step-2-architect">
After I answer your questions, generate a complete project specification including:

1. Final tech stack with version numbers
2. Full file and folder structure
3. Complete database schema — every table, column, type, index, and foreign key
4. All API routes with request/response shapes and auth requirements
5. Component tree with TypeScript props interfaces
6. Auth and authorisation flow (who can do what)
7. Step-by-step implementation plan in the exact build order from <context> above
8. All environment variables with descriptions

<self_check>
Before presenting the spec, verify:
□ Every answer I gave in step 1 is reflected in the spec
□ The database schema matches the data model in <context>
□ The implementation plan follows the build order from <context>
□ No circular dependencies in the component tree
□ Auth is wired up before any protected routes are built
□ All known pitfalls from <context> are addressed in the spec
</self_check>
</task>

<task id="step-2.5-agents-md">
Generate an AGENTS.md file at the project root. This file is read automatically by Claude Code, Cursor, Windsurf, Sourcegraph Cody, and all major AI coding tools at the start of every session.

Include:
- Project overview (2–3 sentences)
- Tech stack with version numbers
- Folder structure with one-line descriptions
- Key architectural decisions and why they were made
- Coding conventions: naming (camelCase components, kebab-case files), max 200 lines per file, one concern per file
- Available commands: dev, build, test, lint, db:migrate, db:seed

Note in the file: "Cursor users can symlink .cursorrules → AGENTS.md. Claude Code users can symlink CLAUDE.md → AGENTS.md."
</task>

<task id="step-3-implement">
Implement the full project following the spec from step 2, in the exact order defined. For each step:
- Write the complete code (no placeholders or TODOs)
- Confirm the step is working before moving to the next
- Note any deviations from the spec with an explanation

<constraints>
- Max 200 lines per file. WHY: every file must fit in one AI context window for easy review and editing.
- One concern per file. WHY: mixing auth logic into API routes makes it impossible to reuse — extract to lib/auth.ts.
- TypeScript strict mode, no `any` types. WHY: catches data shape mismatches at compile time, not in production at 2am.
- All database queries in server components or API routes only. WHY: keeps credentials server-side, prevents accidental client-side exposure.
- All environment variables documented in .env.example. WHY: the next developer (or your future self) should be able to set up the project in under 5 minutes.
- Comment every non-obvious decision. WHY: AI tools read your comments to understand intent — without them, the next edit will break the pattern you established.
</constraints>
</task>

How to use this prompt

  1. 1.Copy the prompt above
  2. 2.Open Claude, Cursor (Cmd+L), or Windsurf
  3. 3.Paste the prompt and send — the AI will ask 3–5 clarifying questions
  4. 4.Answer the questions, then it generates your full project spec
  5. 5.Continue in the same session to implement step by step

Common mistakes

What trips up most developers building this for the first time.

⚠️

Skipping optimistic updates — your UI should update instantly on click, not wait for the database round-trip. Use React Query's mutate + onSuccess pattern.

⚠️

Storing order as an index integer — when you delete item 3 of 10, you have to renumber 4–10. Use a float-based ordering (1.0, 2.0, 1.5 for between) or the LexoRank algorithm instead.

⚠️

Not debouncing title edits — if you save on every keystroke you'll hammer your database. Debounce the save by 500ms.

Recommended tech stack

Pick the level that matches your experience.

Beginner

React + localStorage — complete MVP in a day, no backend needed

Intermediate

Next.js + Supabase + Clerk auth + React Query for optimistic updates

Advanced

Next.js + Supabase Realtime + CRDT-based conflict resolution for multi-device real-time sync

Take it further — related ideas

Each comes with revenue math, a full build guide, and a prompt to paste into Claude or Cursor.

9 ideas in the archive

Ship in:
beginnerProductivity

NoteShip - Shareable Public Pages From Obsidian Notes Instantly

Your Obsidian note is brilliant. Your client cannot open a .md file. NoteShip turns any Obsidian markdown paste into a shareable, readable public URL in one click — like Notion public pages but for people who actually write in Obsidian.

Time to ship1 week
DemandHigh
Revenue7/10
AI quality score6/10
View Details →
beginnerProductivity

VaultMark - One-Click Obsidian Markdown to PDF and Word Exporter

Obsidian is where your best thinking lives, but sharing it means fighting pandoc on a Friday afternoon. VaultMark lets you paste raw Obsidian markdown and get a clean, formatted PDF or DOCX in under 10 seconds. No CLI, no plugins, no copy-paste degradation.

Time to ship1 week
DemandVery High
Revenue7/10
AI quality score7/10
View Details →
beginnerProductivity

ArchiveSafe - ChatGPT Conversation Backup Before the Archive Button Destroys Your Work

You spend 3 hours in a ChatGPT thread building something brilliant, click Archive, and poof — good luck finding it ever again. ArchiveSafe is a browser extension that intercepts the Archive action and auto-exports your conversation to searchable Markdown before it disappears. Think Time Machine for your ChatGPT brain.

Time to ship10 days
DemandVery High
Revenue8/10
AI quality score8/10
View Details →
intermediateBusiness Automation

TimeSync - Real-Time Monday.com to Toggl and Harvest Bridge With Full Task Context

Monday.com passes 'Monday App' as the project name to every time tracking tool, making billable hours useless for client invoicing. TimeSync listens to Monday board events and auto-creates Toggl and Harvest entries with the actual task name, board, and assignee so your timesheet actually matches your work.

Time to ship2 weeks
DemandHigh
Revenue7/10
AI quality score6/10
View Details →
intermediateProductivity

VoiceCast - Private On-Device Text-to-Speech for Documents and Emails

Your documents deserve a voice, but not one that phones home to Google or OpenAI. VoiceCast converts PDFs, emails, and DOCX files to MP3 entirely on your machine — no cloud, no data leaks, no compliance headaches.

Time to ship2 weeks
DemandHigh
Revenue7/10
AI quality score7/10
View Details →
intermediateProductivity

FolderWise - AI File Organizer That Actually Reads Your Files Before Moving Them

Your Downloads folder is a crime scene and Finder's search is basically useless for 'that contract from last March.' FolderWise watches your messy folders, reads file contents via embeddings, and auto-proposes a clean structure you approve with one click. No more grep, no more manual sorting, no more hunting for that pitch deck.

Time to ship3 weeks
DemandHigh
Revenue7/10
AI quality score7/10
View Details →
beginnerProductivity

ChatExport - One-Click Gemini Chat History Exporter to Markdown, PDF, and DOCX

Gemini has no export button and users are manually copy-pasting entire research sessions into Word and reformatting for 20 minutes. ChatExport is a Chrome extension that detects your Gemini chats and exports them clean in one click. Your AI research sessions deserve better than Ctrl+A, Ctrl+C.

Time to ship1 week
DemandVery High
Revenue7/10
AI quality score7/10
View Details →
beginnerProductivity

ChronoStack - Async-First Meeting Scheduler That Eliminates the 6am Standup for Distributed Teams

Your Istanbul-to-Vancouver team has exactly one 30-minute window where everyone is vaguely conscious and it keeps getting booked for a standup that could have been a Loom. ChronoStack analyzes your team's timezone spread, calendar density, and meeting preferences, then recommends a weekly meeting architecture that minimizes synchronous time while keeping async handoffs visible and accountable. Distributed team leads will pay $29/month before the coffee brews.

Time to ship10 days
DemandHigh
Revenue6/10
AI quality score6/10
View Details →
intermediateSales Automation

RedditLense - Automated Reddit Prospect Radar with CRM Sync

Your SDRs are spending three hours per day manually scrolling Reddit looking for buying signals like 'anyone recommend a tool for X' — that is a $90/hour problem dressed up as a $15/hour task. RedditLense monitors keyword-triggered Reddit posts in real-time, scores each post for buyer intent using NLP, and pushes warm leads directly into HubSpot or a Pipedrive webhook. First five SDRs pay $99/month each before you write a single line of marketing copy.

Time to ship2 weeks
DemandVery High
Revenue8/10
AI quality score7/10
View Details →