Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.66 KB

File metadata and controls

63 lines (43 loc) · 1.66 KB

pizza-party

Work in progress. This project is in early development. APIs, data structures, and CLI interfaces are subject to change.

A generic C client library and CLI for interacting with pizza delivery restaurant APIs. Designed to be provider-agnostic — different restaurant backends can be added by implementing a small vtable interface.

Requirements

  • make
  • A C11-compatible compiler (apt install clang or equivalent)
  • libcurl (brew install curl / apt install libcurl4-openssl-dev)

Building

make           # produces ./pizza-party
make clean

Usage

./pizza-party stores <zip>
./pizza-party menu <store_id>
./pizza-party track <order_id>
./pizza-party watch <order_id> [poll_interval_seconds]

Optional flags (before the command):

Flag Description
-c <file> Path to config file (default: ~/.pizzaparty)
-v Verbose HTTP output

Config file

Plain key=value format:

base_url=https://order.example.com/power
api_key=your_key_here
timeout=30
verbose=0

Development container

A devcontainer configuration is included. Opening this repository in a supporting editor will install all dependencies automatically.

Adding a provider

  1. Create src/providers/<name>.c implementing the pp_provider_t vtable (include/provider.h)
  2. Register it early in main.c with pp_provider_register()
  3. Add the source file to SRCS in the Makefile

The vtable covers: store search, menu fetch, order validation, order placement, and order tracking.

License

GNU General Public License v3.0