A web application that demonstrates scraping postal codes from Connecticut, USA and storing them in a Supabase database.
-
Install dependencies:
pip install -r requirements.txt -
Install Playwright browsers:
playwright install chromium -
Run the application:
python app.py -
Open http://localhost:8080 in your browser
-
Build the Docker image:
docker build -t postcode-scraper . -
Run the container:
docker run -p 8080:8080 postcode-scraper
- Create a new Web Service on Render
- Connect your GitHub repository
- Use the following settings:
- Build Command:
pip install -r requirements.txt && python -m playwright install chromium && python -m playwright install-deps chromium - Start Command:
gunicorn app:app
- Build Command:
- Add the following environment variables:
SUPABASE_URL: https://hhwhhfgeczrwsekzrsdw.supabase.coSUPABASE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Imhod2hoZmdlY3pyd3Nla3pyc2R3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mzk5NzcyNjYsImV4cCI6MjA1NTU1MzI2Nn0.a0hu4XzA1v67h_A7sipLAP4QHc-7KmFfbeBPIaiGi50RENDER:true(to indicate we're running on Render)
- Create a new Heroku app
- Add the following buildpacks:
- Deploy your code:
git push heroku main
Make sure to set the following environment variables for your Supabase connection:
- SUPABASE_URL
- SUPABASE_KEY