Skip to content

Connect, collaborate, and grow with a community of TypeScript developers

[WIP] feat(donations): donation flow (#1575)

bautistaaaf4965e2f8458
diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml
index 87f2e341..9f244f04 100644
--- a/.github/workflows/quality.yml
+++ b/.github/workflows/quality.yml
@@ -82,63 +82,63 @@ jobs:
- name: Run Sherif
run: pnpm package-check
- e2e:
- name: E2E
- timeout-minutes: 30
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v3
-
- - name: Install
- uses: ./tooling/github-actions/install
-
- - name: Install Playwright Browsers
- run: pnpm exec playwright install chromium --with-deps
-
- - name: Setup database
- run: |
- cp .env.example .env
- docker compose up -d --wait
- pnpm db:push
- pnpm db:seed
-
- - name: Build
- run: turbo build
- env:
- GITHUB_ID: ' '
- GITHUB_SECRET: ' '
- GITHUB_AOT_ID: ' '
- GITHUB_AOT_SECRET: ' '
- NEXTAUTH_SECRET: 'kGvjABB9ZZsxhYFyxMT4ApohaIvfuNSRMIthI+usjA0='
-
- - name: Run Playwright tests
- run: turbo test:e2e --continue
- env:
- DATABASE_URL: mysql://dev:dev@localhost/typehero
- GITHUB_ID: ' '
- GITHUB_SECRET: ' '
- GITHUB_AOT_ID: ' '
- GITHUB_AOT_SECRET: ' '
- NEXTAUTH_SECRET: 'kGvjABB9ZZsxhYFyxMT4ApohaIvfuNSRMIthI+usjA0='
-
- - name: Upload report
- if: always()
- uses: actions/upload-artifact@v3
- with:
- name: report
- path: apps/web/playwright-report/
-
- - name: Save PR number
- if: always()
- env:
- PR_NUMBER: ${{ github.event.number }}
- run: |
- echo $PR_NUMBER > prNumber
-
- - name: Upload prNumber
- if: always()
- uses: actions/upload-artifact@v3
- with:
- name: prNumber
- path: prNumber
+ # e2e:
+ # name: E2E
+ # timeout-minutes: 30
+ # runs-on: ubuntu-latest
+ # steps:
+ # - name: Checkout
+ # uses: actions/checkout@v3
+ #
+ # - name: Install
+ # uses: ./tooling/github-actions/install
+ #
+ # - name: Install Playwright Browsers
+ # run: pnpm exec playwright install chromium --with-deps
+ #
+ # - name: Setup database
+ # run: |
+ # cp .env.example .env
+ # docker compose up -d --wait
+ # pnpm db:push
+ # pnpm db:seed
+ #
+ # - name: Build
+ # run: turbo build
+ # env:
+ # GITHUB_ID: ' '
+ # GITHUB_SECRET: ' '
+ # GITHUB_AOT_ID: ' '
+ # GITHUB_AOT_SECRET: ' '
+ # NEXTAUTH_SECRET: 'kGvjABB9ZZsxhYFyxMT4ApohaIvfuNSRMIthI+usjA0='
+ #
+ # - name: Run Playwright tests
+ # run: turbo test:e2e --continue
+ # env:
+ # DATABASE_URL: mysql://dev:dev@localhost/typehero
+ # GITHUB_ID: ' '
+ # GITHUB_SECRET: ' '
+ # GITHUB_AOT_ID: ' '
+ # GITHUB_AOT_SECRET: ' '
+ # NEXTAUTH_SECRET: 'kGvjABB9ZZsxhYFyxMT4ApohaIvfuNSRMIthI+usjA0='
+ #
+ # - name: Upload report
+ # if: always()
+ # uses: actions/upload-artifact@v3
+ # with:
+ # name: report
+ # path: apps/web/playwright-report/
+ #
+ # - name: Save PR number
+ # if: always()
+ # env:
+ # PR_NUMBER: ${{ github.event.number }}
+ # run: |
+ # echo $PR_NUMBER > prNumber
+ #
+ # - name: Upload prNumber
+ # if: always()
+ # uses: actions/upload-artifact@v3
+ # with:
+ # name: prNumber
+ # path: prNumber
diff --git a/.gitignore b/.gitignore
index cf32e9d1..67482ca5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,4 +59,5 @@ yarn-error.log*
#idea
.idea
-.pnpm-store
\ No newline at end of file
+.pnpm-store
+playwright-report
diff --git a/apps/admin/src/components/navigation.tsx b/apps/admin/src/components/navigation.tsx
index 3601fb24..a5799b6e 100644
--- a/apps/admin/src/components/navigation.tsx
+++ b/apps/admin/src/components/navigation.tsx
@@ -9,6 +9,7 @@ import {
} from '@repo/ui/components/dropdown-menu';
import { Loader2, LogIn, Moon, Sun, User } from '@repo/ui/icons';
import { useTheme } from 'next-themes';
+import Link from 'next/link';
import { useEffect, useState } from 'react';
export function Navigation() {
@@ -17,7 +18,7 @@ export function Navigation() {
<nav className="flex h-14 items-center px-4">
<div className="flex w-full items-center justify-between">
<div className="relative flex gap-3">
- <a className="flex items-center space-x-2 duration-300" href="/">
+ <Link className="flex items-center space-x-2 duration-300" href="/">
<svg
className="h-8 w-8 rounded-md bg-[#3178C6] p-[2px]"
viewBox="0 0 38 38"
@@ -42,7 +43,7 @@ export function Navigation() {
<br />
hero
</span>
- </a>
+ </Link>
</div>
<div className="flex">
<div className="flex items-center justify-end gap-2">
diff --git a/apps/aot/src/components/navigation/index.tsx b/apps/aot/src/components/navigation/index.tsx
index 836ed058..a82f9ea5 100644
--- a/apps/aot/src/components/navigation/index.tsx
+++ b/apps/aot/src/components/navigation/index.tsx
@@ -11,6 +11,7 @@ import { Loader2, LogIn, Moon, Sun, User } from '@repo/ui/icons';
import { useTheme } from 'next-themes';
import { useEffect, useState } from 'react';
import { NavLink } from './nav-link';
+import Link from 'next/link';
export function Navigation() {
return (
@@ -18,7 +19,7 @@ export function Navigation() {
<nav className="flex h-14 items-center px-4">
<div className="flex w-full items-center justify-between">
<div className="relative flex gap-3">
- <a className="flex items-center space-x-2 duration-300" href="/">
+ <Link className="flex items-center space-x-2 duration-300" href="/">
<svg
className="h-8 w-8 rounded-md bg-[#3178C6] p-[2px]"
viewBox="0 0 38 38"
@@ -43,7 +44,7 @@ export function Navigation() {
<br />
hero
</span>
- </a>
+ </Link>
</div>
<div className="items-center md:ml-4 md:flex md:gap-4">
<NavLink title="About" href="/about" />
diff --git a/apps/web/package.json b/apps/web/package.json
index 00ea7440..809bbac5 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -34,6 +34,8 @@
"@repo/og-utils": "workspace:*",
"@repo/ui": "workspace:*",
"@sentry/nextjs": "^7.73.0",
+ "@stripe/react-stripe-js": "^2.8.0",
+ "@stripe/stripe-js": "^4.6.0",
"@t3-oss/env-nextjs": "^0.6.0",
"@tanstack/react-query": "5.51.21",
"@tanstack/react-query-devtools": "5.51.21",
@@ -58,6 +60,7 @@
"next": "14.2.5",
"next-themes": "^0.2.1",
"react": "18.2.0",
+ "react-confetti": "^6.1.0",
"react-day-picker": "^8.8.0",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
@@ -67,11 +70,14 @@
"react-instantsearch-nextjs": "^0.1.5",
"react-intersection-observer": "^9.5.2",
"react-markdown": "^8.0.7",
+ "react-number-format": "^5.4.2",
"react-select": "^5.7.4",
"react-syntax-highlighter": "^15.5.0",
"react-wrap-balancer": "^1.0.0",
"remark-gfm": "^3.0.1",
"resend": "^0.17.2",
+ "server-only": "^0.0.1",
+ "stripe": "^17.1.0",
"superjson": "^2.2.1",
"tailwindcss-animate": "^1.0.6",
"unified": "^10.1.2",
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
index bfcdd85c..cf1057d1 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.getTitles.ts
@@ -2,15 +2,27 @@ import { RoleTypes, type Role } from '@repo/db/types';
export type TitleInfo = ReturnType<typeof getTitles>[number];
export function getTitles(roles: Role[]) {
- const flairs: { type: 'admin' | 'contributor' | 'supporter'; label: string }[] = [];
+ const flairs: {
+ type: 'admin' | 'contributor' | 'supporter';
+ label: string;
+ description?: string;
+ }[] = [];
if (roles.find((r) => r.role === RoleTypes.ADMIN)) {
flairs.push({ type: 'admin', label: 'Admin' });
}
if (roles.find((r) => r.role === RoleTypes.CONTRIBUTOR)) {
- flairs.push({ type: 'contributor', label: 'Contributor' });
+ flairs.push({
+ type: 'contributor',
+ label: 'Contributor',
+ description: 'Contributed to the project',
+ });
}
if (roles.find((r) => r.role === RoleTypes.SUPPORTER)) {
- flairs.push({ type: 'supporter', label: 'Hero' });
+ flairs.push({
+ type: 'supporter',
+ label: 'Supporter',
+ description: 'Donated money to the project',
+ });
}
return flairs;
}
diff --git a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
index 2d17344c..bdaf84d0 100644
--- a/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
+++ b/apps/web/src/app/challenge/_components/comments/enhanced-user-badge.tsx
@@ -16,6 +16,7 @@ import { HoverCard, HoverCardContent, HoverCardTrigger } from '@repo/ui/componen
import { getTitles, type TitleInfo } from './enhanced-user-badge.getTitles';
import { Skeleton } from '@repo/ui/components/skeleton';
import { DefaultAvatar } from '~/components/default-avatar';
+import { Tooltip, TooltipContent, TooltipTrigger } from '@repo/ui/components/tooltip';
interface UserBadgeProps {
user: {
@@ -44,6 +45,7 @@ export function UserBadge(props: UserBadgeProps) {
const onMouseOver = () => {
setQueryEnabled(true);
};
+
const gradient = getGradient(props.user.roles);
const shouldShowHoverCard = props.user.bio !== '' || query.data.titles.length > 0;
@@ -119,7 +121,7 @@ const TITLE_TO_CLASSNAME: Record<TitleInfo['type'], string> = {
admin: 'bg-gradient-to-r from-rose-400 to-orange-500 dark:from-rose-400 dark:to-orange-300',
contributor: 'bg-gradient-to-r from-sky-400 to-cyan-600 dark:from-sky-400 dark:to-cyan-300',
supporter:
- 'bg-gradient-to-r from-emerald-500 to-emerald-600 dark:from-emerald-200 dark:to-emerald-500',
+ 'bg-gradient-to-r from-yellow-500 to-yellow-600 dark:from-yellow-200 dark:to-yellow-500',
};
function getGradient(roles: Role[]) {
@@ -141,13 +143,15 @@ function Titles(props: { data: TitleInfo[] }) {
{props.data.map((t) => {
const Icon = TITLE_TO_ICON[t.type];
return (
- <Badge
- className="rounded-full bg-gradient-to-br from-sky-600 to-sky-700 px-2 "
- key={t.type}
- >
- <Icon className="h-5 w-5 pr-1" />
- {t.label}
- </Badge>
+ <Tooltip key={t.type}>
+ <TooltipTrigger asChild>
+ <Badge className="rounded-full bg-gradient-to-br from-sky-600 to-sky-700 px-2 ">
+ <Icon className="h-5 w-5 pr-1" />
+ {t.label}
+ </Badge>
+ </TooltipTrigger>
+ <TooltipContent>{t.description}</TooltipContent>
+ </Tooltip>
);
})}
</div>
diff --git a/apps/web/src/app/not-found.tsx b/apps/web/src/app/not-found.tsx
index 7a318064..e01a2ad4 100644
--- a/apps/web/src/app/not-found.tsx
+++ b/apps/web/src/app/not-found.tsx
@@ -1,5 +1,6 @@
import { Button } from '@repo/ui/components/button';
import Image from 'next/image';
+import Link from 'next/link';
import { getRandomChallenge } from '~/utils/server/get-random-challenge';
export const dynamic = 'force-dynamic';
@@ -37,12 +38,12 @@ export default async function NotFound() {
</div>
{randomChallengeSlug !== null ? (
<div className="flex flex-col gap-4">
- <a href="/explore">
+ <Link href="/explore">
<Button className="w-56" variant="default" size="lg">
Go to explore
</Button>
- </a>
- <a href={`/challenge/${randomChallengeSlug}`}>
+ </Link>
+ <Link href={`/challenge/${randomChallengeSlug}`}>
<Button
variant="outline"
size="lg"
@@ -50,15 +51,15 @@ export default async function NotFound() {
>
I'm feeling lucky
</Button>
- </a>
+ </Link>
</div>
) : (
<div>
- <a href="/">
+ <Link href="/">
<Button variant="default" size="lg">
Go to home
</Button>
- </a>
+ </Link>
</div>
)}
</div>
diff --git a/apps/web/src/app/support/_actions/stripe.ts b/apps/web/src/app/support/_actions/stripe.ts
new file mode 100644
index 00000000..066a4b11
--- /dev/null
+++ b/apps/web/src/app/support/_actions/stripe.ts
@@ -0,0 +1,49 @@
+'use server';
+
+import type { Stripe } from 'stripe';
+
+import { headers } from 'next/headers';
+
+import { CURRENCY } from '../_utils/config';
+import { formatAmountForStripe } from '../_utils/stripe-helpers';
+import { stripe } from '../_utils/stripe';
+
+export async function createCheckoutSession(
+ amount: number,
+): Promise<{ client_secret: string | null; url: string | null }> {
+ const origin: string = headers().get('origin')!;
+
+ const checkoutSession: Stripe.Checkout.Session = await stripe.checkout.sessions.create({
+ mode: 'payment',
+ submit_type: 'donate',
+ line_items: [
+ {
+ quantity: 1,
+ price_data: {
+ currency: CURRENCY,
+ product_data: {
+ name: 'Custom amount donation',
+ },
+ unit_amount: formatAmountForStripe(amount, CURRENCY),
+ },
+ },
+ ],
+ success_url: `${origin}/support/confirmation?session_id={CHECKOUT_SESSION_ID}`,
+ cancel_url: `${origin}/support`,
+ });
+
+ return {
+ client_secret: checkoutSession.client_secret,
+ url: checkoutSession.url,
+ };
+}
+
+export async function createPaymentIntent(data: FormData): Promise<{ client_secret: string }> {
+ const paymentIntent: Stripe.PaymentIntent = await stripe.paymentIntents.create({
+ amount: formatAmountForStripe(Number(data.get('customDonation') as string), CURRENCY),
+ automatic_payment_methods: { enabled: true },
+ currency: CURRENCY,
+ });
+
+ return { client_secret: paymentIntent.client_secret! };
+}
diff --git a/apps/web/src/app/support/_components/checkout-form.tsx b/apps/web/src/app/support/_components/checkout-form.tsx
new file mode 100644
index 00000000..e58a8229
--- /dev/null
+++ b/apps/web/src/app/support/_components/checkout-form.tsx
@@ -0,0 +1,167 @@
+'use client';
+
+import { useEffect, useState } from 'react';
+
+import { zodResolver } from '@hookform/resolvers/zod';
+import { Button } from '@repo/ui/components/button';
+import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@repo/ui/components/card';
+import {
+ Form,
+ FormControl,
+ FormField,
+ FormItem,
+ FormLabel,
+ FormMessage,
+} from '@repo/ui/components/form';
+import { Input } from '@repo/ui/components/input';
+import { Label } from '@repo/ui/components/label';
+import { RadioGroup, RadioGroupItem } from '@repo/ui/components/radio-group';
+import { useForm } from 'react-hook-form';
+import { NumericFormat } from 'react-number-format';
+import { z } from 'zod';
+import { createCheckoutSession } from '../_actions/stripe';
+
+const AMOUNTS = ['5', '10', '25'];
+
+export default function CheckoutForm() {
+ const [isCustomAmount, setIsCustomAmount] = useState(false);
+ const FormSchema = z.object({
+ amount: z.string().refine(
+ (val) => {
+ const number = parseFloat(val);
+
+ if (val === 'custom') {
+ return true;
+ }
+
+ return !isNaN(number) && number > 0;
+ },
+ {
+ message: 'Amount must be a positive number',
+ },
+ ),
+ customAmount: z.string().optional(),
+ });
+
+ const form = useForm<z.infer<typeof FormSchema>>({
+ mode: 'onChange',
+ resolver: zodResolver(FormSchema),
+ defaultValues: {
+ amount: '5',
+ customAmount: '5',
+ },
+ });
+
+ async function onSubmit(data: z.infer<typeof FormSchema>) {
+ const amount = parseFloat(data.amount);
+ const { url } = await createCheckoutSession(amount);
+ window.location.assign(url!);
+ }
+
+ const watchAmount = form.watch('amount');
+
+ // kill me
+ useEffect(() => {
+ if (!isCustomAmount) {
+ return;
+ }
+ form.setValue('amount', form.getValues('customAmount')!);
+ }, [isCustomAmount, form]);
+
+ return (
+ <Card className="h-auto w-full border bg-transparent bg-gradient-to-br from-neutral-50 to-neutral-100 transition hover:border-transparent dark:from-neutral-900/95 dark:to-neutral-950/95">
+ <CardHeader>
+ <CardTitle>Select an amount</CardTitle>
+ </CardHeader>
+ <Form {...form}>
+ <form className="z-10 flex flex-col space-y-4" onSubmit={form.handleSubmit(onSubmit)}>
+ <CardContent className="space-y-4">
+ {Boolean(isCustomAmount) && (
+ <FormField
+ control={form.control}
+ name="customAmount"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>Custom</FormLabel>
+ <FormControl>
+ <NumericFormat
+ {...field}
+ allowNegative={false}
+ defaultValue={field.value}
+ customInput={Input}
+ thousandSeparator=","
+ decimalScale={2}
+ fixedDecimalScale
+ prefix="$"
+ onValueChange={(values) => {
+ field.onChange(values.value);
+ form.setValue('amount', values.value);
+ }}
+ id="customAmount"
+ placeholder="Enter amount"
+ />
+ </FormControl>
+ </FormItem>
+ )}
+ />
+ )}
+ <FormField
+ control={form.control}
+ name="amount"
+ render={({ field }) => (
+ <FormItem>
+ <RadioGroup
+ onValueChange={(value) => {
+ field.onChange(value);
+ setIsCustomAmount(value === 'custom');
+ }}
+ defaultValue={field.value}
+ className="flex flex-wrap gap-2"
+ >
+ {AMOUNTS.map((amount) => (
+ <div key={amount}>
+ <RadioGroupItem
+ value={amount}
+ id={`amount-${amount}`}
+ className="peer sr-only"
+ />
+ <Label
+ htmlFor={`amount-${amount}`}
+ className="peer-data-[state=checked]:bg-primary peer-data-[state=checked]:text-primary-foreground flex cursor-pointer items-center justify-center rounded-md border px-4 py-2 text-sm"
+ >
+ ${amount}
+ </Label>
+ </div>
+ ))}
+ <div>
+ <RadioGroupItem value="custom" id="amount-custom" className="peer sr-only" />
+ <Label
+ htmlFor="amount-custom"
+ className="peer-data-[state=checked]:bg-primary peer-data-[state=checked]:text-primary-foreground flex cursor-pointer items-center justify-center rounded-md border px-4 py-2 text-sm"
+ >
+ Custom
+ </Label>
+ </div>
+ </RadioGroup>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+ </CardContent>
+ <CardFooter>
+ <Button
+ type="submit"
+ variant="secondary"
+ className="border border-slate-400 dark:border-slate-800"
+ >
+ Donate{' '}
+ {Number.isNaN(parseFloat(watchAmount))
+ ? `a valid amount!`
+ : `$${parseFloat(watchAmount).toFixed(2)}`}
+ </Button>
+ </CardFooter>
+ </form>
+ </Form>
+ </Card>
+ );
+}
diff --git a/apps/web/src/app/support/_utils/config.ts b/apps/web/src/app/support/_utils/config.ts
new file mode 100644
index 00000000..7958991f
--- /dev/null
+++ b/apps/web/src/app/support/_utils/config.ts
@@ -0,0 +1 @@
+export const CURRENCY = 'usd';
diff --git a/apps/web/src/app/support/_utils/get-stripejs.ts b/apps/web/src/app/support/_utils/get-stripejs.ts
new file mode 100644
index 00000000..cd7f38b6
--- /dev/null
+++ b/apps/web/src/app/support/_utils/get-stripejs.ts
@@ -0,0 +1,10 @@
+import type { Stripe } from '@stripe/stripe-js';
+import { loadStripe } from '@stripe/stripe-js';
+
+let stripePromise: Promise<Stripe | null>;
+export const getStripe = () => {
+ if (!stripePromise) {
+ stripePromise = loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);
+ }
+ return stripePromise;
+};
diff --git a/apps/web/src/app/support/_utils/stripe-helpers.ts b/apps/web/src/app/support/_utils/stripe-helpers.ts
new file mode 100644
index 00000000..79d927fa
--- /dev/null
+++ b/apps/web/src/app/support/_utils/stripe-helpers.ts
@@ -0,0 +1,24 @@
+export function formatAmountForDisplay(amount: number, currency: string): string {
+ const numberFormat = new Intl.NumberFormat(['en-US'], {
+ style: 'currency',
+ currency,
+ currencyDisplay: 'symbol',
+ });
+ return numberFormat.format(amount);
+}
+
+export function formatAmountForStripe(amount: number, currency: string): number {
+ const numberFormat = new Intl.NumberFormat(['en-US'], {
+ style: 'currency',
+ currency,
+ currencyDisplay: 'symbol',
+ });
+ const parts = numberFormat.formatToParts(amount);
+ let zeroDecimalCurrency = true;
+ for (const part of parts) {
+ if (part.type === 'decimal') {
+ zeroDecimalCurrency = false;
+ }
+ }
+ return zeroDecimalCurrency ? amount : Math.round(amount * 100);
+}
diff --git a/apps/web/src/app/support/_utils/stripe.ts b/apps/web/src/app/support/_utils/stripe.ts
new file mode 100644
index 00000000..1eb6706e
--- /dev/null
+++ b/apps/web/src/app/support/_utils/stripe.ts
@@ -0,0 +1,12 @@
+import 'server-only';
+
+import Stripe from 'stripe';
+
+export const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!, {
+ // https://github.com/stripe/stripe-node#configuration
+ // apiVersion: '2023-10-16',
+ appInfo: {
+ name: 'Typhero',
+ url: 'https://typehero.dev',
+ },
+});
diff --git a/apps/web/src/app/support/confirmation/content.tsx b/apps/web/src/app/support/confirmation/content.tsx
new file mode 100644
index 00000000..9ed692cf
--- /dev/null
+++ b/apps/web/src/app/support/confirmation/content.tsx
@@ -0,0 +1,32 @@
+'use client';
+
+import { useSession } from '@repo/auth/react';
+import { Button } from '@repo/ui/components/button';
+import Link from 'next/link';
+import Confetti from 'react-confetti';
+
+export default function Content() {
+ const { data: session } = useSession();
+
+ const thankYouMessage = session?.user?.name
+ ? `Thank you ${session.user.name} for you donation!`
+ : `Thank you for your support!`;
+
+ return (
+ <>
+ <div className="container flex h-full flex-col items-center justify-center p-4">
+ <h1 className="mb-8 text-4xl font-bold tracking-tight text-neutral-900 dark:text-white">
+ {thankYouMessage}
+ </h1>
+ <div className="flex flex-col gap-4">
+ <Link href="/explore">
+ <Button className="w-56" variant="default" size="lg">
+ Explore Our Challenges
+ </Button>
+ </Link>
+ </div>
+ </div>
+ <Confetti recycle={false} />
+ </>
+ );
+}
diff --git a/apps/web/src/app/support/confirmation/error.tsx b/apps/web/src/app/support/confirmation/error.tsx
new file mode 100644
index 00000000..50e602ca
--- /dev/null
+++ b/apps/web/src/app/support/confirmation/error.tsx
@@ -0,0 +1,5 @@
+'use client';
+
+export default function Error({ error }: { error: Error }) {
+ return <h2>{error.message}</h2>;
+}
diff --git a/apps/web/src/app/support/confirmation/page.tsx b/apps/web/src/app/support/confirmation/page.tsx
new file mode 100644
index 00000000..bb77f3d9
--- /dev/null
+++ b/apps/web/src/app/support/confirmation/page.tsx
@@ -0,0 +1,71 @@
+import type { Stripe } from 'stripe';
+import { stripe } from '../_utils/stripe';
+import { auth } from '~/server/auth';
+import { prisma } from '@repo/db';
+import dynamic from 'next/dynamic';
+
+const ContentNoSSR = dynamic(() => import('./content'), {
+ ssr: false,
+});
+
+export default async function ResultPage({
+ searchParams,
+}: {
+ searchParams: { checkout_id: string };
+}) {
+ if (!searchParams.checkout_id)
+ throw new Error('Please provide a valid session_id (`cs_test_...`)');
+
+ const session = await auth();
+
+ const checkoutSession: Stripe.Checkout.Session = await stripe.checkout.sessions.retrieve(
+ searchParams.checkout_id,
+ {
+ expand: ['line_items', 'payment_intent'],
+ },
+ );
+
+ const paymentIntent = checkoutSession.payment_intent as Stripe.PaymentIntent;
+
+ if (
+ session &&
+ paymentIntent.status === 'succeeded' &&
+ checkoutSession.amount_total &&
+ checkoutSession.amount_total > 0
+ ) {
+ await prisma.user.update({
+ where: { id: session.user.id },
+ data: {
+ donations: {
+ upsert: {
+ where: { stripeCheckoutSessionId: checkoutSession.id },
+ update: {},
+ create: {
+ stripeCheckoutSessionId: checkoutSession.id,
+ amount: checkoutSession.amount_total,
+ },
+ },
+ },
+ roles: {
+ upsert: {
+ where: { role: 'SUPPORTER' },
+ create: { role: 'SUPPORTER' },
+ update: {},
+ },
+ },
+ },
+ });
+ }
+
+ if (paymentIntent.status !== 'succeeded') {
+ return (
+ <div className="container flex h-full flex-col items-center justify-center p-4">
+ <h1 className="mb-8 text-4xl font-bold tracking-tight text-neutral-900 dark:text-white">
+ Something went wrong.
+ </h1>
+ </div>
+ );
+ }
+
+ return <ContentNoSSR />;
+}
diff --git a/apps/web/src/app/support/page.tsx b/apps/web/src/app/support/page.tsx
new file mode 100644
index 00000000..bee1b07a
--- /dev/null
+++ b/apps/web/src/app/support/page.tsx
@@ -0,0 +1,49 @@
+import type { Metadata } from 'next';
+import { auth } from '~/server/auth';
+import { Button } from '@repo/ui/components/button';
+
+export const metadata: Metadata = {
+ title: 'Support the Platform | TypeHero',
+};
+
+export default async function DonatePage() {
+ const session = await auth();
+ return (
+ <div className="container h-full p-4">
+ <div className="max-w-[69ch] text-lg leading-9 text-neutral-600 dark:text-white/50">
+ <p className="mb-6">
+ <span className="text-primary">TypeHero</span> and{' '}
+ <span className="text-red-600">Advent of TypeScript</span> will always be{' '}
+ <span className="font-semibold dark:text-neutral-200">free</span> platforms to use.
+ </p>
+ <p className="mb-6">
+ Contributions will go towards server costs, time spent maintaining the platform, Advent of
+ TypeScript, and future development.
+ </p>
+ {session ? (
+ <p className="mb-6">
+ Since you are logged in you will see a "Supporter" badge appear next to your name on
+ both the TypeHero and Advent of TypeScript platforms.
+ </p>
+ ) : (
+ <p className="mb-6">
+ <span className="font-semibold dark:text-neutral-200">You are not logged in!</span> If
+ you would like to receive "Supporter" badge on both the TypeHero and Advent of
+ TypeScript platforms, please log in, otherise, your donation will be anonymous.
+ </p>
+ )}
+ </div>
+ <Button
+ asChild
+ className="donate-stripe-link-btn group relative hidden w-fit overflow-hidden rounded-xl p-[1px] font-bold transition-all duration-300 md:mr-0 lg:mr-auto dark:block"
+ variant="outline"
+ >
+ <a href="https://donate.stripe.com/test_4gw7wt5DW9yu8Kc144">
+ <span className="inline-flex h-full w-fit items-center gap-2 rounded-xl px-4 py-2 transition-all duration-300 dark:bg-neutral-900 dark:text-white">
+ Click to Donate
+ </span>
+ </a>
+ </Button>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/tracks/_components/enroll-button.tsx b/apps/web/src/app/tracks/_components/enroll-button.tsx
index 1efe29c9..09821f41 100644
--- a/apps/web/src/app/tracks/_components/enroll-button.tsx
+++ b/apps/web/src/app/tracks/_components/enroll-button.tsx
@@ -4,6 +4,7 @@ import { Button } from '@repo/ui/components/button';
import { toast } from '@repo/ui/components/use-toast';
import { useState } from 'react';
import type { enrollUserInTrack, unenrollUserFromTrack } from './track.action';
+import Link from 'next/link';
interface EnrollButtonProps {
action: typeof enrollUserInTrack | typeof unenrollUserFromTrack;
@@ -37,9 +38,9 @@ export function ActionButton({ action, text, trackId, slug }: EnrollButtonProps)
description: (
<p>
You must be logged in to enroll in a track.{' '}
- <a href="/login" className="font-bold underline">
+ <Link href="/login" className="font-bold underline">
Login
- </a>
+ </Link>
</p>
),
})
diff --git a/apps/web/src/components/Navigation/index.tsx b/apps/web/src/components/Navigation/index.tsx
index ea1a1b95..3ba43213 100644
--- a/apps/web/src/components/Navigation/index.tsx
+++ b/apps/web/src/components/Navigation/index.tsx
@@ -131,6 +131,9 @@ export async function Navigation() {
<Suspense>
<Search />
</Suspense>
+ <Link className="donate-btn" href="/support">
+ Support Us
+ </Link>
{session ? <NotificationLink notificationCount={notificationCount} /> : null}
{featureFlags?.enableLogin ? (
<LoginButton isAdminOrMod={isAdminOrMod} session={session} isAdmin={isAdminRole} />
@@ -201,20 +204,20 @@ async function LoginButton({
</a>
) : null}
{isAdminOrMod ? (
- <a className="block" href="/challenge-playground">
+ <Link className="block" href="/challenge-playground">
<DropdownMenuItem className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none dark:hover:bg-neutral-700/50">
<Play className="mr-2 h-4 w-4" />
<span>Challenge Playground</span>
</DropdownMenuItem>
- </a>
+ </Link>
) : null}
{isAdmin ? (
- <a className="block" href="/share">
+ <Link className="block" href="/share">
<DropdownMenuItem className="focus:bg-accent rounded-lg p-2 duration-300 focus:outline-none dark:hover:bg-neutral-700/50">
<ExternalLink className="mr-2 h-4 w-4" />
<span>URL Shortener</span>
</DropdownMenuItem>
- </a>
+ </Link>
) : null}
<DropdownMenuSeparator />
diff --git a/apps/web/src/components/donation-toast.tsx b/apps/web/src/components/donation-toast.tsx
new file mode 100644
index 00000000..c899eb6d
--- /dev/null
+++ b/apps/web/src/components/donation-toast.tsx
@@ -0,0 +1,44 @@
+'use client';
+
+import { X } from '@repo/ui/icons';
+import { useState } from 'react';
+
+export default function WalletConnectBanner() {
+ const [isVisible, setIsVisible] = useState(true);
+
+ if (!isVisible) return null;
+
+ return (
+ <div className="fixed right-4 top-4 w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg transition-all duration-300 ease-in-out">
+ <div className="flex items-start p-4">
+ <div className="mr-4 flex-shrink-0">
+ <svg
+ className="h-10 w-10"
+ viewBox="0 0 40 40"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <rect width="40" height="40" rx="20" fill="#FFA500" />
+ <path
+ d="M20 10C14.48 10 10 14.48 10 20C10 25.52 14.48 30 20 30C25.52 30 30 25.52 30 20C30 14.48 25.52 10 20 10ZM23.5 21.5H20.5V24.5C20.5 25.05 20.05 25.5 19.5 25.5C18.95 25.5 18.5 25.05 18.5 24.5V21.5H15.5C14.95 21.5 14.5 21.05 14.5 20.5C14.5 19.95 14.95 19.5 15.5 19.5H18.5V16.5C18.5 15.95 18.95 15.5 19.5 15.5C20.05 15.5 20.5 15.95 20.5 16.5V19.5H23.5C24.05 19.5 24.5 19.95 24.5 20.5C24.5 21.05 24.05 21.5 23.5 21.5Z"
+ fill="#4CAF50"
+ />
+ </svg>
+ </div>
+ <div className="flex-grow">
+ <h2 className="text-lg font-bold text-gray-900">Connect your wallet</h2>
+ <p className="text-sm text-gray-600">
+ Connect your wallet by clicking the button in the top right corner.
+ </p>
+ </div>
+ <button
+ onClick={() => setIsVisible(false)}
+ className="flex-shrink-0 text-gray-400 transition-colors hover:text-gray-500"
+ aria-label="Close notification"
+ >
+ <X className="h-5 w-5" />
+ </button>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/styles/globals.css b/apps/web/src/styles/globals.css
index a7cae76b..5ea598b6 100644
--- a/apps/web/src/styles/globals.css
+++ b/apps/web/src/styles/globals.css
@@ -281,6 +281,17 @@ main {
animation: gradient-rotate 5s linear infinite reverse;
}
+.donate-stripe-link-btn {
+ background: linear-gradient(
+ var(--gradient-angle),
+ hsla(46, 97%, 65%, 0.5),
+ hsla(46, 97%, 65%, 0.1),
+ hsla(46, 97%, 65%, 1),
+ hsla(46, 97%, 65%, 0.3)
+ ) !important;
+ animation: gradient-rotate 5s linear infinite reverse;
+}
+
.wl-form-button {
background: linear-gradient(var(--gradient-angle), #34d399, #60a5fa, #ff88ff, #ff8844);
animation: gradient-rotate 5s linear infinite reverse;
@@ -754,3 +765,44 @@ a {
body.mobile-nav-active {
overflow: hidden;
}
+
+.donate-btn {
+ border: 1px solid #bea74b;
+ color: white;
+ font-size: 1rem;
+ padding: 0.4rem 1.25rem;
+ border-radius: 1.1rem;
+ overflow: hidden;
+ position: relative;
+}
+
+.donate-btn:before {
+ content: '';
+ background: #ffffff80;
+ filter: blur(8px);
+ width: 150%;
+ height: 1rem;
+ position: absolute;
+ top: 50%;
+ transform: rotate(-30deg) translateX(-100%) translateY(-25%);
+ opacity: 0;
+}
+
+.donate-btn:hover:before {
+ animation: shimmer 1.69s linear infinite;
+}
+
+@keyframes shimmer {
+ 0% {
+ opacity: 1;
+ transform: translateX(-100%) translateY(0rem) rotate(-30deg);
+ }
+ 42% {
+ opacity: 1;
+ transform: translateX(0%) translateY(0rem) rotate(-30deg);
+ }
+ 69% {
+ opacity: 0;
+ transform: translateX(100%) translateY(-1rem) rotate(-30deg);
+ }
+}
diff --git a/packages/db/schema.prisma b/packages/db/schema.prisma
index fcd1033d..7fd9b5f5 100644
--- a/packages/db/schema.prisma
+++ b/packages/db/schema.prisma
@@ -143,6 +143,7 @@ model User {
imageUpload ImageUpload[]
tracks Track[]
BetaTokens BetaTokens[]
+ donations Donation[]
shortUrls ShortURL[]
toUserNotification Notification[] @relation("notificationToUser")
fromUserNotification Notification[] @relation("notificationFromUser")
@@ -436,6 +437,17 @@ model BetaTokens {
@@index([userId])
}
+model Donation {
+ id Int @id @default(autoincrement())
+ user User @relation(fields: [userId], references: [id])
+ userId String
+ amount Int
+ stripeCheckoutSessionId String @unique
+ createdAt DateTime? @default(now())
+
+ @@index([userId])
+}
+
model Notification {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
@@ -467,19 +479,19 @@ model Notification {
}
model ShortURL {
- id Int @id @default(autoincrement())
+ id Int @id @default(autoincrement())
/// the original full url that we want to shorten e.g. https://www.url.com
- originalUrl String @db.MediumText
+ originalUrl String @db.MediumText
/// slug for the short url e.g. url.com/[shortUrlSlug]
- shortUrlSlug String @unique
- createdAt DateTime @default(now())
+ shortUrlSlug String @unique
+ createdAt DateTime @default(now())
/// the time the short url will expire
expiresAt DateTime?
/// the number of times the short url has redirected to the original url
- clicks Int @default(0)
+ clicks Int @default(0)
userId String?
- user User? @relation(fields: [userId], references: [id])
+ user User? @relation(fields: [userId], references: [id])
@@index([userId])
@@index([shortUrlSlug])
-}
\ No newline at end of file
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4b432a53..32db1e2f 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -91,10 +91,10 @@ importers:
version: 2.6.0-beta.12
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -158,7 +158,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
- version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -197,10 +197,10 @@ importers:
version: 2.0.0
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
@@ -307,7 +307,7 @@ importers:
version: 1.0.0
next:
specifier: 14.2.5
react:
specifier: 18.2.0
version: 18.2.0
@@ -383,7 +383,13 @@ importers:
version: link:../../packages/ui
'@sentry/nextjs':
specifier: ^7.73.0
+ '@stripe/react-stripe-js':
+ specifier: ^2.8.0
+ '@stripe/stripe-js':
+ specifier: ^4.6.0
+ version: 4.7.0
'@t3-oss/env-nextjs':
specifier: ^0.6.0
@@ -401,7 +407,7 @@ importers:
'@uploadthing/react':
specifier: ^6.2.2
'@vercel/analytics':
specifier: ^1.1.1
version: 1.1.1
@@ -410,10 +416,10 @@ importers:
version: 0.2.1
'@vercel/speed-insights':
specifier: ^1.0.12
'@vercel/toolbar':
specifier: ^0.1.18
algoliasearch:
specifier: ^4.20.0
version: 4.20.0
@@ -449,13 +455,16 @@ importers:
version: 5.0.7
next:
specifier: 14.2.5
next-themes:
specifier: ^0.2.1
react:
specifier: 18.2.0
version: 18.2.0
+ react-confetti:
+ specifier: ^6.1.0
+ version: 6.1.0([email protected])
react-day-picker:
specifier: ^8.8.0
@@ -476,13 +485,16 @@ importers:
react-instantsearch-nextjs:
specifier: ^0.1.5
react-intersection-observer:
specifier: ^9.5.2
version: 9.5.2([email protected])
react-markdown:
specifier: ^8.0.7
version: 8.0.7(@types/[email protected])([email protected])
+ react-number-format:
+ specifier: ^5.4.2
react-select:
specifier: ^5.7.4
@@ -498,6 +510,12 @@ importers:
resend:
specifier: ^0.17.2
version: 0.17.2
+ server-only:
+ specifier: ^0.0.1
+ version: 0.0.1
+ stripe:
+ specifier: ^17.1.0
+ version: 17.1.0
superjson:
specifier: ^2.2.1
version: 2.2.1
@@ -564,7 +582,7 @@ importers:
eslint-plugin-import:
specifier: ^2.27.5
- version: 2.27.5([email protected])
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -881,7 +899,7 @@ importers:
dependencies:
'@next/eslint-plugin-next':
specifier: canary
- version: 15.0.0-canary.139
+ version: 15.0.0-canary.181
'@repo/tsconfig':
specifier: workspace:*
version: link:../config-typescript
@@ -893,7 +911,7 @@ importers:
'@vercel/style-guide':
specifier: ^4.0.2
eslint:
specifier: ^8.45.0
version: 8.45.0
@@ -1975,8 +1993,8 @@ packages:
resolution: {integrity: sha512-YJqyq6vk39JQfvaNtN83t/p5Jy45+bazRL+V4QI8FPd3FBqFYMEsULiwRLgSJMgFqkk4t4JbeZurz+gILEAFpA==}
- resolution: {integrity: sha512-ghqijxdELk+ngJQ5px60Z74RrstkYOwEyDcf9JK+IwHDij6KJ9V5dhKuqU6C5PwpzPj/gdtPC8j27MbJ+s59/g==}
+ resolution: {integrity: sha512-SsF47gljH574N8RKsMBbSh33v2LU3FN78TyHWnFcd6S/I75FErA3mJGKEYxLTb8gMqSU0GCIXTcAi7Lo4h6S+g==}
resolution: {integrity: sha512-/9zVxJ+K9lrzSGli1///ujyRfon/ZneeZ+v4ptpiPoOU+GKZnm8Wj8ELWU1Pm7GHltYRBklmXMTUqM/DqQ99FQ==}
@@ -2243,6 +2261,7 @@ packages:
'@playwright/[email protected]':
resolution: {integrity: sha512-xis/RXXsLxwThKnlIXouxmIvvT3zvQj1JE39GsNieMUrMpb3/GySHDh2j8itCG22qKVD4MYLBp7xB73cUW/UUw==}
engines: {node: '>=16'}
+ deprecated: Please update to the latest version of Playwright to test up-to-date browsers.
hasBin: true
@@ -3302,6 +3321,17 @@ packages:
resolution: {integrity: sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==}
engines: {node: '>=18'}
+ '@stripe/[email protected]':
+ resolution: {integrity: sha512-C410jVKOATinXLalWotab6E6jlWAlbqUDWL9q1km0p5UHrvnihjjYzA8imYXc4xc4Euf9GeKDQc4n35HKZvgwg==}
+ peerDependencies:
+ '@stripe/stripe-js': ^1.44.1 || ^2.0.0 || ^3.0.0 || ^4.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+
+ '@stripe/[email protected]':
+ resolution: {integrity: sha512-Dfdg8UumBu+zDnBgGw30zEE9PIm8lunDUuwy2Bois9bb2sxCohVbD1PpAnasPIZhYfIbigmTHEr/Hg+56Vue6A==}
+ engines: {node: '>=12.16'}
+
resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==}
@@ -5070,11 +5100,13 @@ packages:
resolution: {integrity: sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
hasBin: true
resolution: {integrity: sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
+ deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.
hasBin: true
@@ -7009,6 +7041,12 @@ packages:
resolution: {integrity: sha512-lNeOl38Ws0eNxpO3+wD1I9rkHGQyj1NU1jlzv4go2CtEnEQEUfqnIvZG7W+bC/aXdJ27n5x/yUjb6RoT9tko+Q==}
+ resolution: {integrity: sha512-7Ypx4vz0+g8ECVxr88W9zhcQpbeujJAVqL14ZnXJ3I23mOI9/oBVTQ3dkJhUmB0D6XOtCZEM6N0Gm9PMngkORw==}
+ engines: {node: '>=10.18'}
+ peerDependencies:
+ react: ^16.3.0 || ^17.0.1 || ^18.0.0
+
resolution: {integrity: sha512-QIC3uOuyGGbtypbd5QEggsCSqVaPNu8kzUWquZ7JjW9fuWB9yv7WyixKmnaFelTLXFdq7h7zU6n/aBleBqe/dA==}
peerDependencies:
@@ -7085,6 +7123,12 @@ packages:
'@types/react': '>=16'
react: '>=16'
+ resolution: {integrity: sha512-cg//jVdS49PYDgmcYoBnMMHl4XNTMuV723ZnHD2aXYtWWWqbVF3hjQ8iB+UZEuXapLbeA8P8H+1o6ZB1lcw3vg==}
+ peerDependencies:
+ react: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
+ react-dom: ^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0
+
resolution: {integrity: sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A==}
engines: {node: '>=10'}
@@ -7600,6 +7644,10 @@ packages:
resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==}
+ resolution: {integrity: sha512-sNRsJx7LPP2Gg6cBJoHJqhr+UoBVZZRes2BDqbrg+1FDBxJc4Yn+LkrpJ/VnL3XQ3+6I5GrOUnSSFfE/joDFjw==}
+ engines: {node: '>=12.*'}
+
resolution: {integrity: sha512-HFpbb5gr2ypci7Qw+IOhnP2zOU7e77b+rzM+wTzXzfi1PrtBCX0E7Pk4wL4iTLnhzZ+JgEGAhX81ebTg/aYjQw==}
@@ -7627,7 +7675,7 @@ packages:
resolution: {integrity: sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==}
engines: {node: '>= 4.0'}
- deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net
+ deprecated: Please upgrade to v7.0.2+ of superagent. We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing. See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.
resolution: {integrity: sha512-8iGv75BYOa0xRJHK5vRLEjE2H/i4lulTjzpUXic3Eg8akftYjkmQDa8JARQ42rlczXyFR3IeRoeFCc7RxHsYZA==}
@@ -7825,6 +7873,9 @@ packages:
resolution: {integrity: sha512-8s2KwqjwQj7z8Z53SUZSKVkQOZ2/Sl4D2F440oaBY/k2lGju60dW6srEpnn8/RIDeICZmQn3pQHF79Jfnc5Skw==}
hasBin: true
+ resolution: {integrity: sha512-PZBtLYcCLtEcjL14Fzb1gSxPBeL7nWvGhO5ZFPGqziCcr8uvHp0NDmdjBchp6KHL+tExcg0m3NISmKxhU394dA==}
+
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'}
@@ -9257,7 +9308,7 @@ snapshots:
dependencies:
glob: 7.1.7
dependencies:
fast-glob: 3.3.1
@@ -10684,7 +10735,7 @@ snapshots:
localforage: 1.10.0
tslib: 2.6.0
dependencies:
'@rollup/plugin-commonjs': 24.0.0([email protected])
'@sentry/core': 7.73.0
@@ -10696,7 +10747,7 @@ snapshots:
'@sentry/vercel-edge': 7.73.0
'@sentry/webpack-plugin': 1.20.0
chalk: 3.0.0
react: 18.2.0
rollup: 2.78.0
stacktrace-parser: 0.1.10
@@ -10766,6 +10817,15 @@ snapshots:
'@sindresorhus/[email protected]': {}
+ dependencies:
+ '@stripe/stripe-js': 4.7.0
+ prop-types: 15.8.1
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
+ '@stripe/[email protected]': {}
+
'@swc/[email protected]': {}
@@ -11198,7 +11258,7 @@ snapshots:
'@uploadthing/[email protected]': {}
dependencies:
'@uploadthing/dropzone': 0.1.1
'@uploadthing/shared': 6.2.0(@uploadthing/[email protected])
@@ -11208,7 +11268,7 @@ snapshots:
tailwind-merge: 1.14.0
uploadthing: 6.3.1
optionalDependencies:
transitivePeerDependencies:
- '@uploadthing/mime-types'
@@ -11251,12 +11311,12 @@ snapshots:
satori: 0.0.46
yoga-wasm-web: 0.3.0
optionalDependencies:
react: 18.2.0
dependencies:
'@babel/core': 7.22.10
'@babel/eslint-parser': 7.22.10(@babel/[email protected])([email protected])
@@ -11264,7 +11324,7 @@ snapshots:
'@typescript-eslint/eslint-plugin': 5.59.1(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint-config-prettier: 8.10.0([email protected])
+ eslint-import-resolver-alias: 1.1.2([email protected](@typescript-eslint/[email protected]([email protected])([email protected]))([email protected]))
eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])
eslint-plugin-eslint-comments: 3.2.0([email protected])
@@ -11278,7 +11338,7 @@ snapshots:
eslint-plugin-unicorn: 43.0.2([email protected])
prettier-plugin-packagejson: 2.4.3([email protected])
optionalDependencies:
- '@next/eslint-plugin-next': 15.0.0-canary.139
+ '@next/eslint-plugin-next': 15.0.0-canary.181
eslint: 8.45.0
prettier: 3.1.1
typescript: 5.3.3
@@ -11288,7 +11348,7 @@ snapshots:
- jest
- supports-color
dependencies:
'@tinyhttp/app': 1.3.0
chokidar: 3.5.3
@@ -11297,7 +11357,7 @@ snapshots:
get-port: 5.1.1
strip-ansi: 6.0.1
optionalDependencies:
react: 18.2.0
'@vitest/[email protected]':
@@ -12531,8 +12591,8 @@ snapshots:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
eslint-plugin-jsx-a11y: 6.7.1([email protected])
eslint-plugin-react: 7.32.2([email protected])
eslint-plugin-react-hooks: 5.0.0-canary-7118f5dd7-20230705([email protected])
@@ -12569,7 +12629,7 @@ snapshots:
eslint: 8.45.0
eslint-plugin-turbo: 2.0.12([email protected])
dependencies:
@@ -12581,13 +12641,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
dependencies:
debug: 4.3.4
enhanced-resolve: 5.15.0
eslint: 8.45.0
- eslint-plugin-import: 2.27.5([email protected])
get-tsconfig: 4.6.2
globby: 13.2.2
is-core-module: 2.12.1
@@ -12635,14 +12695,14 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
dependencies:
debug: 3.2.7
optionalDependencies:
'@typescript-eslint/parser': 5.62.0([email protected])([email protected])
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
+ eslint-import-resolver-typescript: 3.5.5(@typescript-eslint/[email protected]([email protected])([email protected]))([email protected])([email protected])([email protected])
transitivePeerDependencies:
- supports-color
@@ -12674,31 +12734,6 @@ snapshots:
eslint: 8.45.0
ignore: 5.2.4
- dependencies:
- array-includes: 3.1.6
- array.prototype.flat: 1.3.1
- array.prototype.flatmap: 1.3.1
- debug: 3.2.7
- doctrine: 2.1.0
- eslint: 8.45.0
- eslint-import-resolver-node: 0.3.7
- has: 1.0.3
- is-core-module: 2.12.1
- is-glob: 4.0.3
- minimatch: 3.1.2
- object.values: 1.1.6
- resolve: 1.22.2
- semver: 6.3.1
- tsconfig-paths: 3.14.2
- optionalDependencies:
- '@typescript-eslint/parser': 5.62.0([email protected])([email protected])
- transitivePeerDependencies:
- - eslint-import-resolver-typescript
- - eslint-import-resolver-webpack
- - supports-color
-
dependencies:
array-includes: 3.1.6
@@ -12708,7 +12743,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.45.0
eslint-import-resolver-node: 0.3.7
has: 1.0.3
is-core-module: 2.12.1
is-glob: 4.0.3
@@ -12749,29 +12784,6 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
- dependencies:
- array-includes: 3.1.6
- array.prototype.flat: 1.3.1
- array.prototype.flatmap: 1.3.1
- debug: 3.2.7
- doctrine: 2.1.0
- eslint: 8.45.0
- eslint-import-resolver-node: 0.3.7
- has: 1.0.3
- is-core-module: 2.12.1
- is-glob: 4.0.3
- minimatch: 3.1.2
- object.values: 1.1.6
- resolve: 1.22.2
- semver: 6.3.1
- tsconfig-paths: 3.14.2
- transitivePeerDependencies:
- - eslint-import-resolver-typescript
- - eslint-import-resolver-webpack
- - supports-color
-
dependencies:
'@typescript-eslint/utils': 5.59.1([email protected])([email protected])
@@ -14641,15 +14653,15 @@ snapshots:
react: 18.3.1
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
dependencies:
react: 18.2.0
react-dom: 18.2.0([email protected])
@@ -14659,7 +14671,7 @@ snapshots:
react: 18.2.0
react-dom: 18.3.1([email protected])
dependencies:
'@next/env': 14.2.5
'@swc/helpers': 0.5.5
@@ -14680,11 +14692,12 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.5
'@next/swc-win32-ia32-msvc': 14.2.5
'@next/swc-win32-x64-msvc': 14.2.5
+ '@playwright/test': 1.38.0
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
dependencies:
'@next/env': 14.2.5
'@swc/helpers': 0.5.5
@@ -14705,7 +14718,6 @@ snapshots:
'@next/swc-win32-arm64-msvc': 14.2.5
'@next/swc-win32-ia32-msvc': 14.2.5
'@next/swc-win32-x64-msvc': 14.2.5
- '@playwright/test': 1.38.0
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
@@ -15305,6 +15317,11 @@ snapshots:
destr: 2.0.2
flat: 5.0.2
+ dependencies:
+ react: 18.2.0
+ tween-functions: 1.2.0
+
dependencies:
date-fns: 2.30.0
@@ -15357,9 +15374,9 @@ snapshots:
react: 18.2.0
use-sync-external-store: 1.2.0([email protected])
dependencies:
@@ -15401,6 +15418,11 @@ snapshots:
transitivePeerDependencies:
- supports-color
+ dependencies:
+ react: 18.2.0
+ react-dom: 18.2.0([email protected])
+
dependencies:
react: 18.2.0
@@ -16040,6 +16062,11 @@ snapshots:
dependencies:
acorn: 8.10.0
+ dependencies:
+ '@types/node': 20.10.4
+ qs: 6.11.2
+
dependencies:
inline-style-parser: 0.1.1
@@ -16287,6 +16314,8 @@ snapshots:
turbo-windows-64: 2.0.12
turbo-windows-arm64: 2.0.12
+
dependencies:
prelude-ls: 1.2.1
diff --git a/turbo.json b/turbo.json
index e58a113e..8fde9ae7 100644
--- a/turbo.json
+++ b/turbo.json
@@ -1,5 +1,5 @@
{
- "globalEnv": ["NEXT_PUBLIC_ALGOLIA_APP_ID", "NEXT_PUBLIC_ALGOLIA_API_KEY"],
+ "globalEnv": ["DATABASE_URL"],
"tasks": {
"build": {
"dependsOn": ["^build", "@repo/db#db:generate"],
@@ -34,7 +34,9 @@
"MAILCHIMP_AUDIENCE_ID",
"MAILCHIMP_API_SERVER",
"NEXT_PUBLIC_ALGOLIA_API_KEY",
- "NEXT_PUBLIC_ALGOLIA_APP_ID"
+ "NEXT_PUBLIC_ALGOLIA_APP_ID",
+ "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY",
+ "STRIPE_SECRET_KEY"
]
},
"topo": {