# EMAILOUT Setup Guide ## Prerequisites 1. OpenAI API Key - Get one from https://platform.openai.com/api-keys ## Hugging Face Spaces Setup 1. **Create a new Space**: - Go to https://huggingface.co/spaces - Click "Create new Space" - Select "Docker" as the SDK - Name it "EMAILOUT" (or your preferred name) 2. **Add OpenAI API Key as Secret**: - Go to your Space Settings - Navigate to "Secrets" section - Add a new secret: - Key: `OPENAI_API_KEY` - Value: Your OpenAI API key 3. **Upload Files**: - Upload all project files to your Space - The Dockerfile will handle the build process 4. **Deploy**: - The Space will automatically build and deploy - Monitor the logs for any build errors ## Local Development 1. **Install Dependencies**: ```bash # Backend cd backend pip install -r requirements.txt # Frontend cd ../frontend npm install ``` 2. **Set Environment Variables**: ```bash export OPENAI_API_KEY=your_api_key_here ``` 3. **Run Backend**: ```bash cd backend uvicorn app.main:app --reload --port 8000 ``` 4. **Run Frontend**: ```bash cd frontend npm run dev ``` ## Project Structure ``` EMAILOUT/ ├── backend/ │ ├── app/ │ │ ├── __init__.py │ │ ├── main.py # FastAPI application │ │ ├── database.py # SQLite database models │ │ ├── models.py # Pydantic models │ │ └── gpt_service.py # OpenAI GPT integration │ └── requirements.txt ├── frontend/ │ ├── src/ │ │ ├── pages/ │ │ │ └── EmailSequenceGenerator.jsx │ │ ├── components/ │ │ │ ├── upload/ │ │ │ ├── products/ │ │ │ ├── prompts/ │ │ │ ├── sequences/ │ │ │ └── ui/ │ │ └── ... │ └── package.json ├── Dockerfile └── README.md ``` ## Features - ✅ CSV Upload from Apollo - ✅ Product Selection with Custom Products - ✅ Prompt Template Editor - ✅ GPT-Powered Sequence Generation - ✅ Real-time Streaming Results - ✅ CSV Export for Klenty/Outreach ## API Endpoints - `POST /api/upload-csv` - Upload CSV file - `POST /api/save-prompts` - Save prompt templates - `GET /api/generate-sequences` - Generate sequences (SSE stream) - `GET /api/download-sequences` - Download sequences as CSV ## Database SQLite database is stored at `/data/emailout.db` (persistent in HF Spaces). Uploaded files are stored at `/data/uploads/`.