Live Demo: https://daniyal-rashid-00.github.io/Email-Generator/
A beautiful, modern React application that helps you transform your raw thoughts into polished, professional emails using AI.
- ✨ AI-Powered Email Generation - Uses OpenRouter.ai with free Gemini models to craft professional emails
- 🎨 Beautiful UI/UX - Modern design with blues, whites, and greys color palette
- 🌙 Dark Mode - Toggle between light and dark themes
- 📱 Mobile Responsive - Fully optimized for all screen sizes
- 🎭 Multiple Tones - Choose from Professional, Warm, Concise, Formal, Casual, or Persuasive
- 📧 Context Support - Optionally include the email you're responding to for better context
- 📋 Copy to Clipboard - One-click copy functionality for generated emails
- ⚡ Fast & Responsive - Built with Vite for optimal performance
- Node.js (v16 or higher)
- npm or yarn
- Install dependencies:
npm install-
Set up environment variables:
- Copy
.env.exampleto.env:cp .env.example .env
- Edit
.envand add your OpenRouter API key:VITE_OPENROUTER_API_KEY=your_api_key_here
- Copy
-
Start the development server:
npm run dev- Open your browser and navigate to
http://localhost:5173
npm run buildThe built files will be in the dist directory, ready for deployment to GitHub Pages or Vercel.
- Push your code to GitHub
- Import your repository in Vercel
- Vercel will automatically detect Vite and configure the build settings
- Deploy!
-
Push your code to GitHub:
git init git add . git commit -m "Initial commit" git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO_NAME.git git branch -M main git push -u origin main
-
Set up GitHub Secrets (for API key security):
- Go to your repository Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
VITE_OPENROUTER_API_KEY - Value: Your OpenRouter API key (get it from https://openrouter.ai/keys)
- Click Add secret
-
Enable GitHub Pages:
- Go to your repository Settings → Pages
- Under Source, select GitHub Actions
- Save
-
That's it! GitHub Actions will automatically build and deploy your app.
Your app will be live at:
https://YOUR_USERNAME.github.io/YOUR_REPO_NAME/See
DEPLOYMENT.mdfor detailed instructions.
The app uses environment variables to securely store the OpenRouter API key:
VITE_OPENROUTER_API_KEY- Your OpenRouter.ai API key (get it from https://openrouter.ai/keys)
Important: Never commit your .env file to version control. It's already in .gitignore.
For GitHub Pages deployment, add VITE_OPENROUTER_API_KEY as a GitHub Secret (see Deployment section).
Note: OpenRouter provides free access to various AI models. The app uses google/gemini-2.0-flash-exp:free by default.
- React 18
- Vite
- Tailwind CSS (with Dark Mode support)
- Lucide React (Icons)
- OpenRouter.ai API (with free Gemini models)
MIT