9a43f85259
Introduce a StorageBackend abstraction (local filesystem and S3) for patent PDF storage. When STORAGE_BACKEND=s3, PDFs are read/written via boto3 to an S3-compatible bucket instead of the local filesystem. - Add SPARC/storage.py with LocalStorageBackend and S3StorageBackend - Update serp_api.py save_patents and parse_patent_pdf to use storage - Add storage config vars to config.py and .env.example - Add optional MinIO service to docker-compose.yml (--profile s3) - Add boto3 to requirements.txt Closes leeworks-agents/SPARC#38 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
1.6 KiB
Bash
55 lines
1.6 KiB
Bash
# SPARC Configuration
|
|
|
|
# ---- Application Environment ----
|
|
# Set to "production" or "staging" in deployed environments.
|
|
# The API will refuse to start with the default JWT secret unless APP_ENV=development.
|
|
APP_ENV=development
|
|
|
|
# ---- API Keys ----
|
|
|
|
# SerpAPI key for patent search
|
|
API_KEY=your_serpapi_key_here
|
|
|
|
# OpenRouter API key for LLM analysis
|
|
OPENROUTER_API_KEY=your_openrouter_key_here
|
|
|
|
# ---- Database ----
|
|
|
|
# PostgreSQL credentials (used by docker-compose)
|
|
POSTGRES_USER=postgres
|
|
POSTGRES_PASSWORD=change-me-to-a-secure-password
|
|
POSTGRES_DB=sparc
|
|
|
|
# Full database URL (must match the credentials above)
|
|
DATABASE_URL=postgresql://postgres:change-me-to-a-secure-password@localhost:5432/sparc
|
|
|
|
# ---- Authentication ----
|
|
|
|
# JWT Secret for signing tokens
|
|
# IMPORTANT: Change this to a secure random string in production
|
|
JWT_SECRET=your-secure-jwt-secret-change-in-production
|
|
|
|
# ---- CORS ----
|
|
|
|
# Comma-separated list of allowed origins for CORS
|
|
# Defaults to http://localhost:3000,http://localhost:5173 when unset
|
|
# CORS_ORIGINS=https://sparc.example.com,https://app.example.com
|
|
|
|
# ---- Storage ----
|
|
|
|
# Backend for patent PDF storage: "local" (default) or "s3"
|
|
STORAGE_BACKEND=local
|
|
|
|
# S3/MinIO settings (only used when STORAGE_BACKEND=s3)
|
|
# S3_BUCKET=sparc-patents
|
|
# S3_ENDPOINT_URL=http://localhost:9000
|
|
# AWS_ACCESS_KEY_ID=minioadmin
|
|
# AWS_SECRET_ACCESS_KEY=minioadmin
|
|
# To start MinIO locally: docker compose --profile s3 up -d minio
|
|
|
|
# ---- Cache ----
|
|
|
|
# When USE_CACHE=true: check database for cached responses before making API calls
|
|
# When USE_CACHE=false: always make fresh API calls (still stores results in database)
|
|
USE_CACHE=true
|