The AI-EmailGenerator is a powerful, intelligent web application designed to streamline and automate the process of writing professional emails. Built with React and bundled using Vite for a fast development experience and dynamic user interface, it leverages cutting-edge Large Language Models (LLMs) to generate email drafts from simple user prompts.
Goal: To provide a seamless, interactive experience for users to quickly generate high-quality, contextually relevant, and grammatically correct email content directly in their browser.
- Prompt-to-Email Generation: Generate a full email draft from a simple, one-line request via an intuitive text input field.
- Tone Adjustment: Interactive controls (e.g., dropdowns/sliders) to specify the desired tone (professional, friendly, urgent, casual) for the output.
- Copy-to-Clipboard: One-click functionality to instantly copy the generated email body for easy pasting into your email client.
- Modern UI/UX: Built using React and styled with [Specify Styling Method, e.g., Tailwind CSS] to ensure a responsive and modern user experience.
You'll need the following installed on your machine:
- Node.js (which includes npm or yarn)
- Git
-
Clone the repository:
git clone https://github.com/Ansh0305/AI-EmailGenerator.git cd AI-EmailGenerator -
Install dependencies: If using npm (recommended for Vite):
npm install
If using yarn:
yarn install
This project requires an API key from an LLM provider (e.g., OpenAI, Google Gemini). For security, API keys should be stored in an environment file. Since you are using Vite, environment variables must be prefixed with VITE_.
-
Obtain your API Key from [https://platform.openai.com/api-keys].
-
Create a file named
.envin the root directory of the project. -
Add your API key to the
.envfile using theVITE_prefix (adjust the variable name to match how you access it in your code):# Example for a Vite/React App VITE_API_KEY="YOUR_API_KEY_HERE"
Note: Access these variables in your React code using
import.meta.env.VITE_API_KEY.
After installation and setup, start the development server:
If using npm:
npm run devIf using yarn:
yarn devThe application should automatically open in your browser at: http://localhost:5173/ (the default port for Vite).
The application guides you through four simple steps to generate a complete email draft:
| Step | Action | Example Input / Expected Output |
|---|---|---|
| 1. Prompt | Enter the core idea and context of the email. | "Follow up with Alex about the budget proposal we sent last week." |
| 2. Tone | Select the desired communication style. | "Professional and encouraging" |
| 3. Generate | Click the main button to process the request. | The app communicates with the LLM and generates the draft. |
| 4. Output | Review the generated draft and copy the final text. | Subject: Following Up: Budget Proposal for Q3 |
Frontend Framework: React
Build Tool: Vite
Package Manager: npm / yarn
LLM Integration: OpenAI
Styling: Tailwind CSS
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Fork the Project
Create your Feature Branch (git checkout -b feature/AmazingFeature)
Commit your Changes (git commit -m 'Add some AmazingFeature')
Push to the Branch (git push origin feature/AmazingFeature)
Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Your Name or Handle - [saiansh2016@gmail.com]
Project Link: https://github.com/Ansh0305/AI-EmailGenerator.git