2026-02-06 08:33:48 -03:00
2026-02-03 12:20:40 -03:00
2026-02-06 08:33:48 -03:00
2026-02-01 12:39:21 -03:00
2026-02-06 07:48:52 -03:00
2026-02-06 08:51:35 -03:00
2026-02-06 08:51:35 -03:00
2026-02-06 08:33:48 -03:00
2026-02-06 08:33:48 -03:00
2026-02-06 08:33:48 -03:00
2026-02-06 08:22:50 -03:00
2026-02-06 07:48:52 -03:00
2026-02-03 12:20:40 -03:00
2026-02-03 14:00:20 -03:00
2026-02-03 14:40:12 -03:00

MPR - Media Processor

A web-based media transcoding tool with Django admin, FastAPI backend, and React timeline UI.

Architecture

Browser (mpr.local.ar)
         │
      nginx:80
         │
    ┌────┴────┐
    │         │
 /admin     /api, /ui
    │         │
 Django    FastAPI ◄── Timeline UI
    │         │
    │    ┌────┘
    │    │
    └───►│ (job operations)
         │
    gRPC Server
         │
    Celery Worker
  • Django (/admin): Admin interface for data management
  • FastAPI (/api): REST API and gRPC client
  • Timeline UI (/ui): React app for video editing
  • gRPC Server: Worker communication with progress streaming
  • Celery: Job execution via FFmpeg

Prerequisites

  • Docker & Docker Compose

Quick Start

# Add to /etc/hosts
echo "127.0.0.1 mpr.local.ar" | sudo tee -a /etc/hosts

# Start all services
cd ctrl
cp .env.template .env
docker compose up -d

Access Points

URL Description
http://mpr.local.ar/admin Django Admin
http://mpr.local.ar/api/docs FastAPI Swagger
http://mpr.local.ar/ui Timeline UI

Commands

cd ctrl

# Start/stop
docker compose up -d
docker compose down

# Rebuild after code changes
docker compose up -d --build

# View logs
docker compose logs -f
docker compose logs -f celery

# Create admin user
docker compose exec django python manage.py createsuperuser

Code Generation

Models are defined in schema/models/ and generate:

  • Django ORM models
  • Pydantic schemas
  • TypeScript types
  • Protobuf definitions
# Regenerate all
python schema/generate.py --all

# Or specific targets
python schema/generate.py --django
python schema/generate.py --pydantic
python schema/generate.py --typescript
python schema/generate.py --proto

Project Structure

mpr/
├── api/                 # FastAPI application
│   ├── routes/          # API endpoints
│   └── schemas/         # Pydantic models (generated)
├── core/                # Core utilities
│   └── ffmpeg/          # FFmpeg wrappers
├── ctrl/                # Docker & deployment
│   ├── docker-compose.yml
│   └── nginx.conf
├── docs/                # Architecture diagrams
├── grpc/                # gRPC server & client
│   └── protos/          # Protobuf definitions (generated)
├── mpr/                 # Django project
│   └── media_assets/    # Django app
├── schema/              # Source of truth
│   └── models/          # Dataclass definitions
├── ui/                  # Frontend
│   └── timeline/        # React app
└── worker/              # Job execution
    ├── executor.py      # Executor abstraction
    └── tasks.py         # Celery tasks

Environment Variables

See ctrl/.env.template for all configuration options.

Variable Default Description
DATABASE_URL sqlite PostgreSQL connection string
REDIS_URL redis://localhost:6379 Redis for Celery
GRPC_HOST grpc gRPC server hostname
GRPC_PORT 50051 gRPC server port
MPR_EXECUTOR local Executor type (local/lambda)

License

MIT

Description
No description provided
Readme 437 KiB
Languages
Python 83.1%
TypeScript 8.3%
Shell 5.3%
CSS 2.8%
Dockerfile 0.4%
Other 0.1%