Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Frontend Environment Variables
# Copy this to .env.local for local development overrides

# Backend API URL
# Production: Set in Vercel dashboard (e.g., https://codeintel-backend.railway.app)
# Development: Defaults to http://localhost:8000 (Docker Compose)
VITE_API_URL=http://localhost:8000

# Supabase Configuration
# Get these from your Supabase project settings
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key-here
3 changes: 1 addition & 2 deletions frontend/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import { ImpactAnalyzer } from './ImpactAnalyzer'
import { PerformanceDashboard } from './PerformanceDashboard'
import { UserNav } from './UserNav'
import type { Repository } from '../types'

const API_URL = 'http://localhost:8000'
import { API_URL } from '../config/api'

type RepoTab = 'overview' | 'search' | 'dependencies' | 'insights' | 'impact'

Expand Down
13 changes: 13 additions & 0 deletions frontend/src/config/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* API Configuration
*
* Centralizes API URL configuration for all frontend components.
*
* - Production: Set VITE_API_URL in Vercel dashboard to Railway backend URL
* - Development: Defaults to localhost:8000 (Docker Compose)
* - Local dev without Docker: Can override with .env.local
*/

const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8000'

export { API_URL }
Loading