Skip to content

Deploy to Vercel as a Flask upload app - #3

Merged
royalpriest merged 2 commits into
mainfrom
claude/project-thread-q90zvi
Nov 7, 2026
Merged

royalpriest merged 2 commits into
mainfrom
claude/project-thread-q90zvi

Conversation

@royalpriest

@royalpriest royalpriest commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Requested by Royal · project thread

Problem

The Vercel build failed with PYTHON_ENTRYPOINT_NOT_FOUND. The project uses the Python preset, which needs a web app entrypoint, and the repo only had a command-line tool.

Fix

The first commit was a static-page workaround. Royal chose to make it a real Python web app instead, so the second commit replaces that workaround:

  • app.py is a Flask app that Vercel deploys with no extra configuration.
    • GET / is an upload page with drag-and-drop and a "Show full passenger names" option.
    • POST /report takes an .xlsx and returns the HTML dashboard from report_tool.
    • GET /sample shows the sample workbook's report.
  • Privacy: an upload is written to a temp file only because openpyxl needs a file, and that file is deleted right after parsing. Nothing is stored. Reports are sent with Cache-Control: no-store, and names stay masked unless the box is ticked.
  • Limits and errors: uploads are capped at 4 MB (Vercel's request limit is 4.5 MB). A non-.xlsx file, an unreadable file, no valid rows, or a file over the limit all return the upload page with a clear message. Temp paths never appear in those messages.
  • flask is added to the dependencies. vercel.json is removed. pytest gets pythonpath = ["."] so CI can import app. The README section is updated.

How I checked

  • pytest: 49 passed, including 5 new app tests (upload page, sample, upload with and without name masking, bad inputs, file too large). ruff check . and ruff format --check . are clean.
  • vercel build (CLI 65.11.0, the same version as the failing log) completed with both the python and flask presets. It produced one flask function, and the bundle includes report_tool/templates, templates/upload.html and the sample workbook.
  • Ran the app locally in Chromium. Uploading the sample returned the dashboard, and uploading a non-workbook showed the error state.

🤖 Generated with Claude Code

https://claude.ai/code/session_016gtNTGbmvq2DdoGC4air5K

Vercel detected pyproject.toml and built the repo as a Python web app,
failing with PYTHON_ENTRYPOINT_NOT_FOUND. vercel.json now sets the
framework to "Other", installs the tool into .deps, generates the HTML
report from the sample workbook into public/, and serves it as index.html.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gtNTGbmvq2DdoGC4air5K
@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
railstat Ready Ready Preview Nov 7, 2026 2:25am UTC

Request Review

@royalpriest royalpriest self-assigned this Nov 7, 2026
Replaces the static vercel.json build. app.py is a Flask app that Vercel
deploys with zero config: upload an .xlsx (up to 4 MB) and get the HTML
dashboard back, or open /sample. Uploads go to a temp file that is deleted
right after parsing; nothing is stored. Names stay masked unless the user
ticks "Show full passenger names". Adds flask to the dependencies and
tests for the upload, sample, error and size-limit paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gtNTGbmvq2DdoGC4air5K
@royalpriest royalpriest changed the title Deploy the sample report to Vercel as a static page Deploy to Vercel as a Flask upload app Nov 7, 2026
@royalpriest
royalpriest merged commit cf611f8 into main Nov 7, 2026
5 checks passed
royalpriest added a commit that referenced this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants