A Next.js site with Clerk authentication for user accounts.
npm install- Go to Clerk Dashboard
- Create a new application (or use existing)
- Go to Configure → API Keys
- Copy your keys
Create a .env.local file in the root directory:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_YOUR_KEY_HERE
CLERK_SECRET_KEY=sk_test_YOUR_KEY_HERE
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/npm run devprax-nextjs/
├── app/
│ ├── layout.tsx # Root layout with Clerk + Navigation
│ ├── page.tsx # Homepage with systems library
│ ├── globals.css # Global styles
│ ├── vault/page.tsx # Protected Pro Vault (requires login)
│ ├── agencies/page.tsx # For Agencies landing page
│ ├── partners/page.tsx # Partner program page
│ ├── bounties/page.tsx # Bounty board
│ ├── submit/page.tsx # Submit a system
│ ├── about/page.tsx # About page
│ ├── privacy/page.tsx # Privacy policy
│ ├── terms/page.tsx # Terms of service
│ ├── sign-in/[[...sign-in]]/page.tsx
│ └── sign-up/[[...sign-up]]/page.tsx
├── middleware.ts # Clerk middleware (protects /vault)
├── .env.example # Example environment variables
├── .env.local # Your actual keys (DO NOT COMMIT)
├── package.json
├── tsconfig.json
└── next.config.ts
The /vault page is protected by Clerk. Users must sign in to access it.
To add more protected routes, edit middleware.ts:
const isProtectedRoute = createRouteMatcher([
'/vault(.*)',
'/dashboard(.*)', // Add more routes here
])- Push this code to a GitHub repository
- Go to Vercel
- Import your repository
- Add environment variables in Vercel dashboard
- Deploy!
npm i -g vercel
vercelAdd these in Vercel Dashboard → Settings → Environment Variables:
| Variable | Value |
|---|---|
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY |
pk_live_xxx or pk_test_xxx |
CLERK_SECRET_KEY |
sk_live_xxx or sk_test_xxx |
NEXT_PUBLIC_CLERK_SIGN_IN_URL |
/sign-in |
NEXT_PUBLIC_CLERK_SIGN_UP_URL |
/sign-up |
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL |
/ |
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL |
/ |
Clerk provides customizable components. See Clerk Docs.
- Create a new folder in
app/ - Add a
page.tsxfile - Export a default component
Edit app/globals.css - all CSS variables are at the top.
- Email: hello@prax.digital
- Twitter: @PraxDigital