feat: initial commit — storefront, convex backend, and shared packages
Completes the first milestone of The Pet Loft ecommerce platform: - apps/storefront: full customer-facing Next.js app with HeroUI (cart, checkout, orders, wishlist, product detail, shop, search, auth) - convex/: serverless backend with schema, queries, mutations, actions, HTTP routes, Stripe/Shippo integrations, and co-located tests - packages/types, packages/utils, packages/convex: shared workspace packages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
18
packages/convex/package.json
Normal file
18
packages/convex/package.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "@repo/convex",
|
||||
"version": "0.0.1",
|
||||
"private": true,
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./provider": "./src/provider.tsx"
|
||||
},
|
||||
"dependencies": {
|
||||
"@repo/types": "*",
|
||||
"convex": "*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": ">=19.0.0"
|
||||
}
|
||||
}
|
||||
1
packages/convex/src/index.ts
Normal file
1
packages/convex/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { ConvexClientProvider } from "./provider";
|
||||
20
packages/convex/src/provider.tsx
Normal file
20
packages/convex/src/provider.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import { ReactNode } from "react";
|
||||
import { ConvexReactClient } from "convex/react";
|
||||
import { ConvexProviderWithClerk } from "convex/react-clerk";
|
||||
import { useAuth } from "@clerk/nextjs";
|
||||
|
||||
if (!process.env.NEXT_PUBLIC_CONVEX_URL) {
|
||||
throw new Error("Missing NEXT_PUBLIC_CONVEX_URL");
|
||||
}
|
||||
|
||||
const convex = new ConvexReactClient(process.env.NEXT_PUBLIC_CONVEX_URL);
|
||||
|
||||
export function ConvexClientProvider({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<ConvexProviderWithClerk client={convex} useAuth={useAuth}>
|
||||
{children}
|
||||
</ConvexProviderWithClerk>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user