# Transcript Intelligence Corrections

## Current Issues

All files are in the root directory, making it difficult to navigate. You also have incomplete files like `alert_email_v3.py` (which is empty) and duplicate versions like `alert_email_v2.py`, `alert_email_v3.py`, `email_pipeline.py`, and `email_pipeline1.py`. This suggests unfinished refactoring work.

## Recommended Directory Structure

```
transcript-intelligence/
├── src/
│   ├── core/
│   │   ├── insight_extraction.py
│   │   ├── airtable_fetch.py
│   │   └── config.py
│   ├── api/
│   │   └── app.py
│   └── email/
│       ├── alert_email. py
│       └── email_pipeline.py
├── tests/
│   ├── test_airtable_fetch.py
│   ├── test_config.py
│   └── test_web_api. py
├── data/
│   └── insights_final.csv
├── docker/
│   └── Dockerfile
├── requirements.txt
├── README.md
└── .env.example
```

## Key Changes

Start by removing or merging the duplicate email and pipeline files into single, well-maintained versions. Move your CSV data file to a dedicated `data/` directory and organize your tests in a `tests/` folder following Python conventions.

Add a README.md to document what your project does and how to use it. Create a `.env.example` file to show required environment variables, and move your Dockerfile to a `docker/` directory.

For the groups, can we put it somewhere central so that other systems can reuse. It could be on a gist but inside the fvg workspace. Also consider moving the rest of the code there. If you need to be added anywhere, feel free to let me know

Finally, consider adding a `.github/workflows/` directory for CI/CD if you're not already using it, and optionally use a `requirements-dev.txt` for development-only dependencies.

### Review Comment:

GET requests shouldn't have a body, `so request.get_json() ` will return `None`. Change to `methods=["POST"]` instead:

```python
@app.route("/run", methods=["POST"])
def run_pipeline():
    data = request.get_json()
```