StatikAPI is a Next.js-inspired static API generator that builds JSON endpoints from simple filesystem modules.
It’s like “static site generation,” but for structured API responses instead of HTML pages.
.
├─ packages/
│ ├─ cli/ → The `statikapi` CLI (build, dev, preview)
│ ├─ core/ → Shared utilities and internal helpers
│ ├─ ui/ → React preview UI served at /_ui
│ └─ create-statikapi/ → Project scaffolder (WIP)
│
├─ example/
│ ├─ basic/ → Simple static routes
│ ├─ dynamic/ → Dynamic + catch-all routes
│ └─ showcase/ → Full TS example (remote fetch, dynamic, catch-all)
│
├─ docs/ → OSS documentation content (MDX)
├─ .github/ → Issue templates + release workflows
└─ scripts, configs, etc.
- Node.js 22+
- pnpm 9+
- macOS, Linux, or Windows (PowerShell or WSL recommended)
git clone https://github.com/zonayedpca/statikapi.git
cd statikapi
pnpm installDuring local development you usually work on both the CLI and UI:
# From repo root
pnpm devThis runs:
example/basicvia CLI dev mode (statikapi dev)packages/uiVite dev server
Both run concurrently so the embedded preview UI stays live.
You can open the preview at
👉 http://127.0.0.1:8788/_ui
Each example can be run independently:
# Basic
pnpm -C example/basic dev
# Dynamic
pnpm -C example/dynamic dev
# Showcase (TypeScript)
pnpm -C example/showcase devOr build them once:
pnpm -C example/showcase buildOutputs will appear in each project’s api-out/ folder.
The packages/cli package provides the main binary statikapi.
node packages/cli/bin/statikapi.js --help| Command | Description |
|---|---|
build |
Build static JSON endpoints into api-out/ |
dev |
Watch & rebuild on changes, serve UI + SSE |
The React preview UI lives in packages/ui.
You can build or preview it directly:
pnpm -C packages/ui dev
pnpm -C packages/ui buildThe CLI automatically embeds a built copy of this UI during publish via
scripts/embed-ui.js, copied into packages/cli/ui/.
| Script | Description |
|---|---|
pnpm -w lint |
Run ESLint across all packages |
pnpm -w format |
Check Prettier formatting |
pnpm -w format:fix |
Auto-format code |
pnpm -r test |
Run all tests in all packages |
pnpm ui:build |
Build UI + embed into CLI |
pnpm test:watch |
Run tests in watch mode |
All tests are written using Node’s built-in node:test runner.
pnpm -r testTests cover:
- Core build logic (
build,loadPaths,serializeGuard, etc.) - CLI invocation
- Dynamic / catch-all routes
- Config validation
Publishing is automated via GitHub Actions (.github/workflows/release.yml):
- Triggered on pushing a version tag (e.g.
v0.6.4). - Verifies tag version matches
package.jsonacross packages. - Builds & embeds the UI.
- Packs and publishes in order:
@statikapi/corestatikapi(CLI)create-statikapi
The workflow also verifies that the CLI tarball includes its embedded UI (ui/index.html, ui/assets/*).
- Fork and branch off
main(feat/…,fix/…, etc.) - Run
pnpm install && pnpm dev - Lint & test before committing.
- Follow the commit convention defined in
CONTRIBUTING.md. - Open a PR — CI must pass before merge.
MIT © 2025 StatikAPI contributors
See also SECURITY.md and CODE_OF_CONDUCT.md
Happy hacking!
If you’re running pnpm dev, your live playground should be waiting at
👉 http://127.0.0.1:5173/_ui