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.