This document explains the environment variables required for GitAura application.
- Copy
env.exampleto.env.local - Fill in your values (see sections below)
- Run
npm run devto start
# Option A: Postgres (e.g. NeonDB) for prod-like
DATABASE_URL="postgresql://username:password@ep-xxx-xxx-xxx.region.aws.neon.tech/database?sslmode=require"
# Option B: Local dev with SQLite (Prisma 6+)
# Uncomment to use local file DB
# DATABASE_URL="prisma://file:./dev.db"How to get NeonDB URL:
- Go to neon.tech and create account
- Create new project
- Copy the connection string from dashboard
- Replace
[YOUR-PASSWORD]with your actual password
# GitHub Personal Access Token
GITHUB_TOKEN=ghp_your_github_personal_access_token_hereHow to create GitHub token:
- Go to GitHub Settings > Developer settings > Personal access tokens
- Click "Generate new token (classic)"
- Select scopes:
public_repo,user:read - Copy the token immediately
# ImgBB API Key for image uploads
IMGBB_API_KEY=your_imgbb_api_key_hereHow to get ImgBB key:
- Go to imgbb.com and create account
- Go to API section in settings
- Copy your API key
# Clerk Authentication Keys
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_clerk_publishable_key
CLERK_SECRET_KEY=sk_test_your_clerk_secret_key
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=/How to setup Clerk:
- Go to clerk.com and create account
- Create new application
- Enable GitHub OAuth provider
- Copy the keys from dashboard
# Your app URL (for internal API calls)
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# Cron job secret (for automated tasks)
CRON_SECRET=your-secure-random-string-hereGITHUB_TOKEN- Never exposed to clientIMGBB_API_KEY- Never exposed to clientCLERK_SECRET_KEY- Never exposed to clientCRON_SECRET- Never exposed to client
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- Safe to exposeNEXT_PUBLIC_BASE_URL- Safe to expose
After setting up your DB:
# Generate Prisma client
npx prisma generate
# Push schema to database (creates tables)
npx prisma db push
# (Optional) View your data
npx prisma studio-
Test Database Connection:
npx prisma db push
-
Test GitHub API:
curl "http://localhost:3000/api/github/test-token" -
Test Clerk Auth:
- Visit
/sign-inpage - Try signing in with GitHub
- Visit
- For Prisma 6+ with serverless bundlers, use
prisma://...orprisma+postgres://...URLs - For local SQLite, prefer
DATABASE_URL="prisma://file:./dev.db" - For Neon Postgres, keep
postgresql://...during dev plus runnpx prisma generate
- Check your
DATABASE_URLformat and credentials - Ensure your database is reachable
- Add
GITHUB_TOKENto increase limits - Check token has correct scopes
- Verify Clerk keys are correct
- Check GitHub OAuth is enabled in Clerk
- Ensure redirect URLs are set correctly
# Database
DATABASE_URL="postgresql://john:password123@ep-cool-name-123456.us-east-1.aws.neon.tech/gitaura?sslmode=require"
# GitHub API
GITHUB_TOKEN=ghp_1234567890abcdef1234567890abcdef12345678
# Image Upload
IMGBB_API_KEY=1234567890abcdef1234567890abcdef
# Clerk Auth
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_1234567890abcdef
CLERK_SECRET_KEY=sk_test_1234567890abcdef
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=/
# App Config
NEXT_PUBLIC_BASE_URL=http://localhost:3000
CRON_SECRET=my-super-secret-cron-key-123- Check browser console for errors
- Verify all environment variables are set
- Test each service individually
- Create an issue on GitHub with error details