timeline and readme
This commit is contained in:
136
README.md
Normal file
136
README.md
Normal file
@@ -0,0 +1,136 @@
|
||||
# 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
|
||||
|
||||
```bash
|
||||
# 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
|
||||
|
||||
```bash
|
||||
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
|
||||
|
||||
```bash
|
||||
# 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
|
||||
Reference in New Issue
Block a user