Metadata-Version: 2.4
Name: movie-narrator-web
Version: 1.0.4
Summary: Web UI (FastAPI + React) for movie-narrator — install separately from the core engine.
Author-email: zcbacxc <zcbacxc@users.noreply.github.com>
License-Expression: AGPL-3.0-or-later
Project-URL: Homepage, https://github.com/zcbacxc/movie-narrator-web
Project-URL: Repository, https://github.com/zcbacxc/movie-narrator-web
Project-URL: Issues, https://github.com/zcbacxc/movie-narrator-web/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: movie-narrator>=0.5.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: python-multipart>=0.0.6
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# movie-narrator-web

![Python](https://img.shields.io/badge/python-3.10%2B-blue)
![License](https://img.shields.io/github/license/zcbacxc/movie-narrator-web)
![CI](https://github.com/zcbacxc/movie-narrator-web/actions/workflows/ci.yml/badge.svg)
![PyPI](https://img.shields.io/pypi/v/movie-narrator-web)
![Downloads](https://img.shields.io/pypi/dm/movie-narrator-web)

Web UI (FastAPI + React) for [movie-narrator](https://github.com/zcbacxc/movie-narrator).

> **Versioning**: This package uses an **independent version line**,
> separate from the core engine (`movie-narrator`). Compatibility is guaranteed by the
> `CONTRACT_VERSION` check at import time — you do not need to match version numbers
> between the two packages.

This is a separate package from the core engine. Install it only if you need
the web interface:

```bash
pip install movie-narrator-web
```

This automatically pulls in `movie-narrator` (core engine) and all web
dependencies (FastAPI, uvicorn).

## Prerequisites

- Python >= 3.10
- ffmpeg (required by the core engine for audio/video processing)

## Usage

```bash
mn-web --host 127.0.0.1 --port 8760
```

For development with auto-reload:

```bash
mn-web --reload
```

### CLI Options

| Option | Default | Description |
|--------|---------|-------------|
| `--host` | `127.0.0.1` | Bind address |
| `--port` | `8760` | Port to listen on |
| `--reload` | off | Enable auto-reload (development mode) |

Or programmatically:

```python
from movie_narrator_web import launch_web_api

launch_web_api(host="127.0.0.1", port=8760)
```

## Development

The frontend source is in `webui/` (React + Vite + TypeScript + shadcn/ui).
Build the SPA before packaging:

```bash
cd webui
npm ci
npm run build
```

The build output lands in `src/movie_narrator_web/static/` and is served
by FastAPI in production mode.

## Internationalization

The Web UI is bilingual (Chinese / English). A language switcher in the header
lets you toggle between the two; the default follows your browser language and
your choice is remembered in `localStorage`. The selected language is also sent
to the backend as a `lang` (`zh` | `en`) form field and passed downstream to the
pipeline, so narration can be generated in the active language.

## Architecture

This package depends on `movie-narrator` exclusively through the public
contract layer (`movie_narrator.contract`). No internal module imports.

## Documentation

- [Changelog](CHANGELOG.md)
- [Contributing](CONTRIBUTING.md)

## License

Licensed under the [AGPL-3.0-or-later](LICENSE) License.
