Build a Family Dashboard

Build and deploy a private calendar dashboard for a spare family screen.

Introduction

30 Second Summary

Old phones and tablets often end up in a drawer even though their screens still work perfectly. Meanwhile, family plans are scattered across calendars, notes, and whoever remembers to mention them.

In this project, you will turn a spare phone or tablet into a live family dashboard for the moments your household checks most. You will direct Claude Code through the build before publishing it on Vercel with the private calendar feed protected on the server.

What You'll Build

On your spare screen, you'll watch the clock tick beside today's real events while persistent family controls and NASA's daily picture stay ready for the next glance.

By the end of this project, you'll have:

  • A responsive family display with a ticking clock, today's schedule from Google Calendar, a live countdown, and the daily space image from the NASA Astronomy Picture of the Day API.
  • Tap-friendly household controls that preserve kid checklists and an active nap after the display refreshes.
  • A deployed dashboard that keeps the calendar feed in a production Secret and opens from a Home Screen shortcut on your spare device.
  • Secret Mission: Add a calm evening palette that switches on automatically after 6:00 PM.

Are there any prerequisites?

No development experience is required because the guide walks through every setup from scratch. You need a paid Claude plan or Claude Console access, a Google account, a Vercel Hobby account, and a spare phone or tablet with a modern browser.

Before We Start

A useful family dashboard starts with a clear job in your household. Your one-sentence plan connects a spare browser-capable screen in a specific location to one daily household problem.

Set Up Node.js and Claude Code

Your spare screen has a purpose. The next hurdle is preparing the computer that creates its dashboard.

This step installs Node.js with npm. It also authenticates Claude Code before any project files are created.

In this step, get ready to:
  • Install Node.js v26.13.1 LTS with npm.
  • Install Claude Code 2.1.322.
  • Create the empty family-dashboard folder.
Install Node.js and npm

Node.js provides the JavaScript runtime that powers the dashboard. Its bundled npm command manages the packages that the project needs.

macOS

  • Press Cmd+Space to open Spotlight.
  • Type Terminal.
  • Press Enter to open Terminal.

Windows

  • Press Win+X to open the system menu.
  • Select Terminal or Windows PowerShell.

A version check reveals whether the required runtime is already available. It also confirms that npm arrived with it.

  • Check the installed Node.js version plus the npm version by running:
node --version
npm --version

What do these commands check?

  • The first command asks Node.js to print its installed version.
  • The second command confirms that the npm package manager is available.

✔️ I see v26.13.1

Your JavaScript toolchain is ready. The npm output can use a different version number.

ⓧ I see an older version

The installed Node.js release is below the version used by this project. Install the required LTS release before continuing.

macOS

  • Visit the Node.js download page.
  • Choose the v26.13.1 LTS download offered for macOS.
  • Run the downloaded installer.
  • Close the current Terminal window.
  • Press Cmd+Space to reopen Spotlight.
  • Type Terminal.
  • Press Enter to open a fresh Terminal window.

Windows

  • Visit the Node.js download page.
  • Choose the v26.13.1 LTS Windows Installer.
  • Run the downloaded installer.
  • Keep the installer defaults.
  • Close the current terminal window.
  • Press Win+X to reopen the system menu.
  • Select Terminal or Windows PowerShell.

ⓧ Command not found

Your computer cannot find Node.js yet. Install the required LTS release for your operating system.

macOS

  • Visit the Node.js download page.
  • Choose the v26.13.1 LTS download offered for macOS.
  • Run the downloaded installer.
  • Close the current Terminal window.
  • Press Cmd+Space to reopen Spotlight.
  • Type Terminal.
  • Press Enter to open a fresh Terminal window.

Windows

  • Visit the Node.js download page.
  • Choose the v26.13.1 LTS Windows Installer.
  • Run the downloaded installer.
  • Keep the installer defaults.
  • Close the current terminal window.
  • Press Win+X to reopen the system menu.
  • Select Terminal or Windows PowerShell.
  • Confirm the Node.js installation by running both version checks again:
node --version
npm --version

What confirms success?

The Node.js output should begin with v26. The npm command should print a version number on the next line.

Still missing a version?

  • Confirm that you closed the terminal window that was open during installation.
  • Confirm that you opened a new terminal after the installer finished.
  • Rerun the Node.js installer if the version still does not appear.

Ask for help with a Node.js installation that is not visible in a new terminal.

Install and authenticate Claude Code

Claude Code reads your instructions from the terminal. It can then create the dashboard files inside the folder you choose.

Claude Code requires paid access. The browser sign-in flow authenticates your account without asking you to paste credentials into the terminal.

  • Check whether Claude Code is already installed by running:
claude --version

What does this command check?

This command asks Claude Code to print its installed release. The result determines which installation path you need.

✔️ I see 2.1.322 (Claude Code)

Claude Code is already on the required release. You can continue to authentication.

ⓧ I see an older version

The native installer updates Claude Code through its current release channel. Choose your operating system below.

macOS

  • Update Claude Code by running the native installer:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?

This downloads Anthropic's native macOS installer script. The script installs the current Claude Code release for your user account.

  • Close the current Terminal window after the installer finishes.
  • Press Cmd+Space to reopen Spotlight.
  • Type Terminal.
  • Press Enter to open a fresh Terminal window.

Windows

  • Update Claude Code by running the native PowerShell installer:
irm https://claude.ai/install.ps1 | iex
What does this command do?

This downloads Anthropic's native Windows installer script. PowerShell runs the script to install the current Claude Code release.

  • Close the current PowerShell window after the installer finishes.
  • Press Win+X to reopen the system menu.
  • Select Terminal or Windows PowerShell.

ⓧ Command not found

Claude Code has not been installed yet. Choose your operating system below.

macOS

  • Install Claude Code by running the native installer:
curl -fsSL https://claude.ai/install.sh | bash
What does this command do?

This downloads Anthropic's native macOS installer script. The script installs the current Claude Code release for your user account.

  • Close the current Terminal window after the installer finishes.
  • Press Cmd+Space to reopen Spotlight.
  • Type Terminal.
  • Press Enter to open a fresh Terminal window.

Windows

  • Install Claude Code by running the native PowerShell installer:
irm https://claude.ai/install.ps1 | iex
What does this command do?

This downloads Anthropic's native Windows installer script. PowerShell runs the script to install the current Claude Code release.

  • Close the current PowerShell window after the installer finishes.
  • Press Win+X to reopen the system menu.
  • Select Terminal or Windows PowerShell.
  • Confirm the Claude Code installation by running:
claude --version

What confirms success?

The result should show 2.1.322 followed by (Claude Code).

The sign-in flow opens a browser for your paid Claude account. You return to the terminal after authentication succeeds.

  • Start the authentication flow by running:
claude

What happens next?

Claude Code starts its browser sign-in flow when authentication is required. A successful login returns you to the Claude Code prompt.

  • Complete the browser sign-in with your paid Claude account.
  • Return to the terminal after the browser confirms authentication.

That is the account setup complete. Claude Code can now accept instructions from your terminal.

Unable to reach the Claude Code prompt?

  • Confirm that your Claude account includes Claude Code access.
  • Complete any unfinished browser sign-in page.
  • Open a new terminal if the installed command is still unavailable.

Ask for help with a Claude Code installation or sign-in problem.

Create the dashboard folder

Claude Code applies its work inside the folder where you start it. A dedicated folder keeps every future dashboard file in one place.

  • Close the authenticated Claude Code terminal window.

macOS

  • Press Cmd+Space to open Spotlight.
  • Type Terminal.
  • Press Enter to open a new Terminal window.
  • Create family-dashboard on your Desktop by running:
