Local mock server for social media platform APIs - auth, publishing, the lot
Project description
posthole
[!WARNING] Pre-release / alpha. APIs and UI may break without notice. Not yet recommended for any production use.
Local mock server for social media platform APIs - auth, publishing, the lot.
posthole is a developer tool that stands in for real social media platform APIs so
you can build and test integrations end-to-end on your laptop. Run it next to your
app, point your code at 127.0.0.1:5176 instead of the real provider, and an
inbox-style UI shows every post you've published alongside the complete HTTP
transcript of each call. Instagram is the first platform supported; TikTok,
Facebook, and others are on the roadmap.
It mocks the parts of these APIs you actually need while developing:
- OAuth flows — authorize dialogs, token exchange, and token refresh.
- Content publishing — images, videos, reels, stories, and carousels (including mixed-media), modeled on the real multi-step container → poll → publish lifecycle.
- Accounts and permissions — switch between seeded test accounts and simulate revoked permissions.
- Per-endpoint behavior toggles — flip any endpoint into a failure mode at runtime: rate-limited, validation error, media URL unreachable, reel duration too long, expired token, async-finished-with-error, slow response.
- Scenarios — named bundles of behaviors (Validation, Quota, Auth, Async, Latency) so a single switch flips a whole class of failures on at once and you can watch how your code copes.
On the roadmap: replay (re-drive a captured request chain under a different scenario without re-running your app), inject (seed posts manually to reproduce specific UI states), more platforms (TikTok, Facebook, then YouTube and Threads), and richer device-preview frames.
Quick start
Docker (recommended):
docker run --rm -p 5176:5176 ghcr.io/socialpyre/posthole:latest
# → http://127.0.0.1:5176
As a uv tool (once published to PyPI):
uvx posthole
# → http://127.0.0.1:5176
Getting started
Prerequisites
- Python 3.12+
- uv ≥ 0.11 —
curl -LsSf https://astral.sh/uv/install.sh | sh - Node 22 + pnpm 11 —
nvm use(reads.nvmrc) thencorepack enable - Docker (optional, only if you want to run the containerized image or test it locally)
Clone, install, run
git clone https://github.com/socialpyre/posthole
cd posthole
make install # uv sync + pnpm install
make dev # server + asset watchers + browser auto-reload
Then open http://127.0.0.1:5176.
Configurable knobs live in .env.schema; copy to .env.local
to override locally. See CONTRIBUTING.md for
the workflow.
Common make targets
| Command | What it does |
|---|---|
make help |
Show available targets |
make install |
Sync Python (uv sync) + Node (pnpm install) deps |
make dev |
Run FastAPI server + esbuild + Tailwind watchers + browser auto-reload |
make run |
Run the FastAPI server only (no watchers), with varlock-injected env |
make assets |
One-shot rebuild of app.js + app.css |
make test |
Run pytest + vitest |
make lint |
ruff check + ruff format --check + prettier --check |
make format |
ruff format + ruff check --fix + prettier --write |
make typecheck |
ty check (Python) + tsc --noEmit (TypeScript) |
make check |
Everything CI runs (lint + typecheck + test) |
make build |
Build wheel + sdist into dist/ |
make docker |
Build the Docker image locally as posthole:dev |
make docker-run |
Run the locally built image |
Live reload
make dev runs the processes declared in Procfile.dev under
honcho, so a single Ctrl-C tears them all
down:
fastapi devrestarts the server on.py/.tomledits viawatchfiles.- esbuild
--watchrebuildssrc/posthole/static/app.json.tsedits. tailwindcss --watchrebuildssrc/posthole/static/app.csson template / CSS edits.arelis mounted on/hot-reload(gated byPOSTHOLE_DEV_RELOAD=1) and reloads the browser when watched files change.
See CONTRIBUTING.md for the full development workflow, commit conventions, and release process.
License
MIT — see LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file posthole-0.5.2.tar.gz.
File metadata
- Download URL: posthole-0.5.2.tar.gz
- Upload date:
- Size: 272.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c33a2de85d0885a84643d0a7aa424504282c7f401ee8dd1f22eedf6838ff24da
|
|
| MD5 |
53c946fbeaa0c333af7bcd3fa63dc0d0
|
|
| BLAKE2b-256 |
fc483c0139e2b9bd756deff904e016f6017b96a1dc7a256e033c178d89629dd3
|
Provenance
The following attestation bundles were made for posthole-0.5.2.tar.gz:
Publisher:
release.yml on socialpyre/posthole
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
posthole-0.5.2.tar.gz -
Subject digest:
c33a2de85d0885a84643d0a7aa424504282c7f401ee8dd1f22eedf6838ff24da - Sigstore transparency entry: 1548375961
- Sigstore integration time:
-
Permalink:
socialpyre/posthole@d0029e0685ebcc4327ce6c5cf8072bd07014ba34 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/socialpyre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0029e0685ebcc4327ce6c5cf8072bd07014ba34 -
Trigger Event:
push
-
Statement type:
File details
Details for the file posthole-0.5.2-py3-none-any.whl.
File metadata
- Download URL: posthole-0.5.2-py3-none-any.whl
- Upload date:
- Size: 169.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9f83d9b27b8c48f1dd994825e0a96bbca971f3f6c5a7458c4dfd6ff4f405c4b
|
|
| MD5 |
759b27f8d64ea6723f1a5698f4bae721
|
|
| BLAKE2b-256 |
ffc0d0d4e591031c911bf8859d0a002a5d02c7b5ece69428a82e3dab8f969a67
|
Provenance
The following attestation bundles were made for posthole-0.5.2-py3-none-any.whl:
Publisher:
release.yml on socialpyre/posthole
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
posthole-0.5.2-py3-none-any.whl -
Subject digest:
c9f83d9b27b8c48f1dd994825e0a96bbca971f3f6c5a7458c4dfd6ff4f405c4b - Sigstore transparency entry: 1548376020
- Sigstore integration time:
-
Permalink:
socialpyre/posthole@d0029e0685ebcc4327ce6c5cf8072bd07014ba34 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/socialpyre
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d0029e0685ebcc4327ce6c5cf8072bd07014ba34 -
Trigger Event:
push
-
Statement type: