Business KPI Dashboard Site
A team web dashboard for daily KPIs: leaders see trends, ops sees anomalies, and data stops reposting screenshots.
The problem to solve
Daily report screenshots are rebuilt every day. Metric definitions change and require repeated explanations. Teammates dig through chat to find the latest numbers.
Solution
Build a web dashboard: upload daily CSV and automatically refresh KPIs, trends, anomaly alerts, and downloads.
Expected outcome
- Top KPI cards for GMV, orders, conversion rate, AOV.
- 14-day trend charts and day-over-day changes.
- Anomaly section for metrics beyond thresholds.
- CSV upload refreshes the dashboard; daily image can be downloaded.
Example input fields
Before copying, rename your Excel / CSV headers to match these fields — or just paste your real headers into Codex along with the prompt.
Copy-ready prompt
You are a senior web app engineer and a thoughtful product manager. Build a runnable, buildable, deployable web app directly. Use business language in the UI and choose sensible implementation defaults.
[Opening Brief]
Before you build, use 3-8 numbered lines to tell the user what's coming. If 3 lines do it, use 3 — one short sentence per line.
Picture, feel, result — not implementation. Plain words. Speak to "you".
Don't promise a timeline ("ready in X minutes") — you can't know. Don't wait for a reply. Follow the [Quick Start Protocol] below immediately.
[Goal]
Build a team-accessible KPI dashboard web app that updates KPIs, trends, and anomaly alerts after daily CSV upload.
[Platform & Stack]
- Web app using Next.js + React + TypeScript
- Use App Router
- Seed data in src/data/seed.ts
- Browser local storage keeps 30 days of uploads
- npm run build / npm run start must pass
[Core Features]
1. KPI cards: GMV, orders, conversion rate, AOV with current value, delta, status color.
2. Upload area: drag CSV with date, GMV, orders, UV, conversion, AOV, channel.
3. Trend area: 14-day line chart with metric switcher.
4. Anomaly alerts: when delta exceeds threshold, show candidate reasons and suggested action.
5. Channel table: GMV, orders, conversion by channel; sortable.
6. Downloads: daily PNG or CSV summary.
[Visual Style]
Dashboard web app: dense but calm, restrained cards, clear tables, first screen shows key metrics.
[Robustness]
Header mismatch offers mapping suggestions; empty data never blanks the page; keep previous data before new upload.
[Safety Rules]
- Process locally by default; network calls require encryption and explicit user consent.
- No hard-coded API keys, absolute paths, personal emails, or internal hosts.
- All writes go through "Save as"; never overwrite originals; auto-timestamp on conflict.
- Do not invent npm packages; verify with npm view first.
- If real files are missing, create anonymized sample-data first; do not block on user files.
[Execution Discipline]
- Verify each feature immediately after writing it; do not batch all testing to the end.
[Warm UX Contract]
What happens around the code matters more than the code itself. The finish should feel like a gift.
- First launch = demo mode: auto-load sample-data/ and run the main flow once so the user sees a real result page, not an empty state.
- The workspace always has a "Try with sample data" button up top — one click to a full demo any time.
- Buttons, hints, and errors in business language. Example: "Can't find the Order ID column", not "Column 'order_id' not found".
- Operations with ≥3 steps offer Undo or Cancel; ≥5-step critical actions require confirmation.
- Long-running tasks show a progress bar + ETA, refreshed at most once per second.
- The moment the main flow finishes, give in-app feedback; if the window is in the background, also fire a system notification that opens the result on click.
- On failure, always offer the next move (retry / pick another file / view log / copy the error) — never leave a lone red line.
[Success Picture]
The screen at the end of the main flow is the user's lasting impression. Make it feel like a gift.
- Big-number outcome + a ≤30-word business-language summary. Example: "Reconciled 482 orders, 5 mismatches. Saved to Desktop/diff-2026-05.xlsx".
- Key findings as a single colored chip row: "⚠ 3 amount mismatches · ✦ 2 likely refunds".
- Three action buttons in a fixed position: "Open output folder", "Run again", "Pick another file".
- Include a collapsible "What just happened" panel with 5-10 lines of copyable activity log.
- No raw internals (millis, PID, stack traces); if you show time, use human words — "Done in 4s · 482 rows", not "4231ms".
[Project Structure]
├── app/ # Website pages, layouts, routes
├── components/ # Reusable UI components
├── lib/ # Business logic, validation, data transforms (testable)
├── src/data/ # Sample / seed data
├── public/ # Static assets
├── docs/ # User guide + deployment notes + known limits
└── package.json # dev / build / start scripts
[Error Recovery]
When hitting issues, follow these strategies instead of retrying the same approach:
- Dependency install fails → check spelling, try one major version down, or use --legacy-peer-deps
- Website routing error → check app/ directory placement, page file names, and import paths
- Hydration error → move browser-only logic into useEffect or a client component
- npm run build fails → read the full error, fix types/routes/static asset paths, then rerun build
- Deploy fails → confirm local npm run build and npm run start pass before reading platform logs
- Styles broken → check CSS load order and selector specificity
- Same error 3 times → switch approach or downgrade that feature, do not keep retrying
[Delivery]
1. Build seed data and KPI home first.
2. Implement upload, trends, anomaly alerts, and channel table.
3. Add downloads, README, deployment notes, and verify build/start.
Acceptance checklist (all must pass):
☐ First screen shows four KPI cards and trend entry
☐ CSV upload refreshes metrics
☐ Bad headers show mapping suggestions
☐ Threshold breach creates an alert
☐ Daily PNG / CSV downloads work
☐ npm run build and npm run start pass
[High-Quality Delivery Addendum]
If the prompt says to wait for confirmation, summarize in ≤8 lines, then implement/run/fix/verify; stop only for real files, accounts, certificates, or irreversible actions.
[Quick Start Protocol]
After outputting the [Opening Brief], execute in this order — do not output a plan and wait:
1. Initialize the website app project with TypeScript and App Router
2. Install core deps: next, react, react-dom, typescript, @types/react
3. Write a minimal app/page.tsx; confirm npm run dev opens the home page
4. Create sample-data/ or src/data/seed.ts with realistic anonymized business data
5. Implement features one by one; verify each immediately after writing
6. Finish with README, deployment notes, and npm run build / start verification
[Anti-Patterns — Never Do These]
- Empty function bodies or TODO comments as "done"
- Rendering UI with fake data without wiring real logic
- Writing imports before installing dependencies
- Writing all code at once then running (verify per feature instead)
- Retrying the same failing approach more than 3 times
- Using console.log instead of real error-handling UI
- Ignoring empty states and loading states
- First screen on launch is blank / welcome / settings (should be workspace + demo data)
- Error messages leaking jargon ("Cannot read property", "Column not found")
- Bulk operations with no progress bar / ETA
- Overwriting original files on write (always Save as; timestamp conflicts)
- Finishing with zero feedback (no summary, no buttons, no system notification)
[DoD / Stop-Vibe-Coding]
Done criteria (check each — all must pass before reporting):
☐ Launches; sample data creates the artifact
☐ Edge cases are friendly (empty data, bad format, cancel, name conflict → no crash)
☐ UI meets minimum standards (clear type hierarchy, comfortable spacing, empty states have guidance)
☐ lint/typecheck/test/build pass
☐ Smoke test: launch → main flow → export/save with sample-data; note result
☐ setup/dev/package scripts, README, guide, limits, and samples exist
Stop; new ideas go to v2.
[Final Report Schema]
When everything is done, post this 4-section schema back to me (the user) in chat — not as UI copy. Each section opens with an emoji; body in business language.
✅ Delivered: ≤5 core capabilities, business framing, no jargon.
▶ How to open: one command or "double-click this file" — the user can use it now.
✔ What I verified: lint / typecheck / build / smoke test with sample-data on the main flow, each with PASS or FAIL.
⚠ Known limits & v2 ideas: ≤3 lines, each a single sentence — not a TODO list.After you copy
Open Codex Desktop and start a new task
Paste the whole prompt into the chat and send
Let Codex build and verify, then tweak names, fields, and buttons as you like
More from this department
Daily Data Report Builder
Drop in today's Excel files (GMV, orders, traffic). Merge with saved mappings. Generate a "today at a glance" image or PDF in minutes.
Weekly Trend Snapshot
Import a weekly KPI Excel; auto-compute WoW change, render sparklines, and draft a one-paragraph commentary.
Personal KPI Dashboard
Pin the handful of numbers you care about (GMV, UV, conversion…) on a tiny desktop dashboard.
SKU Profit Radar
Combine sales, margin, ads, refunds, and inventory turnover to find truly profitable SKUs versus vanity volume.