cd ~/Desktop
mkdir family-dashboard

What do these commands do?

  • The first command moves the terminal to your Desktop.
  • The second command creates an empty family-dashboard folder there.
  • Confirm that the folder exists by running:
ls

What does this command show?

This lists the items on your Desktop. You should see family-dashboard in the output.

  • Move into the new folder by running:
cd family-dashboard

What does this command do?

This changes the terminal's current location to the empty family-dashboard folder. Claude Code now has a clean place for the project.

Windows

  • Press Win+X to open the system menu.
  • Select Terminal or Windows PowerShell.
  • Create family-dashboard on your Desktop by running:
Set-Location ([Environment]::GetFolderPath('Desktop'))
New-Item -Path 'family-dashboard' -ItemType Directory

What do these commands do?

  • The first command moves PowerShell to your Desktop.
  • The second command creates an empty family-dashboard folder there.
  • Confirm that the folder exists by running:
ls

What does this command show?

This lists the items on your Desktop. You should see family-dashboard in the output.

  • Move into the new folder by running:
Set-Location 'family-dashboard'

What does this command do?

This changes PowerShell's current location to the empty family-dashboard folder. Claude Code now has a clean place for the project.

Before you run the final checks, which version prefixes do you expect the terminal to report?

  • Verify all three tools from this newly opened terminal by running:
node --version
npm --version
claude --version

What does this final check prove?

  • The Node.js line proves that the required JavaScript runtime is available inside the project folder.
  • The npm line proves that package installation is available.
  • The Claude Code line proves that the coding agent is available from the same terminal.

You should see a Node.js version beginning with v26. You should also see an npm version plus Claude Code 2.1.322 followed by (Claude Code).

  • Start Claude Code inside family-dashboard by running:
claude

Why start Claude Code here?

Claude Code uses the terminal's current folder as its project context. Starting it here keeps future file writes inside family-dashboard.

  • Ask Claude Code to identify its current folder by typing:
What folder are you working in?

What does this question verify?

The response reveals Claude Code's active project location. It should end in family-dashboard.

Your runtime is installed. Claude Code is authenticated inside an empty dashboard folder.

Claude Code reports another folder?

  • Close the current Claude Code session.
  • Return to the terminal window where you created family-dashboard.
  • Repeat the folder navigation command for your operating system.
  • Start Claude Code again from inside the folder.

Ask for help with starting Claude Code in the correct project folder.

Your computer is ready to build. Next up, Claude Code turns this empty folder into the first visible family dashboard.

Build the First Visible Dashboard

Your runtime is ready inside family-dashboard. Claude Code is already working from that empty folder.

A blank folder cannot show your family anything yet. This step uses sample events to get a working screen in front of you quickly.

In this step, get ready to:
  • Generate a pinned JavaScript Next.js 16.4.6 App Router project.
  • Confirm the installed package versions.
  • Launch the dashboard to inspect its temporary schedule.
Direct Claude Code to build the dashboard

The project needs a browser interface before it can become a household display. The prompt below gives Claude Code the complete boundary for this first version.

  • Paste this prompt into Claude Code:
Create a minimal Next.js 16.4.6 JavaScript App Router project in this empty folder. Do not use TypeScript, Tailwind, a database, or Git. Pin these exact dependencies in package.json: next 16.4.6, react 19.3.1, react-dom 19.3.1, node-ical 0.27.6, and Vercel CLI 65.15.0 as a devDependency. Add dev, build, start, Vercel signup, Vercel login, Vercel environment, deploy, project-list, and project-delete scripts matching the final project specification.

For this first version, create app/layout.js, app/page.js, and app/globals.css. Make app/page.js a Client Component. Show a very large live clock, today's date, three sample events, a countdown to the next sample event, and a clear Sample schedule badge. Use large touch targets and a responsive card layout that will fit an old tablet. Do not add Google Calendar or NASA yet. Then run npm install and tell me exactly when it is safe to run the development server.

What Does This Prompt Create?

  • The project manifest pins the exact framework packages needed throughout the project.
  • The first React page renders a clock with temporary schedule data.
  • The Vercel CLI scripts prepare the project for deployment in a later step.
  • The styling creates responsive cards with large touch targets for the spare screen.

The dependency installation can take a few minutes while npm downloads the packages.

  • Approve each proposed file write when Claude Code asks for permission.
  • Approve the dependency installation when Claude Code asks for permission.
  • Wait for Claude Code to confirm that the development server is safe to run.

You should see Claude Code create package.json, app/layout.js, app/page.js, and app/globals.css. The dependency installation should finish without an error.

Claude Code Did Not Finish the Build?

  • Check the Claude Code prompt for a file-write permission request.
  • Approve the dependency installation if Claude Code is waiting for command permission.
  • Paste the original build prompt again if Claude Code stopped before creating every required file.

Help me diagnose why Claude Code stopped while creating my Next.js dashboard.

Check the generated project

Pinned versions keep Claude Code's generated files aligned with the final project. A version check catches dependency drift before you start the server.

  • Ask Claude Code to report the installed versions by pasting:
List the exact package versions you installed

What Should the Version List Show?

  • The next package is pinned to 16.4.6.
  • The react package is pinned to 19.3.1.
  • The react-dom package is pinned to 19.3.1.
  • The node-ical package is pinned to 0.27.6.
  • The vercel development dependency is pinned to 65.15.0.
  • Choose the tab that matches your generated project.

✔️ Everything is in place

Your dependency versions match the prompt. The generated project is ready for its first browser test.

ⓧ I'd like to double check the project

Your generated project should match these checkpoints.

  • The package.json manifest is named family-dashboard. It pins next to 16.4.6, react to 19.3.1, react-dom to 19.3.1, node-ical to 0.27.6, and vercel to 65.15.0.
  • The manifest contains dev, build, start, vercel:signup, vercel:login, vercel:env, deploy, vercel:projects, and vercel:delete scripts.
  • The app/layout.js file imports ./globals.css. It exports Family Dashboard metadata. It renders the page inside an English HTML document.
  • The app/page.js file is a Client Component. It contains a live clock with the date. It generates three sample events with a next-event countdown. It displays the Sample schedule status.
  • The app/globals.css file contains warm high-contrast styling. Its responsive cards support a clock, status badge, schedule, countdown, and large touch targets.
  • Return to Claude Code if a checkpoint is missing.
  • Tell Claude Code which checkpoint needs correction.
  • Approve the requested correction.
Run the sample dashboard

The development server turns the generated files into a local website. It stays active so the clock can keep updating in your browser.

Before you run it, which part of the dashboard do you expect to change without a page refresh?

  • Start the development server from Claude Code's shell mode by running:
! npm run dev

What Does This Command Do?

  • The ! prefix runs a shell command directly from the Claude Code prompt.
  • The dev script starts the local Next.js development server.
  • The running process serves the dashboard from your family-dashboard folder.
  • Keep the development server running in Claude Code.
  • Open http://localhost:3000 in your browser.
  • Watch the clock for several seconds.

You should see a large ticking clock, today's date, three sample events, a countdown, and a visible Sample schedule status.

That first screen is working: your empty folder now contains a live dashboard. The Sample schedule badge marks the data gap you will close next.

Dashboard Not Loading?

  • Confirm the development server is still running in Claude Code.
  • Check that the address is exactly http://localhost:3000.
  • Return to the dependency step if Claude Code reports a missing package.

Help me troubleshoot why my local Next.js family dashboard does not load.

Your dashboard is running from the files Claude Code created. Next, you will replace the temporary schedule with your household's calendar while keeping its private address on the server.

Connect Google Calendar Securely

