DocFormatConverter

A document-conversion platform I’ve been building. Web UI + REST API + WeChat mini-program from a single Python backend. Started as a personal tool, grew into something a few teammates started using, so I tightened it up.

The reason for the WeChat/H5/Alipay version is that most users in our context aren’t on desktop. Sharing a converted file via a tiny client is way more useful than asking them to log into a website.

What works

Quick start (Docker, fastest)

cp .env.example .env
cp backend/.env.example backend/.env   # if present; otherwise backend reads from .env at repo root
make keys       # generates keys/jwt_{private,public}.pem
docker compose -f docker-compose.dev.yml up -d

API on :8000, web on :5173, MinIO console on :9001 (minio/minio123).

Quick start (local Python)

If you don’t want Docker:

python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# start postgres + redis separately, or use docker compose just for those:
docker compose -f docker-compose.dev.yml up -d postgres redis minio
alembic -c backend/alembic.ini upgrade head
python -m backend.app.scripts.bootstrap_admin
uvicorn app.main:app --reload --app-dir backend

For the worker:

celery -A app.workers.celery_app worker -l info --app=app.workers.celery_app -C 2

Repo layout

backend/    FastAPI + Celery
frontend/   React + Vite + Tailwind + Zustand
miniprogram/  Taro (compiles to weapp / h5 / alipay)
deploy/     nginx, prometheus, grafana, k8s
docker-compose*.yml
Makefile

API surface

OpenAPI at /docs in dev.

Things I left rough

A list so I don’t forget, in priority order:

If you spot a real bug not in this list, please open an issue.

Tests

make test               # full suite
make test-fast          # skip integration
cd frontend && pnpm test

I aim for ~80% on the backend. The converter layer is the lowest coverage because most of the work is shelling out, which a unit test can’t really cover without a 200MB LibreOffice fixture.

Security notes

Performance

Numbers from make load-smoke on my laptop (16 cores, NVMe, no GPU):

Workers autoscale by celery_queue_length in K8s; the Helm chart is in deploy/k8s/.

License

MIT. See LICENSE.

Contact

Open an issue. I read them.

@badhope