Skip to content

Commit 1e046a2

Browse files
committed
docs: improve .env.example with GitHub OAuth setup guide
- Add clear section headers for organization - Document GitHub OAuth setup for repo import feature - Explain separation from Supabase login OAuth - Add instructions for dev vs production setup
1 parent 729059f commit 1e046a2

1 file changed

Lines changed: 61 additions & 12 deletions

File tree

backend/.env.example

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,88 @@
1-
# API Keys
1+
# =============================================================================
2+
# OpenCodeIntel Backend Environment Variables
3+
# =============================================================================
4+
5+
# -----------------------------------------------------------------------------
6+
# AI & Search APIs
7+
# -----------------------------------------------------------------------------
8+
9+
# OpenAI - for embeddings and AI features
210
OPENAI_API_KEY=your_openai_api_key_here
11+
12+
# Pinecone - vector database for semantic search
313
PINECONE_API_KEY=your_pinecone_api_key_here
414
PINECONE_INDEX_NAME=codeintel
515

6-
# Search V2 - Cohere Reranking (optional but recommended)
16+
# Cohere - reranking for search quality (optional but recommended)
717
COHERE_API_KEY=your_cohere_api_key_here
818

9-
# Supabase
19+
# Voyage AI - code-specific embeddings (recommended for code search)
20+
# Get API key from https://dash.voyageai.com/
21+
VOYAGE_API_KEY=your_voyage_api_key_here
22+
23+
# -----------------------------------------------------------------------------
24+
# Supabase - Authentication & Database
25+
# -----------------------------------------------------------------------------
26+
1027
SUPABASE_URL=https://your-project.supabase.co
1128
SUPABASE_ANON_KEY=your_supabase_anon_key_here
1229
SUPABASE_JWT_SECRET=your_jwt_secret_here
30+
31+
# Service role key - required for server-side database access (e.g., storing GitHub tokens)
32+
# Get from Supabase Dashboard → Settings → API → service_role key
1333
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here
1434

15-
# GitHub OAuth (for repo import feature)
35+
# -----------------------------------------------------------------------------
36+
# GitHub OAuth - One-Click Repo Import Feature
37+
# -----------------------------------------------------------------------------
38+
# IMPORTANT: This is SEPARATE from Supabase GitHub login!
39+
#
40+
# Supabase login uses its own OAuth app (configured in Supabase Dashboard).
41+
# This OAuth app is ONLY for importing repositories from GitHub.
42+
#
43+
# Setup:
44+
# 1. Go to GitHub → Settings → Developer settings → OAuth Apps → New OAuth App
45+
# 2. Create app with name like "YourApp Repo Import"
46+
# 3. Set callback URL based on environment:
47+
# - Development: http://localhost:3000/github/callback
48+
# - Production: https://yourdomain.com/github/callback
49+
# 4. Copy Client ID and generate Client Secret
50+
#
51+
# You may need separate OAuth apps for dev and production (different callback URLs)
52+
1653
GITHUB_CLIENT_ID=your_github_oauth_app_client_id
1754
GITHUB_CLIENT_SECRET=your_github_oauth_app_client_secret
55+
56+
# Must match EXACTLY what you set in GitHub OAuth App settings
1857
GITHUB_REDIRECT_URI=http://localhost:3000/github/callback
58+
59+
# Frontend URL for redirects after OAuth
1960
FRONTEND_URL=http://localhost:3000
2061

21-
# Backend API
62+
# -----------------------------------------------------------------------------
63+
# Backend Configuration
64+
# -----------------------------------------------------------------------------
65+
2266
BACKEND_API_URL=http://localhost:8000
2367
API_KEY=dev-secret-key
2468

25-
# CORS Configuration (Security)
69+
# CORS - allowed frontend origins (comma-separated for multiple)
2670
ALLOWED_ORIGINS=http://localhost:3000
2771

28-
# Redis Cache
72+
# -----------------------------------------------------------------------------
73+
# Redis Cache (Optional)
74+
# -----------------------------------------------------------------------------
75+
2976
REDIS_HOST=localhost
3077
REDIS_PORT=6379
3178

32-
# Sentry Error Tracking (Optional)
79+
# -----------------------------------------------------------------------------
80+
# Monitoring & Debugging
81+
# -----------------------------------------------------------------------------
82+
83+
# Sentry error tracking (optional)
3384
# Get DSN from https://sentry.io → Settings → Projects → Client Keys
3485
SENTRY_DSN=
35-
ENVIRONMENT=development
3686

37-
# Search V3 - Voyage AI Code Embeddings (recommended for code search)
38-
# Get API key from https://dash.voyageai.com/
39-
VOYAGE_API_KEY=your_voyage_api_key_here
87+
# Environment identifier
88+
ENVIRONMENT=development

0 commit comments

Comments
 (0)