This repository contains a tiny Flask + Jinja app packaged as a Vercel Python serverless function.
Files:
api/index.py- Flask WSGI app entrypoint used by Verceltemplates/index.html- Jinja2 template rendered by Flaskrequirements.txt- Python dependenciesvercel.json- Vercel configuration
Quick local run (Windows PowerShell):
# create venv
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python api/index.pyDeploy to Vercel (recommended):
- Install the Vercel CLI:
npm i -g vercelor use the web UI. - From the project root run:
vercel login
vercel --prodVercel will detect the vercel.json and use the @vercel/python runtime to deploy api/index.py.
Test locally (once the app is running):
# From a separate PowerShell window
curl http://127.0.0.1:5000/The editor saves files to a local saved_files/ directory in the project. This works for local development and persistent servers. However, Vercel and other serverless providers use ephemeral file systems: files written at runtime are not guaranteed to persist across invocations, builds, or deployments.
If you need persistent storage in production, consider:
- Using an object store (S3, Cloud Storage) for files
- Using a simple database (SQLite on a persistent volume, PostgreSQL)
- Using Vercel KV or another key-value service for small items
If you'd like, I can add a SQLite backend or an example that saves to S3/Vercel KV and update the UI accordingly.