Your dashboard already turns a spare screen into a ticking schedule. The visible sample badge proves the first version is running.

A family command center needs today's real events. In this step, you will connect Google Calendar through a server-only route so the private calendar address never reaches the browser.

In this step, get ready to:
  • Copy your private read-only calendar address without sharing it.
  • Create a server-only calendar route with Claude Code.
  • Replace the sample schedule with today's real events.
Copy the private calendar address

The Secret address in iCal format provides read-only access to one calendar. Anyone with this address can read that feed.

Treat This Address Like a Password

This credential deserves extra care. You will copy it once without pasting it into Claude Code, source code, chat, or a terminal command.

If the address is ever exposed, Google Calendar provides a Reset control that invalidates the old address.

  • Open Google Calendar on your computer.
  • Open Settings.
  • Select your calendar under Settings for my calendars.
  • Select Integrate calendar.
  • Copy the Secret address in iCal format.

Your private feed address is now ready for one local paste. Keep it on your clipboard until the local environment file is ready.

Create the server-only calendar route

An API route can fetch the private calendar on the server. The browser receives only the event fields needed for the dashboard.

The node-ical library parses the calendar feed. It also expands recurring events into the individual instances that belong near today.

  • Switch back to the Claude Code session inside your family-dashboard folder.
  • Paste this exact prompt into Claude Code:
Add a server-only Google Calendar integration. Create app/api/calendar/route.js using the Node.js runtime and node-ical 0.27.6. Read the calendar URL from process.env.API_SECRET. Fetch and parse the iCal text on the server, expand recurring events only across a small window around today, and return a minimal JSON object with configured, events, id, title, start, end, allDay, and dateKey. Never return or log API_SECRET. Update app/page.js so it fetches /api/calendar, uses real events when configured, keeps sample events only when the variable is missing or the route fails, filters events to the browser's local day, and calculates the countdown in the browser.

Also create a local .env.local file containing only this placeholder:
API_SECRET=your-google-calendar-secret-address-here

Stop after creating the placeholder. Do not ask me to paste the real address into this conversation.

What Does This Prompt Create?

  • The new app/api/calendar/route.js route reads process.env.API_SECRET only on the server.
  • The route reduces each calendar entry to a safe object containing its identifier, title, timing, all-day state, and local-day helper.
  • The updated app/page.js requests /api/calendar without receiving the private feed address.
  • The new .env.local file starts with a harmless placeholder so Claude Code never needs the real credential.
  • Review the proposed file changes.
  • Approve the proposed file writes.
  • Wait for Claude Code to report that the placeholder file has been created.

You should now have app/api/calendar/route.js plus an updated app/page.js. You should also have a local .env.local file containing the placeholder.

Did Claude Code Ask for the Real Address?

Do not paste the private address into the conversation. Remind Claude Code to create only the placeholder shown in the prompt.

If the generated files do not match the requested boundary, ask Claude Code to review them without sharing your credential. Help me check the server-only calendar boundary without exposing my private iCal address.

Store the secret and verify real events

A local environment variable gives the server access to the calendar address without placing it in application code. Next.js keeps variables without the public prefix on the server.

  • Return to the terminal running the development server.
  • Stop the server by pressing Ctrl + C.

The terminal should return to its normal command prompt. The stopped server can safely reload the new environment value during its next start.

  • Use a local text editor outside Claude Code to open .env.local inside the family-dashboard folder.

You should see one line containing API_SECRET=your-google-calendar-secret-address-here.

  • Replace only your-google-calendar-secret-address-here with the copied iCal address.
  • Save .env.local.

Before you restart the dashboard, do you expect the sample badge to remain or the live calendar status to replace it?

  • Restart the development server by running:
npm run dev

Why Restart the Server?

The development server loads .env.local when it starts. Restarting makes API_SECRET available to the server-only route.

  • Open http://localhost:3000 in your browser.
  • Refresh the dashboard once.

You should see Google Calendar live with events from today. A calendar with no events should show No events today without displaying sample events.

That's the sensitive part handled safely. Your browser receives useful event fields while the private feed stays on the server.

Still Seeing Sample Events?

  • Confirm that .env.local sits directly inside the family-dashboard folder.
  • Confirm that the file contains one line beginning with API_SECRET=.
  • Restart the development server after saving the file.

Keep the private address out of your support request. Help me diagnose why my dashboard still shows sample events without asking me to share API_SECRET.

✔️ Awesome, I've got everything!

Great, your local dashboard now reads safe event data from the server-only calendar route.

ⓧ I'd like to double check the full code

The secret file is intentionally excluded from this reference so its private value never appears in the lesson. Compare the two source files below with your project.

import ical from "node-ical";

export const runtime = "nodejs";

const DAY_MS = 24 * 60 * 60 * 1000;

function safeEvent(item, fallbackId) {
  const start = item.start instanceof Date ? item.start : new Date(item.start);
  const rawEnd = item.end ?? item.start;
  const end = rawEnd instanceof Date ? rawEnd : new Date(rawEnd);
  const allDay = Boolean(item.isFullDay || item.start?.dateOnly);

  return {
    id: `${item.uid || fallbackId}-${start.toISOString()}`,
    title: String(item.summary || "Untitled event"),
    start: start.toISOString(),
    end: end.toISOString(),
    allDay,
    dateKey: allDay ? start.toISOString().slice(0, 10) : null
  };
}

export async function GET() {
  const calendarUrl = process.env.API_SECRET;

  if (!calendarUrl) {
    return Response.json({ configured: false, events: [] });
  }

  try {
    const response = await fetch(calendarUrl, {
      next: { revalidate: 300 }
    });

    if (!response.ok) {
      throw new Error("Calendar request failed");
    }

    const calendar = await ical.async.parseICS(await response.text());
    const from = new Date(Date.now() - DAY_MS);
    const to = new Date(Date.now() + 2 * DAY_MS);
    const collected = [];

    for (const [key, item] of Object.entries(calendar)) {
      if (item.type !== "VEVENT" || !item.start) continue;

      if (item.rrule) {
        const instances = ical.expandRecurringEvent(item, { from, to });
        for (const instance of instances) {
          collected.push(
            safeEvent(
              {
                ...instance,
                uid: item.uid,
                summary: instance.summary || item.summary
              },
              key
            )
          );
        }
      } else {
        const start = item.start instanceof Date ? item.start : new Date(item.start);
        const endValue = item.end ?? item.start;
        const end = endValue instanceof Date ? endValue : new Date(endValue);
        if (start <= to && end >= from) {
          collected.push(safeEvent(item, key));
        }
      }
    }

    const unique = Array.from(
      new Map(collected.map((event) => [event.id, event])).values()
    ).sort((a, b) => new Date(a.start) - new Date(b.start));

    return Response.json({ configured: true, events: unique });
  } catch {
    return Response.json(
      { configured: true, events: [], error: "Calendar is temporarily unavailable" },
      { status: 502 }
    );
  }
}
"use client";

import { useEffect, useMemo, useState } from "react";

function dayKey(date) {
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, "0");
  const day = String(date.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}

function sampleEvents() {
  const base = Date.now();
  const make = (id, title, minutesAway, duration) => ({
    id,
    title,
    start: new Date(base + minutesAway * 60 * 1000).toISOString(),
    end: new Date(base + (minutesAway + duration) * 60 * 1000).toISOString(),
    allDay: false,
    dateKey: null
  });

  return [
    make("sample-1", "School drop-off", 15, 30),
    make("sample-2", "Family lunch", 90, 60),
    make("sample-3", "Library visit", 210, 45)
  ];
}

function timeLabel(date) {
  if (!date) return "--:--";
  return new Intl.DateTimeFormat(undefined, {
    hour: "numeric",
    minute: "2-digit"
  }).format(date);
}

