It’s a feeling I know all too well. A calendar notification pops up: “Mom’s Birthday in 2 weeks.” My heart sinks a little. It’s not that I don’t love my mom—it’s that I’m paralyzed by the pressure to find the perfect gift.
My gift-giving history is a trail of well-intentioned but ultimately generic presents: the scented candle, the generic gift card, the "World's Best Dad" mug. I'd spend hours scrolling through online stores, feeling more lost with every click. The gifts I gave never felt like they truly captured the personality of the people I cared about most. They were just… items.
I realized the problem wasn't a lack of love, but a lack of inspiration. I knew my friend loved vintage sci-fi, and my dad was getting into bird-watching, but how do you turn those fragments of personality into a tangible, thoughtful gift?
That question was the seed for GIFTAI. What if I could build a personal gift-giving genius? A tool that could take those scattered details—age, personality, hobbies, an inside joke—and use the creative power of AI to brainstorm unique, personalized, and genuinely thoughtful gift ideas. I wanted to build the app I desperately needed.
🛠️ How I Built It: The Tech Stack
I knew I needed a modern, fast, and scalable stack to bring this to life for the BOLT Hackathon.
Frontend: Next.js with React and TypeScript. This gave me server-side rendering for speed, static site generation, and the safety of a typed language. The UI was crafted with Tailwind CSS for rapid, utility-first styling.
AI Brain: Google's Gemini API. I chose Gemini for its strong natural language and reasoning capabilities. It's excellent at creative tasks and understanding nuanced prompts, which was critical for generating high-quality suggestions.
Backend & Database: Supabase. Supabase was the all-in-one backend that saved me hours.
PostgreSQL Database: To store user searches, gift suggestions, and user favorites.
Authentication: For easy and secure user sign-up and login.
Row Level Security (RLS): To ensure users could only ever see and manage their own data. This was non-negotiable for privacy.
Serverless Functions: While I used Next.js API routes, the potential to expand with Supabase Edge Functions was a huge plus.
The core flow is simple but powerful: A user fills out a form, which is sent to a Next.js API route. This route constructs a detailed prompt for the Gemini API, receives the AI-generated suggestions, parses them, and saves them to the Supabase database before sending them back to the user to display.
🧗♂️ The Challenges I Faced
Every project has its hurdles, and GIFTAI was no exception.
Prompt Engineering is an Art: My first prompts to the AI were too simple. "Give me a gift for a 30-year-old who likes hiking." The results were boring: "hiking boots," "a water bottle." I had to learn to "talk" to the AI. I iterated endlessly, adding context, asking for why a gift is good, requesting a variety of price points, and even instructing it to include potential shopping links. The quality of the output is directly proportional to the quality of the prompt.
Decoupling Favorites from Suggestions: Initially, a "favorite" was just a boolean is_favorited flag on a suggestion. The problem? When a user refined their search, the old suggestions were deleted, and their favorites vanished with them! This was a terrible user experience. The solution was a crucial architectural pivot: I created a separate user_favorite_suggestions table. This decoupled the "favorite" action from the suggestion itself, persisting a user's liked items across all their searches.
The created_at Mystery: After implementing the new favorites table, my app started crashing. The error was column user_favorite_suggestions.created_at does not exist. I had spent so much time on the front-end logic that I had forgotten a simple truth: my code's types and my database's schema must match perfectly. I had added created_at to my TypeScript interface but forgotten to run the ALTER TABLE command in Supabase to add the actual column. It was a humbling reminder that full-stack development means minding both sides of the stack.
📚 What I Learned
This hackathon was an incredible learning experience.
RLS is a Superpower: Properly implementing Row Level Security in Supabase was a game-changer. It forced me to think about data security from the very beginning and gave me confidence that user data was truly private.
The Power of a Separate "Join" Table: The favorites issue taught me a valuable database design lesson. Decoupling data into separate, related tables is fundamental for building features that are robust and scalable.
AI is a Creative Partner, Not a Magic Box: You can't just ask the AI a question and expect a perfect answer. You have to guide it, constrain it, and give it examples. Building GIFTAI felt less like programming and more like collaborating with a very smart, very fast, but slightly naive intern.
GIFTAI started as a solution to my own personal panic, but it grew into a project that taught me about architecture, security, and the fascinating world of human-computer collaboration. My hope is that it helps others find a little more joy and a little less stress in the beautiful act of gift-giving.
Built With
- google-gemini-api
- netlify
- next.js
- postgresql
- react
- supabase
- tailwind-css
- typescript
Log in or sign up for Devpost to join the conversation.