A single codebase powering all 4 web surfaces of the Kiwi Store platform (src/) plus the Cloudflare D1 + Edge Cache Worker API (worker/):
| Surface | Default Domain | Purpose |
|---|---|---|
| Kiwi Store | https://store.bansify.com |
Public Android app & game store (Kiwi Store D1 + F-Droid Open Source catalog, search, details, reviews, library, wishlist, direct APK downloads) |
| Kiwi Console | https://storeconsole.bansify.com |
Developer portal (free registration, app creation, APK upload to GitHub Releases with auto-manifest inspection, D1 + Edge Cache WebP image uploads, review replies, analytics) |
| Kiwi Admin | https://storeadmin.bansify.com |
Moderation dashboard (manual APK review queue, approve/reject, suspend/restore, abuse reports) |
| Kiwi Store App | https://store.bansify.com |
Landing page to download the native Kiwi Store Android client APK (com.gothwad.store) |
The native Android client lives in Bansify/storeapp and communicates with this same Worker API (/api/*).
Brand names and domains are never hardcoded in components. All defaults live in
shared/brand.tsand can be overridden via environment variables (VITE_APP_NAME,VITE_APP_DOMAIN,APP_NAME,APP_DOMAIN,*_HOST).
| File | Description |
|---|---|
docs/SETUP.md |
Step-by-step Cloudflare D1, Worker, and Pages deployment guide |
docs/KIWI_MIGRATION.md |
Domain, Cloudflare D1 binding, and Worker route configuration reference |
docs/DEVELOPER_GUIDE.md |
Third-party developer guide for publishing Android apps on Kiwi Store |
sql/README.md |
Idempotent Cloudflare D1 SQLite migrations (00_d1_console_bootstrap.sql, 01_store_schema.sql) |
PLAN.md |
Architecture, decoupled startup model, D1 schema, API endpoints, and security specification |
TASK.md |
Completed engineering milestones and verification checklist |
HANDOVER.md |
Project handover, architecture guardrails, and operational reference |
- Decoupled Identity, Authorization, Catalog, and Surface Data Readiness:
- Public Store catalog (
GET /api/store/apps?fdroid=1+GET /api/store/categories) and identity verification (GET /api/me?light=1/GET /api/auth/session) run independently and concurrently. - Verified identity and account-menu state publish immediately without waiting for catalog, library/wishlist, developer bundle, or admin moderation queries.
- Surface-specific private data loads lazily only for the active surface (
library+wishliston Store,GET /api/dev/appson Console,GET /api/admin/*on Admin after server-verifiedisAdmin === true).
- Public Store catalog (
- Silent First-Party SSO & Resilient Error Semantics:
- Authoritative
401orauthenticated: falseresponses from/api/meresolve immediately asanonymouswithout redundant fallback requests. - Network failures,
429,5xx, and HTML responses resolve asunavailablewith local retry controls (never falsely treating transient outages as signed-out or redirecting to/signin). - When direct Accounts fallback (
GET https://accounts.bansify.com/api/auth/accounts) verifies identity while the Store Worker is unreachable, the client retains the verified identity while marking Store permissions/workspaceunavailable(never manufacturing false "not admin" or "create developer profile" states).
- Authoritative
- Universal Account Menu (
window.GothwadAccountMenu):- Clicking the top-right profile avatar opens the Google-style Account Sheet (
https://accounts.bansify.com/widget/account-menu.jswith offline Shadow-DOM fallback), supporting up to 6 simultaneous signed-in accounts (/u/0../u/5,?authuser=N,X-Gothwad-Authuser).
- Clicking the top-right profile avatar opens the Google-style Account Sheet (
# 1. Install dependencies & run frontend + tests
npm ci
npm run dev # http://localhost:5173 (?mode=store | console | admin | storeapp)
npm run lint # TypeScript typecheck (web + worker)
npm test # Node test suite (D1 SQLite + F-Droid + SSO + startup/resilience + brand + upload guards)
npm run build # Production Vite bundle -> dist/
npm run test:ui # Headless JSDOM render & startup regression suite across all 4 surfaces
# 2. Cloudflare Worker (API)
cd worker
npm ci
cp .dev.vars.example .dev.vars
npm run dev # http://localhost:8787| Asset | Storage Provider | Delivery |
|---|---|---|
| Metadata, Catalog, Reviews, Submissions | Cloudflare D1 (store, a3dc3e71-cf89-4e0a-89d1-693fcf6f227a) |
Worker SQLite queries (/api/store/*, /api/dev/*, /api/admin/*) |
Icons, Screenshots, Banners (<= 380 KB WebP) |
Cloudflare D1 store_images BLOB + Cloudflare Edge Cache (caches.default) |
GET /api/images/:id (Cache-Control: public, max-age=31536000, immutable, ETag) |
First-Party & Third-Party APKs (<= 50 MB) |
GitHub Releases (Bansify/storefiles) |
GET /api/download/:releaseId (302 redirect + download tracking) |
Open-Source Catalog & APKs (fdroid:<pkg>) |
F-Droid Official Repository + Cloudflare Edge Cache (caches.default) |
GET /api/store/fdroid, GET /api/store/apps?fdroid=1, GET /api/download/fdroid:<pkg> |