function dateLabel(date) {
  if (!date) return "Loading date";
  return new Intl.DateTimeFormat(undefined, {
    weekday: "long",
    month: "long",
    day: "numeric"
  }).format(date);
}

function eventTimeLabel(event) {
  if (event.allDay) return "All day";
  return timeLabel(new Date(event.start));
}

function countdownLabel(event, now) {
  if (!event || !now) return "No more timed events today";
  const difference = Math.max(0, new Date(event.start) - now);
  const totalMinutes = Math.floor(difference / 60000);
  if (totalMinutes < 1) return "Less than 1 minute";
  const hours = Math.floor(totalMinutes / 60);
  const minutes = totalMinutes % 60;
  return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
}

export default function Home() {
  const [now, setNow] = useState(null);
  const [events, setEvents] = useState([]);
  const [calendarStatus, setCalendarStatus] = useState("loading");

  useEffect(() => {
    const updateClock = () => setNow(new Date());
    updateClock();
    const timer = setInterval(updateClock, 1000);
    return () => clearInterval(timer);
  }, []);

  useEffect(() => {
    let ignore = false;

    async function loadCalendar() {
      try {
        const response = await fetch("/api/calendar");
        const data = await response.json();
        if (!response.ok) throw new Error(data.error || "Calendar failed");
        if (ignore) return;

        if (data.configured) {
          setEvents(data.events);
          setCalendarStatus("live");
        } else {
          setEvents(sampleEvents());
          setCalendarStatus("sample");
        }
      } catch {
        if (!ignore) {
          setEvents(sampleEvents());
          setCalendarStatus("error");
        }
      }
    }

    loadCalendar();

    return () => {
      ignore = true;
    };
  }, []);

  const todaysEvents = useMemo(() => {
    if (!now) return [];
    const today = dayKey(now);
    return events
      .filter((event) => {
        if (event.allDay && event.dateKey) return event.dateKey === today;
        return dayKey(new Date(event.start)) === today;
      })
      .sort((a, b) => new Date(a.start) - new Date(b.start));
  }, [events, now]);

  const nextEvent = useMemo(() => {
    if (!now) return null;
    return (
      todaysEvents.find(
        (event) => !event.allDay && new Date(event.start) > now
      ) || null
    );
  }, [now, todaysEvents]);

  const statusText = {
    loading: "Loading calendar",
    live: "Google Calendar live",
    sample: "Sample schedule",
    error: "Calendar unavailable, showing samples"
  }[calendarStatus];

  return (
    <main className="dashboard">
      <header className="hero">
        <div>
          <p className="eyebrow">Family dashboard</p>
          <h1>{timeLabel(now)}</h1>
          <p className="date">{dateLabel(now)}</p>
        </div>
        <span className={`status ${calendarStatus}`}>{statusText}</span>
      </header>

      <section className="grid">
        <article className="card schedule span-2">
          <div className="card-heading">
            <div>
              <p className="eyebrow">Today</p>
              <h2>Family schedule</h2>
            </div>
            <span className="count-pill">{todaysEvents.length} events</span>
          </div>
          {todaysEvents.length ? (
            <ul className="event-list">
              {todaysEvents.map((event) => (
                <li key={event.id}>
                  <time>{eventTimeLabel(event)}</time>
                  <span>{event.title}</span>
                </li>
              ))}
            </ul>
          ) : (
            <p className="empty">No events today</p>
          )}
        </article>

        <article className="card countdown-card">
          <p className="eyebrow">Up next</p>
          <h2>{nextEvent?.title || "Schedule clear"}</h2>
          <p className="countdown">{countdownLabel(nextEvent, now)}</p>
        </article>
      </section>
    </main>
  );
}

The dashboard now knows what your family is doing today. Next, you will add NASA's daily picture plus household controls that stay useful throughout the day.

Add Family Controls and NASA Imagery

Your dashboard now shows real Google Calendar events without exposing the private iCal address. That schedule gives your household a trustworthy view of today.

This step adds tap-friendly household controls. It also brings NASA's daily image onto the dashboard.

In this step, get ready to:
  • Generate the complete dashboard update with Claude Code.
  • Build the updated Next.js app with its calendar route and NASA route.
  • Test the checklists and nap tracker through local browser storage.
Ask Claude Code to finish the dashboard

The NASA request belongs in a server route so the browser receives only the image details it needs. Checklist progress and nap state belong in the display device's browser because they only need to persist on that screen.

  • Return to the terminal where the development server is running.
  • Press Ctrl+C to stop the development server.
  • Switch back to the Claude Code session inside family-dashboard.
  • Ask Claude Code to complete the dashboard by pasting this prompt:
Finish the family dashboard to match the final project specification. Create app/api/apod/route.js and fetch the current NASA APOD WordPress endpoint on the server with a one-hour revalidation window. The current endpoint can return either an array or an object, so handle both. Return only ok, title, image, alt, credit, and link, using hdurl for the display image and permalink for the source link.

Update app/page.js with these cards: large clock and date, today's schedule, countdown to the next timed event, NASA picture with title and credit, three household reminders, separate Kid 1 and Kid 2 checklists, and a baby nap tracker with Start nap and End nap buttons. Store checklist state and the active nap start time in localStorage. Reset checklist state whenever the browser's local calendar day changes. Keep all browser-only APIs inside a Client Component effect or event handler. Preserve the server-only calendar boundary.

Update app/globals.css for a warm, high-contrast, responsive grid with large touch targets. Run npm run build when finished and fix any build errors without changing the pinned versions.

What does this prompt create?

  • The app/api/apod/route.js route requests the daily image on the server. It returns only the fields the dashboard displays.
  • The next: { revalidate: 3600 } setting reuses the fetched NASA data for one hour.
  • The app/page.js update stores checklist progress in the current browser. It also stores the active nap start time there.
  • The app/globals.css update gives every card and control enough space for a spare phone or tablet.

The first production build can take a minute while Next.js compiles every route, so a short pause is normal.

  • Paste the prompt into Claude Code.
  • Review the proposed file changes.
  • Approve the file writes.
  • Approve npm run build when Claude Code requests permission to run it.

Claude Code should finish with a successful build that includes /, /api/calendar, and /api/apod.

Claude Code did not finish the update?

  • Confirm Claude Code is working inside the existing family-dashboard folder.
  • Reject any proposed dependency upgrade. Ask Claude Code to preserve the versions already pinned in package.json.
  • Compare the generated files with the complete references below if a route or control is missing.

Help me diagnose the incomplete Claude Code update.

✔️ Awesome, I've got everything!

Great. Claude Code has created the files needed for the finished local dashboard.

ⓧ I'd like to double check the full code

  • Keep .env.local closed so your private calendar address never appears in the comparison.
  • Compare each project file with the complete references below.
{
  "name": "family-dashboard",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "vercel:signup": "vercel signup",
    "vercel:login": "vercel login",
    "vercel:env": "vercel env add API_SECRET --environment production --sensitive --yes",
    "deploy": "vercel --prod --yes",
    "vercel:projects": "vercel project list",
    "vercel:delete": "vercel project delete"
  },
  "dependencies": {
    "next": "16.4.6",
    "node-ical": "0.27.6",
    "react": "19.3.1",
    "react-dom": "19.3.1"
  },
  "devDependencies": {
    "vercel": "65.15.0"
  }
}
import "./globals.css";

export const metadata = {
  title: "Family Dashboard",
  description: "A glanceable family dashboard for a spare screen"
};

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}
import ical from "node-ical";

export const runtime = "nodejs";

const DAY_MS = 24 * 60 * 60 * 1000;

