尚未检测到更新。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.