Hydrogen
Commerce primitives for you and your coding agents. Add cart, products, money, and accounts to the framework you already use.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
A functional demo of a demand-first offtake + embedded-finance platform for
Northern-Nigeria perishable-crop smallholders. One live run shows the full loop
across three actors, updating live across screens:
• /phone — Farmer (Musa / Hauwa): feature-phone USSD in Hausa + SMS inbox
• /agent — Agent (Ibrahim): installable PWA — register, enrol + advance, grade, aggregate
• /buyer — Buyer (Mrs. Okafor): post demand, watch supply fill live, fund escrow
• /admin — Presenter: impact metrics (income uplift, loss avoided, GMV, revenue split) + Reset demo
• / — launcher檢視完整 README ↗A functional demo of a demand-first offtake + embedded-finance platform for Northern-Nigeria perishable-crop smallholders. One live run shows the full loop across three actors, updating live across screens:
/phone — Farmer (Musa / Hauwa): feature-phone USSD in Hausa + SMS inbox/agent — Agent (Ibrahim): installable PWA — register, enrol + advance, grade, aggregate/buyer — Buyer (Mrs. Okafor): post demand, watch supply fill live, fund escrow/admin — Presenter: impact metrics (income uplift, loss avoided, GMV, revenue split) + Reset demo/ — launcherSimulated & labeled: USSD/telco, payment settlement, and NDFR verification are mocked for the demo. Production runs over Africa's Talking + a licensed PSP.
Single Next.js (App Router, TypeScript) app. Thin /api/* route handlers validate
with zod, call isolated src/domain/* services (pricing, finance, escrow, USSD, metrics —
all unit-tested, money in integer kobo), and persist via Prisma + Postgres. Every
mutation publishes a Server-Sent Event; all open surfaces refetch within ~1–2s
(polling fallback if SSE drops).
src/domain/* pure business logic (TDD) src/app/api/* thin adapters + publish()
src/realtime/hub SSE publish/subscribe src/lib/useAppState live client state
prisma/schema data model src/domain/seed deterministic demo cast
docker compose up -d # Postgres on host port 5433
cp .env.example .env # DATABASE_URL points at localhost:5433
npx prisma migrate deploy # apply migrations (non-destructive)
npm install
npm run seed # load the demo cast
npm run dev # http://localhost:3000
Open /buyer, /agent, and /phone in three windows side by side to see live sync.
Fully self-contained; works with venue wifi down.
docker compose up -d
npx prisma migrate deploy && npm run seed
npm run build
npm start # production server on :3000
During the pitch, use the Reset demo button on /admin to return to a clean cast
between runs (this uses the app's own reset — always available).
*347*55# → 1 (sell) → tomato → 12 baskets → hears the fair
price (₦5,000) vs the middleman glut price (₦3,000) → 1 (accept).Expected ledger for the run above: Musa ₦57,000 (advance + net payout ₦17,000), agent ₦1,200 (2% commission), platform ₦1,800 (3% fee, advance recouped).
npm test # domain unit tests (no DB)
npm run test:e2e # hero-path integration test — drives the real handlers against Postgres
The e2e test resets via the app's own seed module and asserts the full ledger settles.
DATABASE_URL to the Neon string.DATABASE_URL="<neon-url>" npx prisma migrate deploy
DATABASE_URL="<neon-url>" npm run seed
postinstall runs prisma generate
automatically during the build. Deploy and verify the hero flow on the live URL.npm run db:resetdb:reset runs prisma migrate reset, which drops and recreates the database.
Prisma's CLI refuses this when invoked by an AI coding agent, so run it yourself from a
normal shell when you want a full wipe. For day-to-day resets (including during the demo),
use the Reset demo button on /admin — it re-seeds without touching migrations.