> Source URL: /unit-3/project-paths/miranda-m/miranda-m-2026-04-28-render-deploy.guide
# Miranda M — Render Deploy Guide

**Project:** PlainText Pal  
**Repo:** `final-project-MirandaMireles`  
**Goal:** Put your Flask + Anthropic app online for Demo Day.

This guide is tailored to your current repo. Your app already has `app.py`, `pyproject.toml`, `uv.lock`, templates, static files, and `.env.example`. The main deploy work is adding the production server, fixing the secret name, and creating `render.yaml`.

---

## Before You Start

Make sure the app still runs locally:

```bash
uv sync
uv run flask --app app run --debug
```

Open the preview, paste text into PlainText Pal, choose an audience, and confirm the results page loads.

---

## Step 1 — Add the Production Server

Render should run your Flask app with `gunicorn`, not Flask's local debug server.

```bash
uv add gunicorn
```

This updates `pyproject.toml` and `uv.lock`. Commit both files later.

---

## Step 2 — Fix Your Example Secret File

Your code reads this exact environment variable:

```text
ANTHROPIC_API_KEY
```

Open `.env.example` and make sure it says:

```text
ANTHROPIC_API_KEY=
```

Keep your real `.env` file private. Do not commit your actual Anthropic key.

---

## Step 3 — Create `render.yaml`

Create a new file at the project root named `render.yaml`:

```yaml
services:
  - type: web
    name: plaintext-pal
    env: python
    plan: free
    buildCommand: uv sync --frozen && uv cache prune --ci
    startCommand: uv run gunicorn app:app
    autoDeploy: true
    envVars:
      - key: ANTHROPIC_API_KEY
        sync: false
```

The first `app` in `app:app` is your file name (`app.py`). The second `app` is the Flask variable inside that file.

---

## Step 4 — Commit and Push

In Source Control, stage and commit:

- `pyproject.toml`
- `uv.lock`
- `.env.example`
- `render.yaml`

Use a message like:

```text
add render deploy config
```

Then click **Sync Changes**.

---

## Step 5 — Create the Render Service

1. Go to [render.com](https://render.com) and sign in with GitHub.
2. Click **New +** → **Web Service**.
3. Connect `final-project-MirandaMireles`.
4. Confirm these settings:
   - **Environment:** `Python`
   - **Build Command:** `uv sync --frozen && uv cache prune --ci`
   - **Start Command:** `uv run gunicorn app:app`
   - **Plan:** `Free`
5. In **Environment Variables**, add your real `ANTHROPIC_API_KEY`.
6. Click **Create Web Service**.

---

## Step 6 — Test the Live Site

When Render finishes, open the live URL and test the core flow:

1. Paste a paragraph into the text box.
2. Choose a target audience.
3. Submit the form.
4. Confirm the readability stats, suggestions, and rewrite appear.

If the suggestions say `ANTHROPIC_API_KEY is not set`, the app deployed but the Render environment variable is missing or misspelled.

---

## Demo Day Notes

PlainText Pal does not rely on a database, so you do not need to worry about saved rows disappearing. The important demo prep is making sure the Anthropic key is set in Render and testing with one short sample paragraph before you present.


---

## Backlinks

The following sources link to this document:

- [April 28 — Render deploy](/unit-3/project-paths/projects.path.llm.md)
- [April 28 -- Render deploy](/unit-3/project-paths/miranda-m/miranda-m.path.llm.md)
- [April 28 - Render deploy](/unit-3/projects/showcase/miranda-m.project.llm.md)
