Vitality for Earth Day
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
localStorageand local date keys; past days are read‑only. - Assets:
next/image+ assets underpublic/vitality/. - Gemini Integration: Only in
POST /api/gemini-coachwith@google/generative-ai;GEMINI_API_KEYlives in.env.local/ Vercel—neverNEXT_PUBLIC_. - Deployment: Deployed on Vercel from GitHub.