Metadata-Version: 2.4
Name: fftp
Version: 0.4.0
Summary: FFTP — Food From Terminal Protocol: the open protocol for ordering food. Terminal-native ordering for devs, dead-simple setup for restaurants.
Author: FFTP contributors
License: MIT
Project-URL: Homepage, https://github.com/OpenSourceRulesz/fftp
Project-URL: Repository, https://github.com/OpenSourceRulesz/fftp
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.115
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: pydantic>=2.0
Requires-Dist: httpx>=0.27
Requires-Dist: pyyaml>=6.0
Requires-Dist: pypdf>=4.0
Requires-Dist: openpyxl>=3.1
Requires-Dist: Pillow>=10.0
Requires-Dist: pytesseract>=0.3.10
Requires-Dist: python-multipart>=0.0.9
Requires-Dist: qrcode>=7.0
Dynamic: license-file

<p align="center">
  <img src="brand/fftp-wordmark.svg" width="320" alt="FFTP">
</p>

<p align="center">
  <strong>The open protocol for ordering food.</strong><br>
  Order from your terminal — or let your AI agent do it. Restaurants keep 100%.
</p>

<p align="center">
  <a href="https://pypi.org/project/fftp/"><img src="https://img.shields.io/pypi/v/fftp" alt="PyPI"></a>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT">
  <img src="https://img.shields.io/badge/telemetry-none-brightgreen" alt="No telemetry">
</p>

---

## For humans (and their agents)

```bash
pip install fftp
```

**Or skip the typing entirely — paste this into Claude or ChatGPT:**

```
Set up fftp on this machine so I can order food from my terminal.

1. Install it: pip install fftp
2. Run `fftp --help` to verify it works
3. Ask me where I'm located and what I like to eat, then help me add restaurants near me
4. Walk me through placing my first order

Docs: https://github.com/OpenSourceRulesz/fftp — if any step fails, diagnose and fix it, don't just describe the problem.
```

Then it's:

```bash
fftp nearby chinese      # what's around?
fftp menu china-express  # read the menu
fftp order china-express # place a pickup order
fftp watch ord_abc123    # dings + phone alert when it's ready
```

`watch` shows the pickup address with a maps link, fires a desktop notification when your food's ready, and with `--notify mytopic` it pings your phone via [ntfy](https://ntfy.sh) — no account needed.

## For restaurants

Zero commission. Your customers, your menu, your money.

```bash
bash installer/install.sh   # macOS/Linux (installer/install.ps1 on Windows)
~/.fftp/fftp-app    # opens your counter dashboard
```

Upload your existing menu — PDF, Excel, a text file, whatever you've got — and the dashboard converts it for you. Orders ding in live; tap a button to move them along. Pickup-first by design; opt into delivery with your own fee whenever you want.

**Customers can also order from their phone browser:** the dashboard's Settings tab shows a QR code — print it, stick it on the counter, and scanning it opens a simple order page. No app to install.

**Adding a restaurant is one command:** `fftp add http://<server>:8000` registers it from its counter QR.

The dashboard is protected by an admin token: the server prints your dashboard URL (with `?token=...`) on startup, and `--app` opens it directly. Pass `--admin-token` to set your own, or it generates and saves one next to the database.

### Taking card payments online

Out of the box, customers pay at the counter — the dashboard shows a `COLLECT $X` badge on unpaid tickets and you tap **Mark paid**. For online card payment (Apple Pay, Google Pay, and saved cards all appear automatically):

1. Create a free [Stripe](https://stripe.com) account and grab your secret key.
2. Start the server with it set:

```bash
STRIPE_SECRET_KEY=sk_live_... ~/.fftp/fftp-app
```

Customers are offered card payment in the terminal, pay on their phone, and the ticket flips to paid by itself. Card fees (~2.9% + 30¢) go to Stripe, like any card payment — fftp takes nothing.

### Ordering from home (not just shop wifi)

By default fftp works on the restaurant's own network. To let customers order from home — still free, still no middleman — use [Tailscale](https://tailscale.com/download) (free for up to 100 devices):

1. Install Tailscale on the restaurant computer and run `tailscale up`.
2. Customers install Tailscale on their device and join the same tailnet.
3. In the customer's `~/.config/fftp/places.yaml`, point the restaurant at its Tailscale IP:

```yaml
places:
  - {name: wandering-taco, base_url: http://100.64.0.5:8000, cuisine: Mexican, lat: 40.7, lon: -74.0}
```

Get the IP with `tailscale ip -4` on the restaurant machine. (The installer offers this step too.)

## The protocol

Four calls. That's the whole thing:

```
GET  /.well-known/fftp.json   → "here's my ordering server"
GET  /fftp/v1/menu            → structured menu (prices, modifiers, availability)
POST /fftp/v1/orders          → place the order
GET  /fftp/v1/orders/{id}     → received → preparing → ready
```

Any client can implement it — a terminal app, an AI agent, a mobile app, a script. The restaurant runs one tiny server; everything else is just HTTP.

## Principles

- **Open** — MIT licensed. The protocol is documented and anyone can build on it.
- **No telemetry** — the software never phones home. Ever.
- **Free** — the protocol is free forever. No commissions, no rent-seeking.

## Development

```bash
git clone https://github.com/OpenSourceRulesz/fftp
cd fftp
python -m venv .venv && .venv/bin/pip install -e .
.venv/bin/python demo.py          # runs the full self-test
bash examples/serve-test-places.sh # spin up 6 test restaurants
```

## License

MIT — see [LICENSE](LICENSE).
