尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Edgecoms - Built for the next generation of Shopify.
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗A full-stack TypeScript monorepo for Edgecoms — thoughtfully crafted Shopify apps and the marketing site that fronts them. Built with Next.js, tRPC, Drizzle, and a shared UI package, orchestrated by Turborepo and Bun workspaces.
packages/uiInstall dependencies (from the repo root):
bun install
Configure environment — copy apps/web/.env.example to apps/web/.env and fill in your database connection, auth secrets, and admin bootstrap credentials.
Start PostgreSQL — spin up the local database container (defined in packages/db/docker-compose.yml):
bun run db:start
Apply the schema to the database:
bun run db:push
Seed the app catalog and create an admin (idempotent):
bun run db:seed
bun run db:create-admin
Run the dev server:
bun run dev
Open http://localhost:3001 to view the app.
edgecoms/
├── apps/
│ ├── web/ # Next.js app (marketing + partner + admin portals)
│ └── worker/ # Railway cron entrypoint (billing-sync)
└── packages/
├── ui/ # Shared shadcn/ui components & design tokens
├── api/ # tRPC routers + the authorization layer
├── auth/ # Better Auth configuration
├── billing/ # Money math, Partner API adapter, reconcile & commissions
├── db/ # Drizzle schema, migrations & local DB compose
├── env/ # Shared, validated environment variables
└── config/ # Shared tooling config (TS, Ultracite, etc.)
Run all scripts from the repo root.
| Script | Description |
|---|---|
bun run dev | Start all apps in development mode |
bun run dev:web | Start only the web app |
bun run build | Build all apps |
bun run check-types | Type-check across the monorepo |
| Script | Description |
|---|---|
bun run db:start | Start local PostgreSQL (Docker, detached) |
bun run db:watch | Start local PostgreSQL in the foreground |
bun run db:stop | Stop the database container |
bun run db:down | Stop and remove the database container |
bun run db:push | Push schema changes to the database |
bun run db:generate | Generate migration files |
bun run db:migrate | Run pending migrations (local) |
bun run db:deploy | Apply migrations to a remote/production database |
bun run db:setup:deploy | First deploy: migrate + seed + create admin (idempotent) |
bun run db:seed | Seed the 7 Edge apps, local (idempotent) |
bun run db:create-admin | Create/promote the admin user (ADMIN_EMAIL / ADMIN_PASSWORD) |
bun run db:studio | Open Drizzle Studio |
| Script | Description |
|---|---|
bun run check | Lint & format check (Ultracite) |
bun run fix | Auto-fix lint & formatting issues |
The web app consumes shadcn/ui primitives through packages/ui:
packages/ui/src/styles/globals.csspackages/ui/src/components/*packages/ui/components.json and apps/web/components.jsonImport shared components like this:
import { Button } from "@edgecoms/ui/components/button";
Add more primitives to the shared package (run from the repo root):
bunx shadcn@latest add accordion dialog popover sheet table -c packages/ui
For app-specific blocks rather than shared primitives, run the shadcn CLI from apps/web instead.
This repo is the Edge Partner Platform — the business layer for Edge's Shopify apps. It has three experiences in one Next.js app plus a billing worker:
/, /products, /partners, /about, /contact) — public, on-brand./partner/*, role partner) — register merchants, track
commission, manage payout details./admin/*, role admin) — approve partners (set rate +
per-app overrides), approve merchants (capturing the grandfathered app set),
mark commissions paid, and group payouts.bigint) with a 3-char
currency — no floating-point math ever touches money.earning_events is an append-only mirror of the Shopify Partner API
transactions stream, idempotent on the Shopify transaction id.The full invariant set lives in CLAUDE.md. The money paths and
authorization boundaries are unit/integration tested (bun run test) against an
in-process Postgres (PGlite) — no Docker required for tests.
apps/worker is a standalone entrypoint (bun src/billing-sync.ts) that runs a
full sync — ingest the Partner API transactions stream, then generate any
missing commissions — and then closes its DB pool and exits. It logs a
structured JSON run summary. Admins can also trigger the same runBillingSync
from the dashboard ("Run sync now").
It needs these (optional everywhere else) env vars:
PARTNER_API_ORGANIZATION_ID="..."
PARTNER_API_ACCESS_TOKEN="..."
PARTNER_API_VERSION="2025-01" # optional
Deploy two services from this one repo against a shared Railway Postgres:
Postgres — add a Railway Postgres service. Enable backups and use its
private networking URL for DATABASE_URL on both services below.
Web service (the Next app)
bun install && bun run buildbun run --filter web start (or cd apps/web && bun run start)DATABASE_URL, BETTER_AUTH_SECRET, BETTER_AUTH_URL, CORS_ORIGIN,
and the PARTNER_API_* vars (so the admin "Run sync now" works).Worker service (the cron job)
cd apps/worker && bun src/billing-sync.ts0 */6 * * * (every 6 hours).DATABASE_URL + the PARTNER_API_* vars.Migrations are applied deliberately, by a human — never from a build step. A build that migrates a money database can fire from a preview deploy, run concurrently with another build, or migrate a deployment that is then rolled back, leaving the schema ahead of the code.
From a machine with DATABASE_URL pointing at the production database:
bun install
DATABASE_URL="postgresql://..." ADMIN_EMAIL="..." ADMIN_PASSWORD="..." bun run db:setup:deploy
That applies migrations, seeds the 7 Edge apps, and creates the admin user.
Every step is idempotent — migrations track applied state, the seed upserts on
slug, and create-admin promotes an existing user — so re-running is safe.
Individual steps, if you need them:
bun run db:deploy # migrations only
bun run db:seed:deploy # the 7 Edge apps
bun run db:create-admin:deploy # ADMIN_EMAIL / ADMIN_PASSWORD must be set
Use the :deploy variants for anything remote. The plain db:migrate,
db:seed and db:create-admin scripts load apps/web/.env, so they target
your local database.
Replace the placeholder Partner API GIDs in the seed with your real app GIDs via
PARTNER_API_GID_<SLUG> env vars (see apps/web/.env.example), then re-run
bun run db:seed:deploy.