Foxpile

Foxhole logistics platform

Companion data, a secure API, and useful Discord alerts.

Foxpile collects visible Foxhole stockpiles from the desktop companion, stores consistent snapshots, exposes authorized data through OAuth and SSE, then turns changes into grouped Discord notifications.

1. Companion

Collects trusted game data

Watches supported Foxhole save files, hashes changes, signs uploads with HMAC, prevents local npm development from uploading, links Discord, displays its version in the system tray, and installs updates.

2. API

Normalizes and protects state

Parses stockpiles, resolves map locations and factions, records reserve access, serves OAuth-protected resources, keeps history, and publishes trusted realtime events.

3. Discord bot

Turns changes into alerts

Filters events per guild and route, buffers related alerts for 25 seconds, groups locations into PinMaps, exposes details, and supports low, critical, updated, faction, and token-expiry notifications.

Consistency guarantees

Fresh reads follow committed writes.

MariaDB uses InnoDB foreign keys and transactions. Stockpile state and quantity history are committed atomically.

Queued writes have priority over new reads. A GET waits briefly when a push is pending, then reads the committed state.

Partial snapshots preserve data that was not observed. Real observed zeroes remain valid updates.

Older snapshots are ignored. History commits with the stock update, while SSE is emitted only after success.

Platform capabilities

Signed companion uploads

Changed save files are hashed, size-limited, HMAC-signed, nonce-protected, and validated before parsing.

Transactional stockpiles

Partial observations are merged atomically. Older snapshots cannot overwrite newer quantities.

OAuth and scoped access

Public data is faction-filtered; reserve data requires regiment.read and a matching recorded grant.

Buffered Discord alerts

Related events are grouped for 25 seconds and rendered with details and map pins instead of message spam.

Integrate the API

Create an OAuth application and make your first authenticated request.

Read stockpiles

Browse maps, locations, reserves, search results, summaries, and history.

Subscribe to events

Use filtered SSE subscriptions or connect the Foxpile Discord bot.