This is a submission for the DEV April Fools Challenge
What I Built
Letโs face it. Developers are a moody bunch. You can wallow in your undefined is not a function errors for only so long before that frown holds you back from providing real shareholder value.
This is why I built Happy Pill, an enterprise-grade wellness solution that ensures your engineering team maintains peak performance.
This April, sadness is a privilege, not a right. KEEP GRINNING.
Demo
It plays exactly one song - Happy by Pharrell Williams. This isn't a bug, seriously. Stop smiling? Your listening privilege is immediately revoked until you smile again. Thatโs your new performance metric. Thereโs a grace period of 5 seconds at the beginning for a smooth onboarding, so donโt worry!
๐๐ผ Live project (fallback no-api-key version with smile simulated through a toggle)
And because misery loves company, your non-compliance for more than 15 seconds will trigger a cup of coffee for you. Of course, to only then be served a 418 Iโm a Teapot error instead. Because even the server is judging you.
Code
Happy Pill
This is a submission for the DEV April Fools Challenge
Getting Started
Prerequisites
- Node.js (v18 or later recommended)
- A modern web browser with webcam support
Installation
-
Clone the repository:
git clone https://github.com/ashmeet-chhabra/happy-pill cd happy-pill -
Install dependencies:
npm install -
Set up a Gemini API key for automatic smile detection:
- Create a
.envfile and add:VITE_GEMINI_API_KEY=your_api_key_here - If you skip this step, the app will automatically enable the manual smile toggle as a fallback, allowing you to control the smile state manually.
- Create a
Running the App
Start the development server:
npm run dev
Open your browser and navigate to the local server address provided in the terminal.
Project Structure
-
src/components/โ UI components (Header, WebcamPreview, StatusPanel, ControlsBar, YouTubePlayerPanel, FrownPopup) -
src/hooks/โ Custom React hooks for camera, smile analysis, and YouTube player logic -
src/services/โ Service modules for camera, Gemini API, and YouTube integration -
src/types/โ TypeScript type definitions -
public/418.htmlโ Customโฆ
How I Built This Utopian Smile Police
The whole system runs on a carefully calibrated feedback loop: camera detects face โ AI analyzes smile โ playback responds instantly โ UI updates to reflect your current compliance status.
React + TypeScript: Because every project deserves type safety, even this one. I ensure the app fails gracefully with proper error messages when it inevitably breaks.
YouTube IFrame API: To help hold you hostage to Pharrell Williams' Happy on loop.
Tailwind CSS: For that sleek, surveillance-state aesthetic uwu
Gemini Integration: More on that in the next section. (face-api.js who ๐๐ผ๐ )
Prize Category
Best Ode to Larry Masinter: duh

Best Google AI Usage: The heart of this innovation! I used Gemini 3.1 Flash-Lite, Google AIโs fastest low-latency high volume model.
Using cutting-edge, state-of-the-art AI to monitor your smile is most agreeably the need of the hour, just as it is to scaffold and overengineer an app for a zero-tolerance risk project like this. For that I turned to Gemini Code Assist which came handy right there in my IDE building this revolution with me.

Top comments (0)