File size: 2,620 Bytes
5301ae9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | # 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/`.
|