Files
vv_ext/README.md
T
2026-10-09 22:15:22 +03:00

29 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# vv_ext — красивая оболочка для vv.micialware.ru
# Стек: Flask + SQLite + чистый JS + Tailwind CDN. Без сборки, без авторизации.
## Структура
# app.py — бэкенд: 5 ручек API + SQLite
# scanner.py — сканирует папку с видео, добавляет новые файлы в БД
# frontend/index.html, app.js, style.css — лента + сетка
# deploy/vv.conf — nginx, deploy/vv.service — systemd
## Быстрый старт (локально)
# python -m venv .venv && source .venv/bin/activate
# pip install -e .
# VIDEO_DIR=/path/to/videos python scanner.py # наполнить БД
# VIDEO_DIR=/path/to/videos python app.py # http://127.0.0.1:8000
## API
# GET /api/health
# GET /api/tags -> [{name, count}]
# GET /api/videos?tag=&q=&sort=new|likes&page=1&per_page=30 -> {items, page, pages, total}
# POST /api/videos/<file>/like -> {likes} (1 лайк с IP в сутки)
# POST /api/videos/<file>/tags {"tag": "..."} -> {tags}
# POST /api/scan -> пересканировать VIDEO_DIR
## Прод (на VPS где уже лежит nginx-раздача)
# 1. залить frontend/ в /var/www/vv_ext/
# 2. app.py + db.sqlite в /opt/vv_ext/, VIDEO_DIR=/var/www/vv/ (где .mp4/.webm)
# 3. deploy/vv.conf -> /etc/nginx/conf.d/, deploy/vv.service -> /etc/systemd/system/
# 4. systemctl enable --now vv && systemctl reload nginx