# AutoShorts Dashboard

**Control prepared short-form videos from review to private upload approval.**

AutoShorts Dashboard is a creator-facing publishing workspace for prepared video packages. It helps review videos, edit platform-specific metadata, select accounts, schedule timing, approve controlled private uploads, inspect redacted logs, and manage the topic/idea pipeline that guides future content.

## Product direction

The visible UI must not expose internal production machinery. The product is framed around prepared packages, review, approval, scheduling and topic planning. See `docs/product-direction.md`.

## MVP status

This first version includes:

- FastAPI backend with SQLModel models for videos, drafts, accounts, jobs, topics, ideas and analytics.
- Vue 3 + TypeScript + Vite frontend with responsive creator workspace layout.
- Operations cockpit, Content Inbox, Manual Upload, Review, Calendar, Accounts, Topic Pipeline, Analytics, Logs and Verification pages.
- Prepared package import from `storage/incoming/<package_id>/manifest.json`.
- Neutral prepared package manifest format with package ID, metadata suggestions, disclosure flags and review status.
- Manual upload endpoint with file validation, checksum and draft creation.
- Private upload / platform draft job skeletons requiring explicit approval.
- Redacted API call logs and import logs.
- Demo seed command for local product review.
- Docker Compose for Postgres, Redis, backend and frontend.
- Tailscale deployment notes and platform verification docs.

## Quick start

```bash
cp .env.example .env
docker compose up --build
```

Local dev without Docker:

```bash
cd backend
uv sync --extra dev
uv run uvicorn app.main:app --reload --port 8000

cd ../frontend
npm install
npm run dev
```

Open:

- Frontend: http://localhost:5173 or Docker http://localhost:3000
- Backend health: http://localhost:8000/api/health

## Seed demo data

Use this for local UI review when the dashboard is empty:

```bash
curl -X POST http://localhost:8000/api/dev/seed
```

This creates demo topics, ideas, prepared packages, one scheduled private upload and one failed upload job. It is not fake platform functionality; it is local development data.

## Prepared package manifest

Prepared packages can be dropped into:

```text
storage/incoming/package_2026_06_06_001/
  video.mp4
  manifest.json
  thumbnail.jpg optional
  transcript.txt optional
```

Manifest shape:

```json
{
  "package_id": "package_2026_06_06_001",
  "source": "prepared_package",
  "working_title": "Example title",
  "language": "de",
  "topic_id": null,
  "series": null,
  "suggested_tiktok_caption": "Editable TikTok caption",
  "suggested_youtube_title": "Editable YouTube title",
  "suggested_youtube_description": "Editable YouTube description",
  "suggested_hashtags": ["#example"],
  "disclosure": {
    "synthetic_media": true,
    "commercial_content": false
  },
  "status": "ready_for_review"
}
```

Then run:

```bash
curl -X POST http://localhost:8000/api/imports/scan
```

## Tailscale Serve

For Tailnet-only access:

```bash
docker compose up -d
tailscale serve 3000
```

Use `PUBLIC_APP_URL` / `AUTOSHORTS_PUBLIC_APP_URL` for external platform review/staging domains. Do not assume a private Tailscale URL is sufficient for platform app review.

## Safety rules

- No API secrets in frontend.
- No tokens in browser localStorage.
- OAuth tokens are intended to be stored encrypted server-side.
- API logs must be redacted.
- Upload URLs must be redacted.
- Upload actions require explicit approval.
- Platform disclosure fields may use “Synthetic media” or “AIGC disclosure” where legally/platform-relevant.

## Verification

```bash
cd backend && uv run pytest -q && uv run ruff check app tests
cd frontend && npm run build
```
