Files
forwarder/README.md
T
1sonhador d1e4725ac3 Add Python API, worker, MySQL migrations and wire admin-ui in Docker.
Backend FastAPI + APScheduler worker with Alembic schema; admin-ui served
via nginx with /api proxy. Unifies Paperclip UI scaffold with local platform code.
2026-07-01 00:04:57 +01:00

51 lines
1.4 KiB
Markdown

# BizDocs Forwarder
Multi-account IMAP → BizDocs forwarder: detect invoice attachments (PDF/XML/ZIP), re-send via SMTP as `.eml`.
- **Repo:** https://git.bitreport.pt/BitReport.pt/forwarder
- **Paperclip:** http://10.10.50.17:3100/BIT/projects/bizdocs-forwarder
## Stack
| Component | Path | Description |
|-----------|------|-------------|
| API | `src/forwarder/api/` | FastAPI REST |
| Worker | `src/forwarder/worker/` | APScheduler IMAP sync |
| Admin UI | `admin-ui/` | Vite + React |
| DB | MySQL 8 | Alembic migrations |
## Quick start
```bash
cp .env.example .env
# Generate ENCRYPTION_KEY: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
docker compose up -d --build
docker compose exec api alembic upgrade head
```
- API: http://localhost:8000/api/health
- Admin UI: http://localhost:8080
- Auth: HTTP Basic (`ADMIN_USERNAME` / `ADMIN_PASSWORD`)
## Local dev
```bash
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
docker compose up -d mysql
alembic upgrade head
uvicorn forwarder.api.app:app --reload --app-dir src
forwarder worker # second terminal
cd admin-ui && npm install && npm run dev # third terminal
```
## Deploy (Proxmox CT)
```bash
git clone https://git.bitreport.pt/BitReport.pt/forwarder.git
cd forwarder && cp .env.example .env
docker compose up -d --build
docker compose exec api alembic upgrade head
```