Rate My Puddle

Puddle

Puddle is a playful web app for uploading puddle photos and receiving an AI-generated quality rating. It is also a community gallery: authenticated users can contribute puddles, and visitors can browse the latest submissions and filter them by rating.

The live project is available at ratemypuddle.app.

How it works

  1. A user signs in with Google.
  2. They submit a puddle image through the upload form.
  3. The SvelteKit API validates the submitted image and sends it to Google's Gemini model as part of a constrained prompt.
  4. Gemini acts as a humorous "puddle connoisseur," choosing from the project's predefined ratings or identifying that the image is not a puddle.
  5. Valid images are uploaded to Firebase Storage and their image URL, uploader, timestamp, and rating are stored in Firestore.
  6. The latest puddle is displayed on the home page, while the browse page shows recent submissions and supports filtering by AI-assigned rating.

Technologies

  • Svelte 5 — reactive UI components
  • SvelteKit 2 — routing, server-side page loading, and API endpoints
  • TypeScript — application and API types
  • Vite — development server and production builds
  • Google Gemini — multimodal image analysis and AI-generated puddle ratings through @google/generative-ai
  • Firebase Authentication — Google sign-in and user identity
  • Firebase Storage — uploaded puddle image hosting
  • Cloud Firestore — user submissions and rating metadata
  • W3.CSS — interface layout and styling
  • Google App Engine — deployment target via the App Engine adapter

Local development

Prerequisites

  • Node.js 24 or later
  • A Firebase project
  • A Google Gemini API key

Install

npm install

Environment variables

Create a .env file in the project root. The app requires the following Firebase public configuration values:

PUBLIC_APIKEY=your_firebase_api_key
PUBLIC_AUTHDOMAIN=your_project.firebaseapp.com
PUBLIC_PROJECTID=your_firebase_project_id
PUBLIC_STORAGEBUCKET=your_project.firebasestorage.app
PUBLIC_MESSAGINGSENDERID=your_messaging_sender_id
PUBLIC_APPID=your_firebase_app_id
GEMINI_API_KEY=your_gemini_api_key

Configure Firebase Authentication with Google sign-in enabled. Enable Cloud Firestore and Firebase Storage, and ensure your Firebase project rules permit authenticated uploads and the reads used by the application.

Run the app

npm run dev

Open the local URL printed by Vite. Add -- --open to open a browser automatically:

npm run dev -- --open

Checks and production build

npm run check
npm run build
npm run preview

Project structure

src/routes/
├── +page.svelte                 # Home page and latest puddle
├── browse/                      # Gallery and rating filters
└── api/analyze-puddle/          # Gemini image analysis endpoint

src/lib/components/
├── UploadForm.svelte            # Image submission workflow
├── Login.svelte                 # Google authentication
└── RecentPuddle.svelte          # Latest-puddle display

src/lib/firebase.ts              # Firebase initialization
src/lib/store.ts                 # Current authenticated user state

Deployment

The repository includes app.yaml for Google App Engine:

runtime: nodejs24

Use the SvelteKit App Engine adapter configuration already included in svelte.config.js, provide the required environment variables in your deployment environment, and deploy with your normal Google Cloud/App Engine process.