Gift Genie is a full-stack AI-powered web application that generates thoughtful, tailored gift recommendations based on user constraints (location, occasion, recipient interests, and budget). Built with Express, Vite, and Groq/OpenAI APIs.
🌐 Live Demo: https://giftgenie-i0ga.onrender.com
As explained above the web search quickly uses free token, this is seen in the response time, which can take up to 50 seconds. Conversely, without web search, results are much faster, usually under 10 seconds.
DemoVideo.mp4
- JavaScript (ES6+) with Vite as the build tool and development server.
- Marked for parsing Markdown AI responses into HTML.
- DOMPurify to sanitize HTML and protect against XSS attacks.
- Node.js & Express server.
- OpenAI Node.js SDK configured to connect with the Groq API.
- ES Modules (
import/export) structure.
- User Input: The user provides details about the gift recipient or situation in the UI.
- API Proxy & Prompting: The frontend sends a
POSTrequest to/api/gift. - AI Generation: The Express backend receives the request, constructs a structured system prompt, and forwards it securely to the Groq/OpenAI API using server-side environment variables.
- Markdown Rendering: The raw markdown string returned by the LLM is sent back as a JSON payload, parsed into standard HTML on the frontend, sanitized with
DOMPurify, and dynamically inserted into the DOM.
- Node.js (v20.6.0+ recommended)
- npm
git clone https://github.com/GAMinsect/GiftGenie.git
cd GiftGenienpm installCreate a .env file in the root directory:
AI_KEY=your_groq_api_key_here
AI_URL=https://api.groq.com/openai/v1 (I used groq, it also works with openai and operouter)
AI_MODEL=openai/gpt-oss-120b (This is my choice you can chose whatever best suits your needs)To start both the Vite development server and the Express backend simultaneously:
npm run devFrontend App: http://localhost:5173
Backend API: http://localhost:3001
To test the app in production mode (where Express serves the static build files from dist/): Bash
npm run build
npm startThen visit http://localhost:5173 in your browser.
📂 Project Structure
.
├── dist/ # Built static production files (generated by vite build)
├── public/ # Static public assets
├── index.html # HTML entry point
├── index.js # Frontend JavaScript logic
├── server.js # Express API server & static file host
├── vite.config.js # Vite configuration & dev API proxy
├── .env.example # Environment variable template
├── .gitignore # Git ignore file
└── package.json # Project scripts & dependencies