Generate hilariously overcomplicated coffee instructions in airplane safety card style using AI.
Example of "Chaos" style safety card - because coffee preparation should be as dramatic as possible.
- 1-9 Step Coffee Instructions: Choose how many critical steps your coffee emergency requires
- AI-Powered Image Generation: Uses Hugging Face FLUX.1-schnell model to create safety-card style illustrations
- Three Illustration Styles:
- 🎯 Simple: Clean stick figures, minimal safety card style
- 🎨 Fun: Happy dangerous predators (sharks, bears, tigers!) making coffee
- 🎲 Chaos: Wild experimental art, expect anything!
- PB&J Exercise Integration: Guided prompts emphasizing programming-level precision for better results
- Revise Instructions: Edit and regenerate individual steps without starting over
- Interactive Slideshow: Click through your generated steps one by one
- Airplane Safety Card View: See all steps in a classic emergency card grid layout
- Image Export: Download your coffee safety instructions as a high-quality PNG
- Light/Medium/Dark Roast Themes: Because even your UI should match your coffee preference
- Dev Mode: Debug view showing full AI prompts and configuration
- Node.js (v18 or higher)
- A Hugging Face API key (get one at Hugging Face Settings)
- Free tier available with generous rate limits
- Uses FLUX.1-schnell model for fast, high-quality image generation
- Clone the repository:
git clone git@github.com:emckenna/make-a-coffee.git
cd make-a-coffee- Install dependencies:
npm install- Create a
.env.localfile:
cp .env.example .env.local- Add your Hugging Face API key to
.env.local:
HUGGINGFACE_API_KEY=your_api_key_here
- Start both the frontend and API servers (in separate terminals):
# Terminal 1: Start the API server
npm run dev:api
# Terminal 2: Start the frontend
npm run devAPI Server Management:
npm run dev:api # Start API server
npm run dev:api:restart # Restart API server (picks up code changes)
npm run dev:api:stop # Stop API server- Open http://localhost:5173 in your browser
npm run buildQuick Deploy:
vercelThen add your HUGGINGFACE_API_KEY as an environment variable in your Vercel project settings.
For detailed deployment instructions, including API key setup, troubleshooting, and production configuration, see DEPLOYMENT.md.
- Frontend: React + Vite
- Styling: Tailwind CSS
- AI: Hugging Face FLUX.1-schnell (with optional Gemini/DeepAI support)
- Image Export: html2canvas
- Deployment: Vercel
- Choose the number of steps (1-9) for your coffee instructions
- Enter a description for each step (with PB&J-style precision guidance!)
- Select your illustration style:
- 🎯 Simple: Clean stick figures, minimal style
- 🎨 Fun: Happy dangerous predators making coffee
- 🎲 Chaos: Wild AI creativity, expect anything!
- Click "Generate Emergency Coffee Instructions"
- View your generated images in a slideshow
- Want to tweak a step? Click "✏️ Revise" to edit and regenerate
- Export as an airplane safety card grid
- Download as a high-quality PNG image
The default provider is Hugging Face (free tier available). You can configure additional providers in src/config.js:
- Hugging Face (enabled): FLUX.1-schnell model - fast and reliable
- Gemini (disabled): Requires paid Google Cloud billing
- DeepAI (disabled): Requires paid Pro account
See .env.example for all available API key configurations.
If you encounter FUNCTION_INVOCATION_FAILED errors on Vercel:
The project uses a dual module system:
- Frontend (React/Vite): ES modules (
"type": "module"in rootpackage.json) - API (Serverless Functions): CommonJS (
"type": "commonjs"inapi/package.json)
This setup is necessary because:
- Vite requires ES modules for the frontend build
- The serverless functions use CommonJS for better compatibility with Node.js packages
The api/package.json file overrides the root module type for the API directory only.
To test the API locally:
npm run dev:apiThis starts an Express server on port 3001 that mimics Vercel's serverless function environment.
Visit /api/health on your deployed app to check:
- Environment variables are set correctly
- Provider modules are loading
- Node.js environment info
Following these instructions may result in actual coffee. Side effects include: caffeine jitters, increased productivity, and uncontrollable laughter.
MIT
This is a fun side project, but PRs are welcome! Especially if they make it funnier.
Made with love (and excessive amounts of coffee) using Claude Code.
