diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..af30e59 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +MP4_VIEWER_DIR=/path/to/your/mp4/folder +FLASK_HOST=127.0.0.1 +FLASK_PORT=5000 diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..adf2018 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,21 @@ +# AGENTS.md — mp4-viewer + +## Environment +- Python 3.14 virtual environment at `venv/` +- Activate: `source venv/bin/activate` + +## Commands +- Install deps: `source venv/bin/activate && pip install -r requirements.txt` +- Run: `python app.py` (reads `.env` via python-dotenv; override with env vars) +- Test listing: `curl http://127.0.0.1:5000/` +- Test video: `curl -I http://127.0.0.1:5000/video/` + +## Architecture +- `app.py` — Flask entrypoint, routes, path validation +- `templates/` — Jinja2 HTML templates (`index.html`, `play.html`) +- `.env` — default config (gitignored); `.env.example` checked in +- `MP4_VIEWER_DIR` — single source dir for MP4s; all served paths validated with `is_relative_to` + +## Notes +- `venv/` is gitignored via its own `.gitignore`; keep it out of the repo root +- `.env` is gitignored; copy `.env.example` to `.env` and edit diff --git a/README.md b/README.md deleted file mode 100644 index 527c212..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# mp4-viewer - diff --git a/SPEC.md b/SPEC.md new file mode 100644 index 0000000..a58cbcd --- /dev/null +++ b/SPEC.md @@ -0,0 +1,51 @@ +# SPEC — mp4-viewer + +## §G — Goal + +Web app to browse & play MP4 files from a configurable directory in-browser. + +## §C — Constraints + +- Python 3.14, venv `venv/` +- Flask + python-dotenv +- Jinja2 templates in `templates/` directory +- No JS build toolchain — keep it simple HTML + minimal inline JS +- MP4 playback via native browser `