# Architecture

AutoShorts Dashboard is a full-stack creator approval workspace for prepared video packages.

## Runtime topology

```text
Internal production pipeline
          ↓
Prepared package folder
          ↓
storage/incoming
          ↓
FastAPI import worker/API
          ↓
Postgres + local/S3-ready storage
          ↓
Vue Dashboard Review → Upload Jobs → Platform APIs
```

## Backend

- FastAPI REST API under `/api`.
- SQLModel/SQLAlchemy 2 models.
- PostgreSQL in Docker; SQLite supported for local quick development/tests.
- Redis/RQ prepared for background jobs.
- Local storage root for MVP: `storage/`.
- Token encryption helpers in `app/security/crypto.py`.
- Redaction helpers in `app/security/redaction.py`.
- Prepared package importer with duplicate checks by package ID and checksum.
- Topic/idea models for content planning.

## Frontend

- Vue 3 + TypeScript + Vite.
- Pinia dashboard store.
- Vue Router pages for dashboard, inbox, upload, review, calendar, accounts, topics, analytics, logs and settings.
- Responsive creator workspace UI.
- HTML5 video preview.

## Creator approval boundary

Uploads are never a silent side effect of import. Drafts must be reviewed, account selection must be visible, platform metadata must be editable, and upload jobs require explicit approval.

## TikTok posture

MVP implements the safer `video.upload` / inbox draft posture. Direct Post fields are modeled/prepared but should only be activated after app review and explicit user interaction with privacy/interaction settings.

## YouTube posture

YouTube uploads use modular jobs and should use upload-only OAuth scopes where possible. Invalid requests can cost quota, so jobs must be idempotent and auditable.