function safeEvent(item, fallbackId) {
  const start = item.start instanceof Date ? item.start : new Date(item.start);
  const rawEnd = item.end ?? item.start;
  const end = rawEnd instanceof Date ? rawEnd : new Date(rawEnd);
  const allDay = Boolean(item.isFullDay || item.start?.dateOnly);

  return {
    id: `${item.uid || fallbackId}-${start.toISOString()}`,
    title: String(item.summary || "Untitled event"),
    start: start.toISOString(),
    end: end.toISOString(),
    allDay,
    dateKey: allDay ? start.toISOString().slice(0, 10) : null
  };
}

export async function GET() {
  const calendarUrl = process.env.API_SECRET;

  if (!calendarUrl) {
    return Response.json({ configured: false, events: [] });
  }

  try {
    const response = await fetch(calendarUrl, {
      next: { revalidate: 300 }
    });

    if (!response.ok) {
      throw new Error("Calendar request failed");
    }

    const calendar = await ical.async.parseICS(await response.text());
    const from = new Date(Date.now() - DAY_MS);
    const to = new Date(Date.now() + 2 * DAY_MS);
    const collected = [];

    for (const [key, item] of Object.entries(calendar)) {
      if (item.type !== "VEVENT" || !item.start) continue;

      if (item.rrule) {
        const instances = ical.expandRecurringEvent(item, { from, to });
        for (const instance of instances) {
          collected.push(
            safeEvent(
              {
                ...instance,
                uid: item.uid,
                summary: instance.summary || item.summary
              },
              key
            )
          );
        }
      } else {
        const start = item.start instanceof Date ? item.start : new Date(item.start);
        const endValue = item.end ?? item.start;
        const end = endValue instanceof Date ? endValue : new Date(endValue);
        if (start <= to && end >= from) {
          collected.push(safeEvent(item, key));
        }
      }
    }

    const unique = Array.from(
      new Map(collected.map((event) => [event.id, event])).values()
    ).sort((a, b) => new Date(a.start) - new Date(b.start));

    return Response.json({ configured: true, events: unique });
  } catch {
    return Response.json(
      { configured: true, events: [], error: "Calendar is temporarily unavailable" },
      { status: 502 }
    );
  }
}
const APOD_URL =
  "https://science.nasa.gov/wp-json/wp/v2/apod-basic/?api_key=DEMO_KEY";

function plainText(value) {
  return String(value || "")
    .replace(/<[^>]*>/g, "")
    .replace(/\s+/g, " ")
    .trim();
}

export async function GET() {
  try {
    const response = await fetch(APOD_URL, {
      next: { revalidate: 3600 }
    });

    if (!response.ok) {
      throw new Error("NASA request failed");
    }

    const payload = await response.json();
    const item = Array.isArray(payload) ? payload[0] : payload;

    if (!item?.hdurl) {
      throw new Error("NASA image missing");
    }

    return Response.json({
      ok: true,
      title: plainText(item.title),
      image: item.hdurl,
      alt: plainText(item.alt || item.title),
      credit: plainText(item.credit || item.copyright || "NASA"),
      link: item.permalink
    });
  } catch {
    return Response.json(
      { ok: false, error: "NASA picture is temporarily unavailable" },
      { status: 502 }
    );
  }
}
"use client";

import { useEffect, useMemo, useState } from "react";

const CHECKLIST_ITEMS = {
  "Kid 1": ["Get dressed", "Pack school bag", "Brush teeth"],
  "Kid 2": ["Get dressed", "Fill water bottle", "Brush teeth"]
};

const REMINDERS = [
  "Lunchboxes by the door",
  "Check the weather before leaving",
  "Charge the tablet after bedtime"
];

const CHECKS_KEY = "family-dashboard-checks";
const NAP_KEY = "family-dashboard-nap-start";

function emptyChecks() {
  return Object.fromEntries(
    Object.entries(CHECKLIST_ITEMS).map(([child, items]) => [
      child,
      Object.fromEntries(items.map((item) => [item, false]))
    ])
  );
}

function dayKey(date) {
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, "0");
  const day = String(date.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}

function sampleEvents() {
  const base = Date.now();
  const make = (id, title, minutesAway, duration) => ({
    id,
    title,
    start: new Date(base + minutesAway * 60 * 1000).toISOString(),
    end: new Date(base + (minutesAway + duration) * 60 * 1000).toISOString(),
    allDay: false,
    dateKey: null
  });

  return [
    make("sample-1", "School drop-off", 15, 30),
    make("sample-2", "Family lunch", 90, 60),
    make("sample-3", "Library visit", 210, 45)
  ];
}

function timeLabel(date) {
  if (!date) return "--:--";
  return new Intl.DateTimeFormat(undefined, {
    hour: "numeric",
    minute: "2-digit"
  }).format(date);
}

function dateLabel(date) {
  if (!date) return "Loading date";
  return new Intl.DateTimeFormat(undefined, {
    weekday: "long",
    month: "long",
    day: "numeric"
  }).format(date);
}

function eventTimeLabel(event) {
  if (event.allDay) return "All day";
  return timeLabel(new Date(event.start));
}

function countdownLabel(event, now) {
  if (!event || !now) return "No more timed events today";
  const difference = Math.max(0, new Date(event.start) - now);
  const totalMinutes = Math.floor(difference / 60000);
  if (totalMinutes < 1) return "Less than 1 minute";
  const hours = Math.floor(totalMinutes / 60);
  const minutes = totalMinutes % 60;
  return hours > 0 ? `${hours}h ${minutes}m` : `${minutes}m`;
}

