diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..b6b2ba69 --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +# Authentication +CLERK_SECRET_KEY= +NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY= + +# Upstash Redis +UPSTASH_REDIS_REST_URL= +UPSTASH_REDIS_REST_TOKEN= \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b4f5c08..9fb1b627 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,21 @@ jobs: main-ci: runs-on: ubuntu-latest + environment: CI + env: + # Clerk + NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY: ${{ secrets.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY }} + CLERK_SECRET_KEY: ${{ secrets.CLERK_SECRET_KEY }} + + NEXT_PUBLIC_CLERK_SIGN_IN_URL: '/sign-in' + NEXT_PUBLIC_CLERK_SIGN_UP_URL: '/sign-up' + NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL: '/app' + NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL: '/app' + + # Upstash + UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }} + UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }} + steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/bun.lockb b/bun.lockb index 904b8e8e..efe37bf4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/cspell.config.yaml b/cspell.config.yaml index 53d2b865..b3f69858 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -29,11 +29,15 @@ words: - nextjs - packagejson - Posthog + - ratelimit - Registrator - serviceworker - Shadcn + - Signin + - Signup - tailwindcss - tanstack + - trpc - tsbuildinfo - tseslint - typecheck diff --git a/package.json b/package.json index e6f2c5e9..b40feb87 100644 --- a/package.json +++ b/package.json @@ -45,10 +45,13 @@ } }, "dependencies": { + "@clerk/nextjs": "^5.0.12", + "@clerk/themes": "^2.1.6", "@radix-ui/colors": "^3.0.0", "@radix-ui/react-navigation-menu": "^1.1.4", "@radix-ui/react-slot": "^1.0.2", "@t3-oss/env-nextjs": "^0.10.1", + "@upstash/redis": "^1.31.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", "geist": "^1.3.0", @@ -76,7 +79,6 @@ "@playwright/test": "^1.44.0", "@tailwindcss/aspect-ratio": "^0.4.2", "@tailwindcss/container-queries": "^0.1.1", - "@tailwindcss/forms": "^0.5.7", "@tailwindcss/typography": "^0.5.13", "@testing-library/jest-dom": "^6.4.5", "@testing-library/react": "^15.0.7", diff --git a/src/app/(auth)/sign-in/[[...sign-in]]/page.tsx b/src/app/(auth)/sign-in/[[...sign-in]]/page.tsx new file mode 100644 index 00000000..59ef1e03 --- /dev/null +++ b/src/app/(auth)/sign-in/[[...sign-in]]/page.tsx @@ -0,0 +1,14 @@ +import { SignIn } from '@clerk/nextjs'; + +/** + * The Signin page component. + * + * @returns The signin page. + */ +export default function Page() { + return ( +
+ +
+ ); +} diff --git a/src/app/(auth)/sign-up/[[...sign-in]]/page.tsx b/src/app/(auth)/sign-up/[[...sign-in]]/page.tsx new file mode 100644 index 00000000..db45e271 --- /dev/null +++ b/src/app/(auth)/sign-up/[[...sign-in]]/page.tsx @@ -0,0 +1,14 @@ +import { SignUp } from '@clerk/nextjs'; + +/** + * The Signup page component. + * + * @returns The signup page. + */ +export default function Page() { + return ( +
+ +
+ ); +} diff --git a/src/app/(dashboard)/app/page.tsx b/src/app/(dashboard)/app/page.tsx new file mode 100644 index 00000000..969938ee --- /dev/null +++ b/src/app/(dashboard)/app/page.tsx @@ -0,0 +1,15 @@ +import { SignOutButton } from '@clerk/nextjs'; + +/** + * This is the main page for the dashboard. + * + * @returns A Next.js RSC page component. + */ +export default function DashboardHome() { + return ( +
+

Hello World

+ +
+ ); +} diff --git a/src/app/(marketing)/page.tsx b/src/app/(marketing)/page.tsx index b288fba4..d0f1710c 100644 --- a/src/app/(marketing)/page.tsx +++ b/src/app/(marketing)/page.tsx @@ -1,5 +1,7 @@ import Link from 'next/link'; +import { redirect } from 'next/navigation'; +import { currentUser } from '@clerk/nextjs/server'; import { ChevronRightIcon, StarIcon } from 'lucide-react'; import { constants } from '@/constants'; @@ -12,7 +14,11 @@ import { HomePreview } from './_components/home-preview'; * * @returns A react component representing the marketing home page. */ -export default function Home() { +export default async function Home() { + const session = await currentUser(); + + if (session) redirect('/app'); + return (