Thu H — Render Deploy Guide

Project: OPT Pal / H1-B Employer Data Hub
Repo: final-project-huynth4
Goal: Put your Flask + SQLite employer dashboard online for Demo Day.

This guide is tailored to your current repo. Your app reads from instance/opt_pal.db, and that database is built from data/Employer Information.csv by import_data_into_SQL.py. Because the database file is not committed, Render needs to rebuild it during deploy.

Before You Start

Make sure the app works locally:

uv sync
uv run python import_data_into_SQL.py
uv run flask --app app run --debug

Open the preview and confirm the quiz leads to the dashboard.

Step 1 — Add the Production Server

Render should run your Flask app with gunicorn.

uv add gunicorn

This updates pyproject.toml and uv.lock.

Step 2 — Confirm the Data File Is Committed

Your deploy depends on this file:

data/Employer Information.csv

Check Source Control. If the CSV appears under Changes, stage and commit it. Render will use it to rebuild instance/opt_pal.db.

Do not worry about committing instance/opt_pal.db; your repo is set up to generate that database from the CSV.

Step 3 — Create render.yaml

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

services:
  - type: web
    name: opt-pal
    env: python
    plan: free
    buildCommand: uv sync --frozen && uv run python import_data_into_SQL.py && uv cache prune --ci
    startCommand: uv run gunicorn app:app
    autoDeploy: true

The longer build command matters: it installs packages, rebuilds the SQLite database from your CSV, then cleans up the build cache.

Step 4 — Commit and Push

In Source Control, stage and commit:

  • pyproject.toml
  • uv.lock
  • render.yaml
  • data/Employer Information.csv if it is not already committed

Use a message like:

add render deploy config

Then click Sync Changes.

Step 5 — Create the Render Service

  1. Go to render.com and sign in with GitHub.
  2. Click New +Web Service.
  3. Connect final-project-huynth4.
  4. Confirm these settings:
    • Environment: Python
    • Build Command: uv sync --frozen && uv run python import_data_into_SQL.py && uv cache prune --ci
    • Start Command: uv run gunicorn app:app
    • Plan: Free
  5. Click Create Web Service.

No API keys are needed for the current version of this app.

Step 6 — Test the Live Site

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

  1. Start at the quiz.
  2. Choose an industry.
  3. Choose a state.
  4. Continue to the dashboard.
  5. Confirm employer matches, totals, top employers, and state data load.

If the dashboard errors with a database/table message, check the Render build log for the uv run python import_data_into_SQL.py step.

Demo Day Notes

Render's free tier has an ephemeral filesystem. That is okay here because your build command recreates the database from the committed CSV every time. If you change the CSV or import script, commit and push both before demo day.