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
14 changes: 13 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ SUPABASE_SERVICE_ROLE_KEY=eyJ...
# Backend API
API_KEY=change-this-secret-key-for-production
BACKEND_API_URL=http://backend:8000
FRONTEND_URL=http://localhost:3000

# GitHub OAuth (Required for GitHub repo import)
# Create OAuth App: https://github.com/settings/developers
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URI=http://localhost:3000/auth/github/callback

# CORS Configuration (Security)
# Comma-separated list of allowed origins
Expand All @@ -39,10 +46,15 @@ REDIS_HOST=redis
REDIS_PORT=6379

# Sentry Error Tracking (Optional but recommended for production)
# Get DSN from: https://sentry.io Settings Projects Client Keys
# Get DSN from: https://sentry.io -> Settings -> Projects -> Client Keys
SENTRY_DSN=
SENTRY_SEND_PII=false
SENTRY_INCLUDE_LOCAL_VARS=false
ENVIRONMENT=development # development, staging, production
Comment thread
DevanshuNEU marked this conversation as resolved.

# Discord Webhook (Optional - for feedback notifications)
DISCORD_FEEDBACK_WEBHOOK=

# Search V2 Configuration
# Cohere API for reranking (Optional - improves search quality)
# Get from: https://dashboard.cohere.com/api-keys
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ __pycache__/
venv/
env/

# Test/coverage artifacts
.coverage
htmlcov/
.pytest_cache/

# Node
node_modules/
dist/
Expand Down
96 changes: 0 additions & 96 deletions backend/.env.example

This file was deleted.

36 changes: 0 additions & 36 deletions backend/config/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,7 @@
API Configuration - Single Source of Truth for API Versioning

Change API_VERSION here to update all routes across the application.
Example: "v1" -> "v2" will change /api/v1/* to /api/v2/*
"""

# API VERSION CONFIGURATION

API_VERSION = "v1"

# DERIVED PREFIXES (auto-calculated from version)

# Current versioned API prefix: /api/v1
API_PREFIX = f"/api/{API_VERSION}"

# Legacy prefix for backward compatibility: /api
# Routes here will be deprecated but still functional
LEGACY_API_PREFIX = "/api"

# DEPRECATION SETTINGS

# When True, legacy routes (/api/*) will include deprecation warning headers
LEGACY_DEPRECATION_ENABLED = True

# Header to add on deprecated routes
DEPRECATION_HEADER = "X-API-Deprecated"
DEPRECATION_MESSAGE = f"This endpoint is deprecated. Please use {API_PREFIX} instead."

# HELPER FUNCTIONS

def get_versioned_prefix() -> str:
"""Get the current versioned API prefix."""
return API_PREFIX


def get_legacy_prefix() -> str:
"""Get the legacy (deprecated) API prefix."""
return LEGACY_API_PREFIX


def is_legacy_route(path: str) -> bool:
"""Check if a route path is using the legacy prefix."""
return path.startswith(LEGACY_API_PREFIX) and not path.startswith(API_PREFIX)
5 changes: 1 addition & 4 deletions backend/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
"""API Routes package"""
from .auth import router as auth_router

__all__ = ["auth_router"]
"""API Routes package."""
Loading