FivePM - Project Story

Inspiration

The inspiration for FivePM came from two universal problems we all face:

1. Indecision in the Kitchen

We've all stood in front of an open refrigerator, staring at ingredients, wondering "what can I cook?" Food goes to waste not because we don't have ingredients, but because we lack inspiration and direction.

2. The 5 PM Dilemma (Hence the name!)

Picture this: You're working 9 to 5, exhausted from a long day, and you get home at 5 PM. You want to cook something homemade instead of ordering takeout, but you have no idea what to make. You don't have the mental energy to search through recipe websites, plan meals, or figure out if you have the right ingredients.

This is the exact moment FivePM was designed for.

We asked ourselves: "What if AI could see what you see and instantly tell you what to cook?"

What if, at 5 PM, you could simply:

  • Take a photo of your pantry or fridge
  • Upload that cooking video you saved from Instagram
  • Scan that handwritten recipe from your grandmother

And immediately get a personalized, step-by-step recipe that matches what you have and what you want to cook?

This vision led us to build FivePM - a platform that eliminates the friction between "I want to cook" and "I know what to cook," making home cooking accessible even when you're tired, busy, and uninspired.


What it does

FivePM is an intelligent recipe generation platform that transforms everyday cooking challenges into culinary opportunities. Using advanced AI vision technology powered by Google Gemini, our application analyzes images, videos, PDFs, and even your pantry contents to generate personalized, step-by-step recipes.

The platform seamlessly combines computer vision, natural language processing, and cloud infrastructure to deliver an intuitive cooking assistant that fits in your pocket. Whether you're staring at leftover ingredients wondering what to make, watching a cooking video you'd like to replicate, or have a handwritten recipe card you want to digitize, FivePM makes cooking accessible and inspiring.

Key Features:

  • Pantry Scanner: Take a photo of your fridge/pantry and get recipe suggestions
  • Video Analysis: Upload cooking videos and get structured recipe instructions
  • PDF Parser: Digitize handwritten or printed recipes from images/PDFs
  • Smart Notifications: Get notified when your recipes are ready via push notifications
  • Flexible Subscriptions: Choose from FREE, PRO, or CHEF tiers based on your needs

How we built it

Tech Stack

Frontend: Mobile application (Firebase Auth)
Backend: Node.js + Express.js
Database: PostgreSQL + Prisma ORM
AI Engine: Google Gemini Vision API
Cloud Platform: Google Cloud Platform (GCP)
Infrastructure: Pulumi (Infrastructure as Code)
Notifications: Firebase Cloud Messaging (FCM)
File Processing: Multer (memory storage)

Architecture Overview

Our application follows a layered architecture pattern:

\[ \text{Routes} \rightarrow \text{Services} \rightarrow \text{Repositories} \rightarrow \text{Prisma Client} \]

This separation of concerns allows us to:

  • Keep business logic separate from HTTP concerns
  • Write testable, modular code
  • Easily swap implementations (e.g., different AI providers)

Key GCP Services:

  • Cloud Run: Serverless container deployment for our Node.js backend
  • Cloud SQL (PostgreSQL): Managed database with automatic backups and high availability
  • Cloud Storage: Scalable storage for uploaded media files
  • Secret Manager: Secure storage for API keys and credentials
  • Cloud Build: CI/CD pipeline automation

Infrastructure as Code with Pulumi

We used Pulumi to manage our entire GCP infrastructure declaratively


Challenges we ran into

1. Managing Expensive AI API Calls

Problem: Google Gemini API calls are costly and slow. Users shouldn't wait 10+ seconds for a response.

Solution: We implemented an asynchronous processing pattern:

  • Deduct tokens before making the AI call
  • Return success immediately to the user
  • Process AI request in background
  • Notify user via push notification when ready
  • Refund tokens if processing fails

This required careful thought about error handling and user communication.

2. Preventing Double-Charging for Cached Content

Problem: If a user requests the same video URL twice, should they pay twice?

Solution: Implemented URL-based caching:

  • Check cache before deducting tokens
  • Return cached result synchronously and for free
  • Only charge for net-new processing

3. Linking Ingredients Across Recipes and Pantries

Problem: Managing ingredients across different contexts (user pantries, generated recipes, shopping lists) was challenging. We needed a consistent way to identify and track ingredients whether they came from AI-generated recipes or user-uploaded pantry photos.

Solution: Built a centralized ingredients list with standardized naming:

  • Created a master ingredient database with canonical names
  • AI responses map to standardized ingredient IDs
  • Pantry scanning uses the same ingredient vocabulary
  • Enables easy deduction of used ingredients from pantry inventory
  • Simplifies adding new items and tracking quantities

This centralized approach eliminated duplicate ingredients with different names (e.g., "tomato" vs "tomatoes" vs "cherry tomatoes") and made pantry management seamless.


Accomplishments that we're proud of

Built a Production-Ready AI System: We successfully integrated Google Gemini Vision API to process multiple media types (images, videos, PDFs) with consistent, structured outputs.

Asynchronous Architecture: Designed and implemented a sophisticated async processing pipeline that keeps response times under 500ms while handling expensive AI operations in the background.

Fair Monetization Model: Created a token-based subscription system with three tiers that balances user affordability with operational costs, including automatic refunds on failures.

Enterprise-Grade Security: Implemented Firebase Auth, token validation, and GCP Secret Manager to ensure user data protection and secure API key management.

Infrastructure as Code: Successfully deployed our entire stack to GCP using Pulumi, making our infrastructure reproducible, version-controlled, and easy to maintain.

Seamless User Experience: Combined synchronous responses with asynchronous processing and push notifications to create a smooth, responsive user experience despite backend complexity.

Atomic Transactions: Prevented race conditions and data inconsistencies with Prisma transaction-based token management, ensuring users are never overcharged.

Intelligent Caching: Implemented smart caching that reduces costs and improves performance by serving repeated requests for free.


What we learned

Building FivePM taught us that even as full-time workers with limited time, we were able to deliver a fully functional MVP with AI integration in a remarkably short period. This project proved that with the right tools, clear vision, and focused execution, ambitious ideas can become reality faster than ever before.


What's next for FivePM

Recipe Sharing & Social Features: Enable users to share their generated recipes with friends and the community

Full Zero Waste: Use expiration dates of pantry items to suggest what to cook to eliminate waste.

Dietary Restriction Filters: Add support for vegan, gluten-free, keto, and other dietary preferences in recipe generation

Nutritional Analysis: Integrate nutritional APIs to provide calorie counts, macros, and health information

Voice Assistant Integration: Support for Alexa, Google Assistant, and Siri for hands-free cooking

Multi-Language Support: Expand to support recipe generation in multiple languages

Usage Analytics Dashboard: Provide users with insights into their cooking patterns and most-used ingredients

Third-Party Integrations: Connect with meal planning apps, grocery delivery services, and smart kitchen devices


Conclusion

FivePM represents the intersection of artificial intelligence, practical utility, and user-centered design. We built a system that not only solves real problems but does so in a way that's fast, fair, and delightful to use.

The journey taught us about distributed systems, AI integration, product design, and the importance of handling edge cases gracefully. Most importantly, we learned that great products balance technical sophistication with user simplicity.

We're proud of what we've built and excited about the future of AI-assisted cooking! šŸ³


Built with ā¤ļø using Node.js, Express, Prisma, PostgreSQL, Google Gemini, Firebase, and GCP

Share this project:

Updates