export default function Home() {
  const [now, setNow] = useState(null);
  const [events, setEvents] = useState([]);
  const [calendarStatus, setCalendarStatus] = useState("loading");
  const [apod, setApod] = useState(null);
  const [checks, setChecks] = useState(emptyChecks);
  const [storedDay, setStoredDay] = useState("");
  const [storageReady, setStorageReady] = useState(false);
  const [napStart, setNapStart] = useState("");

  useEffect(() => {
    const updateClock = () => setNow(new Date());
    updateClock();
    const timer = setInterval(updateClock, 1000);
    return () => clearInterval(timer);
  }, []);

  useEffect(() => {
    let ignore = false;

    async function loadCalendar() {
      try {
        const response = await fetch("/api/calendar");
        const data = await response.json();
        if (!response.ok) throw new Error(data.error || "Calendar failed");
        if (ignore) return;

        if (data.configured) {
          setEvents(data.events);
          setCalendarStatus("live");
        } else {
          setEvents(sampleEvents());
          setCalendarStatus("sample");
        }
      } catch {
        if (!ignore) {
          setEvents(sampleEvents());
          setCalendarStatus("error");
        }
      }
    }

    async function loadApod() {
      try {
        const response = await fetch("/api/apod");
        const data = await response.json();
        if (!ignore && response.ok && data.ok) setApod(data);
      } catch {
        if (!ignore) setApod(null);
      }
    }

    loadCalendar();
    loadApod();
    const refresh = setInterval(() => {
      loadCalendar();
      loadApod();
    }, 30 * 60 * 1000);

    return () => {
      ignore = true;
      clearInterval(refresh);
    };
  }, []);

  useEffect(() => {
    const today = dayKey(new Date());
    try {
      const saved = JSON.parse(localStorage.getItem(CHECKS_KEY) || "null");
      if (saved?.day === today && saved?.checks) {
        setChecks(saved.checks);
      } else {
        setChecks(emptyChecks());
      }
      setStoredDay(today);
      setNapStart(localStorage.getItem(NAP_KEY) || "");
    } catch {
      setChecks(emptyChecks());
      setStoredDay(today);
    } finally {
      setStorageReady(true);
    }
  }, []);

  const currentDay = now ? dayKey(now) : "";

  useEffect(() => {
    if (!storageReady || !currentDay || currentDay === storedDay) return;
    setChecks(emptyChecks());
    setStoredDay(currentDay);
  }, [currentDay, storageReady, storedDay]);

  useEffect(() => {
    if (!storageReady || !storedDay) return;
    localStorage.setItem(
      CHECKS_KEY,
      JSON.stringify({ day: storedDay, checks })
    );
  }, [checks, storageReady, storedDay]);

  const todaysEvents = useMemo(() => {
    if (!now) return [];
    const today = dayKey(now);
    return events
      .filter((event) => {
        if (event.allDay && event.dateKey) return event.dateKey === today;
        return dayKey(new Date(event.start)) === today;
      })
      .sort((a, b) => new Date(a.start) - new Date(b.start));
  }, [events, now]);

  const nextEvent = useMemo(() => {
    if (!now) return null;
    return (
      todaysEvents.find(
        (event) => !event.allDay && new Date(event.start) > now
      ) || null
    );
  }, [now, todaysEvents]);

  const activeNapMinutes =
    now && napStart
      ? Math.max(0, Math.floor((now - new Date(napStart)) / 60000))
      : 0;

  function toggleCheck(child, item) {
    setChecks((current) => ({
      ...current,
      [child]: {
        ...current[child],
        [item]: !current[child][item]
      }
    }));
  }

  function startNap() {
    const value = new Date().toISOString();
    localStorage.setItem(NAP_KEY, value);
    setNapStart(value);
  }

  function endNap() {
    localStorage.removeItem(NAP_KEY);
    setNapStart("");
  }

  const statusText = {
    loading: "Loading calendar",
    live: "Google Calendar live",
    sample: "Sample schedule",
    error: "Calendar unavailable, showing samples"
  }[calendarStatus];

  return (
    <main className="dashboard">
      <header className="hero">
        <div>
          <p className="eyebrow">Family dashboard</p>
          <h1>{timeLabel(now)}</h1>
          <p className="date">{dateLabel(now)}</p>
        </div>
        <span className={`status ${calendarStatus}`}>{statusText}</span>
      </header>

      <section className="grid">
        <article className="card schedule span-2">
          <div className="card-heading">
            <div>
              <p className="eyebrow">Today</p>
              <h2>Family schedule</h2>
            </div>
            <span className="count-pill">{todaysEvents.length} events</span>
          </div>
          {todaysEvents.length ? (
            <ul className="event-list">
              {todaysEvents.map((event) => (
                <li key={event.id}>
                  <time>{eventTimeLabel(event)}</time>
                  <span>{event.title}</span>
                </li>
              ))}
            </ul>
          ) : (
            <p className="empty">No events today</p>
          )}
        </article>

        <article className="card countdown-card">
          <p className="eyebrow">Up next</p>
          <h2>{nextEvent?.title || "Schedule clear"}</h2>
          <p className="countdown">{countdownLabel(nextEvent, now)}</p>
        </article>

        <article className="card apod-card span-2">
          <div className="card-heading">
            <div>
              <p className="eyebrow">NASA</p>
              <h2>{apod?.title || "Picture of the day"}</h2>
            </div>
          </div>
          {apod ? (
            <>
              <a href={apod.link} target="_blank" rel="noreferrer">
                <img src={apod.image} alt={apod.alt} />
              </a>
              <p className="credit">Credit: {apod.credit}</p>
            </>
          ) : (
            <div className="image-placeholder">Loading today's space image</div>
          )}
        </article>

        <article className="card reminders-card">
          <p className="eyebrow">Remember</p>
          <h2>Household reminders</h2>
          <ul className="reminder-list">
            {REMINDERS.map((reminder) => (
              <li key={reminder}>{reminder}</li>
            ))}
          </ul>
        </article>

        {Object.entries(CHECKLIST_ITEMS).map(([child, items]) => (
          <article className="card checklist-card" key={child}>
            <p className="eyebrow">Daily checklist</p>
            <h2>{child}</h2>
            <div className="checklist">
              {items.map((item) => {
                const done = Boolean(checks[child]?.[item]);
                return (
                  <button
                    type="button"
                    className={done ? "check done" : "check"}
                    key={item}
                    onClick={() => toggleCheck(child, item)}
                    aria-pressed={done}
                  >
                    <span className="check-box">{done ? "✓" : ""}</span>
                    <span>{item}</span>
                  </button>
                );
              })}
            </div>
          </article>
        ))}

        <article className="card nap-card">
          <p className="eyebrow">Baby</p>
          <h2>Nap tracker</h2>
          <p className="nap-time">
            {napStart ? `${activeNapMinutes} minutes` : "No active nap"}
          </p>
          <div className="button-row">
            <button type="button" onClick={startNap} disabled={Boolean(napStart)}>
              Start nap
            </button>
            <button type="button" onClick={endNap} disabled={!napStart}>
              End nap
            </button>
          </div>
        </article>
      </section>
    </main>
  );
}
:root {
  --page-bg: #f5efe5;
  --card-bg: rgba(255, 255, 255, 0.9);
  --ink: #2a2723;
  --muted: #736b61;
  --accent: #c45b3c;
  --accent-soft: #f4d9ca;
  --line: rgba(42, 39, 35, 0.12);
  --shadow: 0 18px 55px rgba(64, 47, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 38%),
    var(--page-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.dashboard {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 44px);
}

.hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(4.5rem, 14vw, 11rem);
  font-weight: 780;
  letter-spacing: -0.075em;
  line-height: 0.84;
}

.date {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.status,
.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  box-shadow: var(--shadow);
}

.status.live {
  color: #21623d;
  background: #e4f3e8;
}

.status.sample,
.status.error {
  color: #8a3e27;
  background: var(--accent-soft);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
}

.card {
  min-width: 0;
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  letter-spacing: -0.035em;
}

