Quick setup
Create a.env.local file in your project root with the following variables:
.env.local
Required variables
Clerk authentication
Clerk provides authentication and user management for Wrkks.Your Clerk publishable key. This is safe to expose in client-side code.How to get it:
- Go to Clerk Dashboard
- Select your application
- Navigate to API Keys
- Copy the Publishable key
Your Clerk secret key. Keep this secret and never expose it in client-side code.How to get it:
- Go to Clerk Dashboard
- Select your application
- Navigate to API Keys
- Copy the Secret key
Clerk environment variables are automatically detected by the
@clerk/nextjs package. Make sure to use the exact naming convention shown above.Supabase database
Supabase provides the PostgreSQL database for storing user data and resumes.Your Supabase project URL. This is safe to expose in client-side code.Format:
https://your-project-id.supabase.coHow to get it:- Go to Supabase Dashboard
- Select your project
- Navigate to Settings → API
- Copy the Project URL
Your Supabase anonymous/public key. This is safe to expose in client-side code and is used for Row Level Security.How to get it:
- Go to Supabase Dashboard
- Select your project
- Navigate to Settings → API
- Copy the anon public key
OpenRouter AI
OpenRouter provides AI models for parsing resume content from PDFs.Your OpenRouter API key for accessing AI models.How to get it:
- Go to OpenRouter
- Sign up or log in
- Navigate to API Keys
- Create a new API key
- Add credits to your account
The AI model to use for resume parsing.Recommended values:
openai/gpt-4o-mini- Fast and cost-effective (recommended)openai/gpt-4o- More accurate but slower and more expensiveanthropic/claude-3.5-sonnet- Alternative high-quality option
openai/gpt-4o-miniThe resume parsing uses JSON mode with
temperature: 0 for consistent, structured output. Choose a model that supports JSON response format.Application URL
The base URL of your application. Used for generating share links and API calls.Examples:
- Development:
http://localhost:3000 - Production:
https://wrkks.siteor your custom domain
https://wrkks.site (if not set)Setting environment variables
Local development
For local development, create a.env.local file in your project root:
Vercel
Open project settings
Navigate to your project in the Vercel Dashboard and go to Settings → Environment Variables.
Add variables one by one
Add each environment variable with its corresponding value. Make sure to select the appropriate environments (Production, Preview, Development).
Or upload .env file
Alternatively, you can paste all variables at once using the “Paste .env” option in the environment variables section.
Other platforms
For other hosting platforms, refer to their documentation:- Netlify: Environment variables in Site settings → Build & deploy → Environment
- Railway: Environment variables in the Variables tab of your service
- Render: Environment variables in Environment section of your web service
Variable usage in code
Here’s where each environment variable is used in the codebase:Clerk variables
Used by@clerk/nextjs package automatically:
app/layout.tsx:4- ClerkProvider wrappercomponents/SyncUser.tsx:4- User synchronization
Supabase variables
Used in Supabase client initialization:lib/supabase/client.ts:3-4- Browser clientlib/supabase/server.ts:8-9- Server clientlib/supabase/middleware.ts:4-5- Middleware client
OpenRouter variables
Used in AI parsing:app/api/extract-info/route.ts:6- API keyapp/api/extract-info/route.ts:85- Model name
Base URL variable
Used in:app/layout.tsx:25- Site metadatalib/supabase/user/getShareUrl.ts:7- Share link generationlib/server/actions.ts:10,28- Internal API calls
Security best practices
Use different keys for development and production
Always use separate API keys and database instances for development and production environments.
Rotate keys regularly
Periodically rotate your API keys, especially if you suspect they may have been compromised.
Limit key permissions
Use the least privileged keys possible. For Supabase, always use the
anon key, not the service_role key in client-side code.Troubleshooting
”Invalid API key” errors
- Verify the environment variable name is spelled correctly (check for typos)
- Ensure there are no extra spaces or quotes around the key value
- Confirm the key is valid by testing it in the provider’s dashboard
”Cannot read properties of undefined”
- Make sure all required environment variables are set
- Restart your development server after adding new variables
- Check that variables prefixed with
NEXT_PUBLIC_are available in the browser
Changes not taking effect
- Restart your Next.js development server (
npm run dev) - For production, trigger a new deployment after changing environment variables
- Clear your browser cache and cookies
Next steps
Database setup
Configure your Supabase database with the required schema