Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #60 from systemphil/feat/billing-updates
Browse files Browse the repository at this point in the history
feat/billing-updates
  • Loading branch information
Firgrep authored Nov 15, 2024
2 parents ccf1095 + d4c5a54 commit aa8f7f1
Show file tree
Hide file tree
Showing 23 changed files with 15,452 additions and 14,700 deletions.
28,722 changes: 14,611 additions & 14,111 deletions package-lock.json

Large diffs are not rendered by default.

131 changes: 66 additions & 65 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,68 @@
{
"name": "symposia",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "npm run db:push && next build",
"start": "next start",
"lint": "next lint",
"stripe:listen": "stripe listen --forward-to 127.0.0.1:3000/api/stripe-webhook",
"db:regen": "npx prisma generate",
"db:push": "npx prisma db push"
},
"dependencies": {
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@google-cloud/storage": "^7.11.0",
"@mdx-js/mdx": "^2.3.0",
"@mdxeditor/editor": "^2.19.0",
"@mui/icons-material": "^5.16.4",
"@mui/material": "^5.16.4",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.11.0",
"@react-email/components": "0.0.17",
"@tailwindcss/typography": "^0.5.13",
"@tanstack/react-query": "^4.33.0",
"@trpc/client": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",
"@types/mdx": "^2.0.7",
"@types/node": "^20.5.2",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.22",
"autoprefixer": "10.4.15",
"classnames": "^2.5.1",
"clsx": "^2.0.0",
"encoding": "^0.1.13",
"eslint": "8.47.0",
"eslint-config-next": "^13.5.2",
"framer-motion": "^11.2.4",
"micro": "^10.0.1",
"next": "^14.2.3",
"next-auth": "^4.24.7",
"nodemailer": "^6.9.13",
"postcss": "8.4.31",
"react": "^18.2.0",
"react-cookie-consent": "^9.0.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.4",
"react-hot-toast": "^2.4.1",
"react-textarea-autosize": "^8.5.3",
"remark-directive": "^3.0.0",
"remark-gfm": "^3.0.1",
"resend": "^3.2.0",
"sharp": "^0.33.2",
"stripe": "^14.11.0",
"superjson": "^1.13.1",
"tailwindcss": "3.4.3",
"typescript": "5.2.2",
"zod": "^3.22.2"
},
"devDependencies": {
"daisyui": "^4.10.5",
"prisma": "^5.11.0",
"ts-node": "^10.9.1"
}
"name": "symposia",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "npm run db:push && next build",
"start": "next start",
"lint": "next lint",
"stripe:listen": "stripe listen --forward-to 127.0.0.1:3000/api/stripe-webhook",
"db:regen": "npx prisma generate",
"db:push": "npx prisma db push"
},
"dependencies": {
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@google-cloud/storage": "^7.11.0",
"@mdx-js/mdx": "^2.3.0",
"@mdxeditor/editor": "^3.11.5",
"@mui/icons-material": "^5.16.4",
"@mui/material": "^5.16.4",
"@mui/x-data-grid": "^7.18.0",
"@next-auth/prisma-adapter": "^1.0.7",
"@prisma/client": "^5.11.0",
"@react-email/components": "0.0.17",
"@tailwindcss/typography": "^0.5.13",
"@tanstack/react-query": "^4.33.0",
"@trpc/client": "^10.37.1",
"@trpc/react-query": "^10.37.1",
"@trpc/server": "^10.37.1",
"@types/mdx": "^2.0.7",
"@types/node": "^20.5.2",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.22",
"autoprefixer": "10.4.15",
"classnames": "^2.5.1",
"clsx": "^2.0.0",
"encoding": "^0.1.13",
"eslint": "8.47.0",
"eslint-config-next": "^13.5.2",
"framer-motion": "^11.2.4",
"micro": "^10.0.1",
"next": "^14.2.3",
"next-auth": "^4.24.7",
"nodemailer": "^6.9.13",
"postcss": "8.4.31",
"react": "^18.2.0",
"react-cookie-consent": "^9.0.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.45.4",
"react-hot-toast": "^2.4.1",
"react-textarea-autosize": "^8.5.3",
"remark-directive": "^3.0.0",
"remark-gfm": "^3.0.1",
"resend": "^3.2.0",
"sharp": "^0.33.2",
"stripe": "^14.11.0",
"superjson": "^1.13.1",
"tailwindcss": "3.4.3",
"typescript": "5.2.2",
"zod": "^3.22.2"
},
"devDependencies": {
"daisyui": "^4.10.5",
"prisma": "^5.11.0",
"ts-node": "^10.9.1"
}
}
20 changes: 17 additions & 3 deletions src/app/(admin)/admin/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { DeleteEntryProvider } from "@/components/ContextDeleteEntry";
import { getServerAuthSession } from "@/server/auth";
import Link from "next/link";
import { redirect } from "next/navigation";

export const dynamic = "force-dynamic"; // Nextjs flags that disables all caching of fetch requests and always invalidates routes on /admin/*
Expand All @@ -22,11 +23,24 @@ export default async function AdminLayout({
return (
<DeleteEntryProvider>
<section>
<p className="w-full bg-red-200 fixed shadow flex flex-col justify-center items-center">
ADMIN AREA
</p>
<div className="w-full bg-purple-200 z-40 fixed shadow flex justify-center items-center py-1 gap-3">
<span className="text-purple-300">ADMIN AREA</span>
<AdminBtn href="/admin">Main</AdminBtn>
<AdminBtn href="/admin/mng">Management</AdminBtn>
<span className="text-purple-300">ADMIN AREA</span>
</div>
<div className="pt-12">{children}</div>
</section>
</DeleteEntryProvider>
);
}

function AdminBtn(props: { href: string; children: React.ReactNode }) {
return (
<Link href={props.href}>
<button className="btn btn-primary btn-outline btn-sm">
{props.children}
</button>
</Link>
);
}
12 changes: 12 additions & 0 deletions src/app/(admin)/admin/mng/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Heading from "@/components/Heading";
import { Management } from "@/components/Management";
import { PageWrapper } from "@/components/PageWrapper";

export default async function ManagementPage() {
return (
<PageWrapper>
<Heading as="h2">Management</Heading>
<Management />
</PageWrapper>
);
}
11 changes: 6 additions & 5 deletions src/app/api/stripe-webhook/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,22 @@ export async function POST(req: NextRequest) {
case "payment_intent.requires_action":
break;
case "product.updated":
console.log("===Product updated event received");
console.info("ℹ️ Product updated event received");
break;
case "product.created":
break;
default:
if (process.env.NODE_ENV === "development") {
console.log(`===Unhandled event type: ${event.type}`);
console.info(`ℹ️ Unhandled event type: ${event.type}`);
}
// Unexpected event type
}

// Record the event in the database (unless development mode)
if (process.env.NODE_ENV !== "development") {
await dbCreateStripeEventRecord(event);
}
// All details are recorded on Stripe so this is superflous for our purposes.
// if (process.env.NODE_ENV !== "development") {
// await dbCreateStripeEventRecord(event);
// }

return new NextResponse();
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export default function RootLayout({
<RootNavbar />
<div className="relative">{children}</div>
<Footer />
<Suspense>
{/* <Suspense>
<ToastSearchParams />
</Suspense>
</Suspense> */}
<Toaster position="bottom-right" />
<Analytics />
</TRPCProvider>
Expand Down
Loading

0 comments on commit aa8f7f1

Please sign in to comment.