Vitality for Earth Day

Published: (April 19, 2026 at 10:55 PM EDT)
1 min read
Source: Dev.to

Source: Dev.to

What I Built

History saves per calendar day in the browser; photos beside each section are real bundled images. An optional Gemini API route can add warm coaching text from a short summary you send—all numbers stay authoritative from the app, not the model.

Demo

vitality-delta-five.vercel.app

Code

/
Vitality

How I Built This

  • Framework: Next.js 14 (App Router) + TypeScript for routing, layouts, and API routes.
  • Styling & Animation: Tailwind CSS + Framer Motion for the “eco‑app” UI and motion.
  • Charts: Recharts for stacked impact visuals; Lexend via next/font.
  • Core Logic: Pure functions (vitalityMath, ledger) so scores and grams are repeatable and auditable.
  • Persistence: History with localStorage and local date keys; past days are read‑only.
  • Assets: next/image + assets under public/vitality/.
  • Gemini Integration: Only in POST /api/gemini-coach with @google/generative-ai; GEMINI_API_KEY lives in .env.local / Vercel—never NEXT_PUBLIC_.
  • Deployment: Deployed on Vercel from GitHub.

View on GitHub

0 views
Back to Blog

Related posts

Read more »