.span-2 {
  grid-column: span 2;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.event-list,
.reminder-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-list li {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.event-list time {
  color: var(--accent);
  font-weight: 800;
}

.event-list span {
  font-size: 1.08rem;
  font-weight: 680;
}

.empty,
.credit {
  color: var(--muted);
}

.countdown-card {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  justify-content: space-between;
  background: #2f4a43;
  color: #fffaf2;
}

.countdown-card .eyebrow {
  color: #b8dfcf;
}

.countdown {
  margin: 22px 0 0;
  color: #fffaf2;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.apod-card img {
  display: block;
  width: 100%;
  height: clamp(230px, 38vw, 470px);
  border-radius: 20px;
  object-fit: cover;
}

.apod-card a:focus-visible img {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

.credit {
  margin: 12px 0 0;
  font-size: 0.85rem;
}

.image-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  border-radius: 20px;
  color: var(--muted);
  background: linear-gradient(135deg, #d9e3eb, #efe0cf);
}

.reminder-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.reminder-list li {
  position: relative;
  padding-left: 24px;
  line-height: 1.45;
}

.reminder-list li::before {
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.check.done {
  color: var(--muted);
  background: rgba(47, 74, 67, 0.08);
  text-decoration: line-through;
}

.check-box {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: white;
  background: transparent;
  font-weight: 900;
  text-decoration: none;
}

.check.done .check-box {
  background: var(--accent);
}

.nap-card {
  display: flex;
  flex-direction: column;
}

.nap-time {
  margin: 28px 0;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: auto;
}

.button-row button {
  min-height: 56px;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.button-row button:last-child {
  color: var(--ink);
  background: var(--accent-soft);
}

.button-row button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.check:focus-visible,
.button-row button:focus-visible {
  outline: 4px solid #2f4a43;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .countdown-card {
    grid-column: span 2;
  }
}

@media (max-width: 620px) {
  .dashboard {
    padding: 16px;
  }

  .hero {
    flex-direction: column;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .countdown-card {
    grid-column: span 1;
  }

  .card {
    border-radius: 22px;
  }

  .event-list li {
    grid-template-columns: 78px 1fr;
  }
}
Confirm the production build

A production build checks the boundary between browser code and server routes. It also catches missing imports or syntax problems before deployment.

Before you run the build, which three routes do you expect Next.js to compile? Keep that prediction in mind.

  • Run a fresh production build from the family-dashboard folder with this command:
npm run build

What does this build prove?

  • The / route confirms the Client Component dashboard compiles.
  • The /api/calendar route confirms the protected calendar reader still compiles.
  • The /api/apod route confirms the NASA server reader compiles.

You should see a successful build with /, /api/calendar, and /api/apod in the route list. That confirms both server integrations and the browser interface can ship together.

Build not completing?

  • Check that app/api/apod/route.js matches the complete reference above.
  • Confirm app/page.js begins with "use client";.
  • Ask Claude Code to fix the reported build issue without changing the pinned package versions.

Help me fix the family dashboard build.

Test persistence and NASA imagery

The checklists reset when the browser reaches a new local calendar day. The active nap start time remains stored on this display until you end the nap.

The development server stays active while you test the dashboard. Keep its terminal running until every visible check passes.

  • Start the updated dashboard by running this command:
npm run dev

What does this command do?

The development server loads the completed dashboard and its two API routes. It also updates the browser when the project files change.

You should see a local address for the running app. Keep this process active during the browser checks.

Dashboard not starting?

  • Confirm the production build completed successfully before starting the development server.
  • Check that the command is running from the family-dashboard folder.
  • Stop any older development process before trying again if the local address is already occupied.

Help me start the completed dashboard.

  • Return to http://localhost:3000 in the browser from earlier.
  • Confirm the page still shows Google Calendar live.
  • Confirm the NASA card shows an image.
  • Confirm the NASA card shows its title.
  • Confirm the NASA card shows its credit.
  • Select one checklist item under Kid 1.
  • Select one checklist item under Kid 2.
  • Click Start nap.

Before you refresh, which three pieces of state do you expect this browser to remember? Keep that prediction in mind.

  • Refresh the browser once.

You should see both checklist items still selected. You should also see the active nap continuing to count.

  • Click End nap to clear the active nap.
  • Select the NASA image to open its NASA article in a new browser tab.

That is the dashboard becoming useful between appointments. Your family controls now survive a refresh on this display.

Controls not surviving the refresh?

  • Confirm you refreshed the same browser tab where you selected the checklist items.
  • Check that the browser allows local site data for http://localhost:3000.
  • Compare the storage effects and event handlers in app/page.js with the complete reference above.

Help me debug the browser-local controls.

Your local dashboard now combines a live schedule with daily imagery and household controls. Next, you will deploy it while keeping the private calendar address on the server.

Deploy the Dashboard Securely

Your local dashboard now passes its production build. Its server routes securely provide Google Calendar events plus the NASA Astronomy Picture of the Day.

A local dashboard cannot stay on the kitchen counter when your laptop is closed. This step publishes it at a production URL that your spare device can load at any time.

Vercel Hobby hosts the personal dashboard for $0 per month within its included limits. The Vercel CLI handles deployment without a Git repository. A protected production environment variable keeps the private calendar address on the server.

In this step, get ready to:
  • Authenticate the Vercel CLI with a personal Hobby account.
  • Deploy the dashboard with its calendar address stored as a Production Secret.
  • Save the production dashboard to the spare device's Home Screen.
Create the Vercel project

The first deployment links your existing family-dashboard folder to a new Vercel project. It also proves that the production service can build the same source that passed locally.

Creating an account can feel like the start of a billing commitment. Vercel Hobby costs $0 per month for personal non-commercial use within its included limits.

  • Switch back to the terminal inside your family-dashboard folder.

Choose the account path that matches your situation.

Create a Vercel account

  • Start the personal Vercel account flow by running this command:
npm run vercel:signup

What does this command do?

  • The vercel:signup script starts the Vercel account flow through the CLI.
  • Your browser collects the account details while the terminal waits for authentication.
  • Complete the browser signup flow with your personal account.
  • Return to the terminal after the browser confirms authentication.

You should see confirmation that the CLI is authenticated.

Did the signup flow stop?

  • Check whether the signup page opened behind another browser window.
  • Finish any incomplete account prompts in the browser.
  • Return to the terminal after the browser confirms authentication.

Help me finish the Vercel CLI signup flow.

Use an existing Vercel account

  • Start the login flow for your existing Vercel account by running this command:
npm run vercel:login

What does this command do?

  • The vercel:login script authenticates the CLI with an existing account.
  • Your browser completes the identity check while the terminal waits for confirmation.
  • Complete the browser login flow with your personal account.
  • Return to the terminal after the browser confirms authentication.

You should see confirmation that the CLI is authenticated.

Did the login flow stop?

  • Check whether the login page opened behind another browser window.
  • Finish any incomplete authentication prompts in the browser.
  • Return to the terminal after the browser confirms authentication.

Help me finish the Vercel CLI login flow.

The private calendar address currently exists only in your local .env.local file. Before you deploy, do you think the production server can read a value stored only on your computer?

  • Publish the first production version by running this command:
npm run deploy

What does this deployment do?

  • The deploy script links your local folder to a Vercel project.
  • Vercel builds the current source as a production deployment.
  • The terminal prints the production URL when the deployment finishes.
  • Record the printed production URL here: your production Vercel URL.
  • Enter your production Vercel URL in your laptop browser.

You should see the ticking clock plus the NASA card at the production URL. The calendar status should show Sample schedule because production does not have the private calendar address yet.

Why is the sample schedule back?

Your local .env.local file was not uploaded with the deployment. This separation prevents its private value from becoming deployment source.

The sample schedule confirms that the secure fallback still works. Production needs its own protected copy of API_SECRET before the calendar route can load real events.

Did the first deployment fail?

  • Confirm that the browser authentication flow completed successfully.
  • Check that the terminal is still inside the family-dashboard folder.
  • Review the deployment output for the first route or file that failed to build.

Help me troubleshoot the first Vercel deployment.

Store the Production Secret

Production needs its own copy of the private iCal address. Vercel stores it as a write-only sensitive Production Secret named API_SECRET.

This action handles a live credential. Keep the value inside your local text editor plus the Vercel CLI prompt so it never enters Claude Code or browser source.

  • Open .env.local inside the family-dashboard folder with a local text editor.
  • Copy only the private iCal address after API_SECRET=.
  • Start the protected Production variable prompt by running this command:
npm run vercel:env

How is the secret stored?

  • The vercel:env script creates API_SECRET in the Production environment.
  • The script marks the value as sensitive so Vercel treats it as a write-only Secret.
  • The server route reads the stored value through process.env.API_SECRET.
  • Paste the private iCal address into the waiting Vercel CLI value prompt.
  • Press Enter to store the Production Secret.

You should see confirmation that the environment variable was added. Vercel does not reveal the saved Secret again.

Was the Production Secret rejected?

  • Confirm that you copied only the address after API_SECRET=.
  • Check that the address remains on one line in .env.local.
  • Keep the address out of Claude Code while you diagnose the prompt.

Help me add the Production Secret safely.

Before you redeploy, which calendar status do you expect once the production server can read API_SECRET?

  • Create a new production deployment with the Secret by running this command:
npm run deploy

Why redeploy now?

  • The new deployment starts with the Production environment variable available to server code.
  • The browser receives only the safe calendar fields returned by /api/calendar.
  • The private iCal address remains outside the browser bundle.
  • Refresh your production Vercel URL in the browser.

You should see Google Calendar live beside the ticking clock. The schedule should show today's calendar titles or No events today without sample events.

The NASA image plus its title and credit should also load. Production now has every data flow from your local dashboard.

Still seeing the sample schedule?

  • Confirm that the Secret was added to the Production environment.
  • Confirm that its identifier is exactly API_SECRET.
  • Confirm that you redeployed after adding the Secret.

Help me diagnose the production calendar fallback.

Protect what the public page reveals

The iCal address remains server-only. The Vercel Hobby production URL is public, so anyone with the URL can see the event titles returned by the dashboard.

  • Keep sensitive details out of calendar event titles displayed on this dashboard.
  • Use a separate authentication project if the production page must be access-controlled.
Add the dashboard to the spare screen

A Home Screen shortcut turns the production URL into a tap-friendly display. Checklist state plus nap state remain in that device's browser through localStorage.

Choose the device instructions that match your spare screen.

Android

  • Open Google Chrome on the spare Android device.
  • Enter your production Vercel URL in the address bar.

You should see the production dashboard fill the screen. Confirm that the calendar status reads Google Calendar live.

  • Tap More in Chrome.
  • Choose Install and create shortcut.
  • Choose Create shortcut.
  • Tap Add.

You should see a new shortcut for the family dashboard on the Android Home Screen.

iPhone or iPad

  • Open Safari on the spare iPhone or iPad.
  • Enter your production Vercel URL in the address bar.

You should see the production dashboard fill the screen. Confirm that the calendar status reads Google Calendar live.

  • Tap Share in Safari.
  • Choose Add to Home Screen.
  • Turn on Open as Web App.
  • Tap Add.

You should see a new shortcut for the family dashboard on the iPhone or iPad Home Screen.

  • Launch the new Home Screen shortcut.

You should see today's calendar plus the NASA picture. The household reminders, both kid checklists, nap tracker, and ticking clock should also be visible.

  • Tick one checklist item on the spare device.
  • Tap Start nap.

The checklist item should show its completed state. The nap tracker should begin counting on this device.

Before you refresh, which two changes do you expect the spare device to remember?

  • Refresh the dashboard on the spare device.

The checklist item should remain checked. The active nap should continue from its stored start time.

  • Tap End nap to finish the test nap.
  • Place the spare device in its intended household location.
  • Take a photo showing the live dashboard on the spare screen.

That is the deployment complete. Your spare screen now runs the full family dashboard while the private calendar address stays behind its server route.

Secret mission

Add a Quiet Evening Mode

A bright dashboard can feel uncomfortable after dinner. Add a client-only evening mode that automatically switches the display to a calmer palette after 6:00 PM without changing its data flows.

Clean Up Your Resources

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely. Your dashboard can remain on Vercel Hobby at $0 per month for personal, non-commercial use within its included limits.

Cost warning

Keeping the Vercel deployment online stays within the $0 Hobby plan when you use it for this personal project within the included limits.

Your Claude Pro subscription remains separate. It costs $20 per month in the US, while regional pricing and taxes vary.

Resources you used:

  • A linked personal Vercel Hobby project containing the final evening-mode production deployment.
  • A write-only production Secret named API_SECRET in the Vercel project.
  • A local family-dashboard folder containing the source code and the private .env.local file.
  • A private read-only Google Calendar Secret address in iCal format.
  • A Home Screen shortcut opening the production dashboard on the spare device.
  • Checklist and nap-tracker data stored in that device browser through localStorage.

Keep everything running

No action needed. Choose this if the dashboard is staying on your spare screen or you want to keep improving it.

  • Leave the Vercel project deployed for continued access through the production URL.
  • Keep the production API_SECRET attached to the Vercel project.
  • Keep the local family-dashboard folder for future edits.
  • Leave the Google Calendar Secret address active for the server-only calendar route.
  • Keep the Home Screen shortcut on the spare device.
  • Keep the browser site data so the current checklist and nap state remain available on that device.

The Production Page Stays Public

The iCal address stays behind the server route. Anyone who obtains the production URL can still see the event titles rendered on the dashboard.

Pause - I'll come back to this later

Stop using the spare display while keeping the deployment and project files ready for later. Vercel continues serving the production page during this pause.

  • Close the dashboard on the spare device.
  • Keep the Home Screen shortcut for your return.
  • Leave the Vercel project deployed at its existing production URL.
  • Keep the family-dashboard folder on your computer.
  • Leave the Google Calendar Secret address active.
  • Keep the browser site data so the checklist and nap state remain on that device.

Pausing Does Not Restrict Access

Turning off or repurposing the display does not make the production URL private. Anyone with that URL can continue viewing the event titles returned by the page.

Delete - I don't want to use this again

Deletion is permanent. Each action below targets a resource created during this project.

  • Switch back to the terminal you used to deploy family-dashboard.
  • List your linked Vercel projects by running this command:
npm run vercel:projects

What does this command do?

The script runs vercel project list through the project dependency. The output gives you the exact project name needed for deletion.

  • Record the project linked to this dashboard as your Vercel project name.

Check the Project Name

The delete command asks for confirmation. Approve the deletion only when it names your Vercel project name.

  • Delete the linked Vercel project by replacing <project-name> with your Vercel project name before you run this command:
npm run vercel:delete -- <project-name>

What Does This Remove?

This script runs the Vercel project deletion command against the name you provide. Removing the project also removes its production deployment and its attached API_SECRET.

The terminal confirms when the Vercel project has been deleted.

Project Not Found?

Run the project-list script again from the linked family-dashboard folder. Copy the matching project name exactly as it appears in the output.

Help me delete the correct Vercel project from this folder.

  • Locate the family-dashboard folder with your computer's file manager.
  • Move the family-dashboard folder to your computer's deleted-items location.
  • Empty that location to remove .env.local with the source files.

The private local copy of the iCal address is removed with .env.local.

  • Open Google Calendar on a computer.
  • Open Settings.
  • Select the calendar under Settings for my calendars.
  • Choose Integrate calendar.
  • Use Reset for the Secret address in iCal format.

Google invalidates the address used by this project. The previous iCal link can no longer read the calendar.

  • Remove the dashboard shortcut with the spare device's Home Screen controls.
  • Clear the site data for the production dashboard URL in the device browser.
  • Confirm the dashboard shortcut no longer appears on the Home Screen.

The checklist and nap-tracker values are removed from that browser. Your project resources are now cleaned up.

Nice Work!

Nice Work!

You did it! Your spare screen now runs a deployed family dashboard for your household. The display stays useful from the morning schedule through its calmer evening palette.

What you learned:

  • Directed Claude Code with precise prompts to build a responsive family dashboard. The finished screen shows a live clock. It displays today's schedule. Its countdown tracks the next timed event.
  • Built a server-only Google Calendar reader with Next.js. Used node-ical to expand recurring events into safe browser data. Protected the private iCal address as the write-only API_SECRET production Secret in Vercel.
  • Added the NASA Astronomy Picture of the Day to the dashboard. Created daily-reset checklists backed by localStorage. Made the nap tracker survive browser refreshes. Put the production dashboard on the spare device through a Home Screen shortcut.
  • Secret Mission: Built a quiet evening mode that activates automatically after 6:00 PM. It updates CSS variables through isolated client-side files. The existing calendar requests remain untouched. The local browser storage behavior remains intact.

Ready to quiz yourself?