A Next.js application that uses the Gemini API to optimize prompts for large language models. It ships with a clean, modern UI for iterative prompt improvement.
- Secured user data by implementing client-side AES encryption for API keys and resolved 10 CVE vulnerabilities, while scaling the UI to support 12 modular React components and handling up to 1M token context windows.
- Prompt optimization for supported Gemini models
- Local browser storage for your Gemini API key
- Side-by-side prompt refinement workflow
- Session history and quick prompt starters
- One-click copy for optimized output
npm installCreate a .env.local file with a browser-side storage secret:
NEXT_PUBLIC_SECRET_KEY=replace-with-a-long-random-stringThis app encrypts the saved Gemini API key in the browser before writing it to localStorage. If NEXT_PUBLIC_SECRET_KEY is missing, API key storage is disabled.
npm run devVisit http://localhost:3000.
- Your Gemini API key is stored in the browser for this app only after client-side encryption.
- The key is sent when you submit a request through the app so the server route can call Gemini on your behalf.
- The app should not claim the key is never sent to the server; it is not persisted by design, but it does transit through the app's API route during request handling.
- Rotate any previously saved keys if you used an older build that relied on insecure fallback decryption behavior.
This project uses the ESLint CLI directly:
npm run lintThe app is deployed on Vercel at https://prompt-optimizer-tool-beta.vercel.app/. Source code: https://github.com/Daniyal0100101/prompt-optimizer.
This project is licensed under the Apache License 2.0. See LICENSE.
