A free online converter where anyone can paste or upload Markdown and download PDF or Word (.docx) files instantly.
This project uses a split deploy:
| Platform | Role |
|---|---|
| Railway | Runs the Python backend (FastAPI + Pandoc + WeasyPrint) via Docker |
| Vercel | Serves the website UI and proxies /api/* requests to Railway |
Vercel cannot run Pandoc/WeasyPrint in serverless functions, which is why the backend lives on Railway.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reload --port 8000Open http://localhost:8000.
- Go to railway.app → New Project → Deploy from GitHub repo.
- Select
shihabcodes/md-converter. - Railway detects the Dockerfile automatically.
- After deploy, open Settings → Networking → Generate Domain.
- Copy your public URL, e.g.
https://md-converter-production.up.railway.app. - Test it: visit
https://YOUR-RAILWAY-URL/api/health— you should see{"status":"ok"}.
- Go to vercel.com → import
shihabcodes/md-converter. - Important: set Root Directory to
frontend. - Add an environment variable:
- Name:
RAILWAY_API_URL - Value: your Railway URL (no trailing slash), e.g.
https://md-converter-production.up.railway.app
- Name:
- Deploy.
If Vercel was previously connected to the repo root, it tried to run Python serverless and crashed. Setting the root directory to frontend fixes that.
python convert.py examples/sample.md
python convert.py examples/sample.md --pdf
python convert.py examples/sample.md --docxPOST /api/convert
Form fields:
format—pdfordocxmarkdown— raw Markdown text, orfile— uploaded.mdfile
Returns the converted file as a download.
- Maximum input size: 500 KB
- UTF-8 text only
| Layer | Tech |
|---|---|
| Frontend | HTML, CSS, vanilla JS (Vercel) |
| Backend | FastAPI (Railway Docker) |
| DOCX | Pandoc |
| Pandoc + WeasyPrint fallback |