A modern web application that generates personalized cover letters using AI based on job descriptions and user information. Built with React frontend and Python backend, featuring Google Gemini AI integration.
- AI-Powered Cover Letter Generation: Uses Google Gemini AI to create personalized cover letters
- Personal Information Management: Collect and store personal details for consistent formatting
- PDF Generation: Automatically generate professional PDF cover letters
- Modern Web Interface: Clean, responsive React frontend
- Docker Support: Containerized deployment ready
- Cloud Deployment: Configured for Google Cloud Run deployment
The application follows a microservices architecture with the following components:
- Frontend (
frontend/
): React application with modern UI - Backend (
backend/
): Flask server handling API requests and serving the frontend - AI Service (
api_service/
): Google Gemini AI integration for cover letter generation - PDF Service (
pdf_service/
): PDF generation using ReportLab - Static Assets (
static/
): Resume storage and static files
- Python 3.9+
- Node.js 18+ and npm
- Google Gemini API key
- Virtual environment (recommended)
git clone https://github.com/yourusername/Cover-Letter-Generator.git
cd Cover-Letter-Generator
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install backend dependencies
pip install -r backend/requirements.txt
cd frontend
npm install
cd ..
Create a .env
file in the root directory:
# Required: Your Google Gemini API key
GEMINI_API_KEY=your_gemini_api_key_here
# Optional: Frontend API URL (defaults to production URL)
REACT_APP_API_URL=http://localhost:5000
Place your resume PDF file at static/resume.pdf
(the application will use this as a reference for generating cover letters).
Use the provided script to start all services:
chmod +x run.sh
./run.sh
This will start:
- Frontend on http://localhost:3002
- Backend on http://localhost:5000
# Activate virtual environment
source venv/bin/activate
# Start Flask backend
python backend/app.py
cd frontend
PORT=3002 npm start
# Build the Docker image
docker build -t cover-letter-generator .
# Run the container
docker run -p 8080:8080 -e GEMINI_API_KEY=your_key_here cover-letter-generator
- Open the Application: Navigate to http://localhost:3002
- Fill Personal Information: Enter your name, email, phone, and other details
- Add Job Details:
- Enter the company name
- Paste the job description
- Add any custom instructions (optional)
- Generate Cover Letter: Click "Analyze & Generate" to create your personalized cover letter
- Download PDF: Review the generated content and download the professional PDF
POST /api/analyze
: Generate cover letter content using AIPOST /api/generate-pdf
: Create PDF from cover letter contentGET /api/download/<filename>
: Download generated PDF files
- Flask: Web framework
- Google Generative AI: AI-powered content generation
- ReportLab: PDF generation
- PyPDF: PDF processing
- Flask-CORS: Cross-origin resource sharing
- React 18: Modern UI framework
- React Scripts: Build and development tools
- Docker: Containerization
- Gunicorn: Production WSGI server
- Google Cloud Run: Cloud deployment platform
Cover-Letter-Generator/
├── backend/ # Flask backend server
│ ├── app.py # Main Flask application
│ └── requirements.txt # Python dependencies
├── frontend/ # React frontend
│ ├── src/ # Source code
│ ├── public/ # Public assets
│ └── package.json # Node.js dependencies
├── api_service/ # AI service integration
│ ├── ai_service.py # Gemini AI integration
│ └── system_instruction.txt # AI prompt instructions
├── pdf_service/ # PDF generation service
│ └── pdf_generator.py # PDF creation logic
├── static/ # Static files and resume storage
├── terraform/ # Infrastructure as code (if applicable)
├── Dockerfile # Docker configuration
├── run.sh # Development startup script
└── README.md # This file
GEMINI_API_KEY
: Required Google Gemini API keyREACT_APP_API_URL
: Frontend API endpoint (defaults to production)
The application is configured for deployment on Google Cloud Run. The Dockerfile includes:
- Multi-stage build for optimized production image
- Gunicorn WSGI server for production
- Static file serving for the React frontend
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.