Skip to content
Open
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
83 changes: 83 additions & 0 deletions .env.docker.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Docker Environment Variables Template

# Copy this file to .env and fill in your values
# cp .env.docker.example .env

# ============================================================
# DATABASE CONFIGURATION
# ============================================================

# PostgreSQL (if using local database instead of Supabase)
DB_USER=postgres
DB_PASSWORD=your_secure_password_here
DB_HOST=postgres
DB_PORT=5432
DB_NAME=inpactai

# Or use Supabase connection (recommended)
# DB_USER=postgres
# DB_PASSWORD=your_supabase_password
# DB_HOST=db.xyzabcdefgh.supabase.co
# DB_PORT=5432
# DB_NAME=postgres

# ============================================================
# SUPABASE (Required)
# ============================================================

SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key

# ============================================================
# AI SERVICES
# ============================================================

GEMINI_API_KEY=your_gemini_api_key
YOUTUBE_API_KEY=your_youtube_api_key

# ============================================================
# REDIS
# ============================================================

REDIS_PASSWORD=changeme_in_production
REDIS_PORT=6379

# ============================================================
# APPLICATION PORTS
# ============================================================

BACKEND_PORT=8000
FRONTEND_PORT=3000
LANDING_PORT=3001

# ============================================================
# FRONTEND CONFIGURATION
# ============================================================

# API URL for frontend (adjust for your deployment)
VITE_API_URL=http://localhost:8000

# CORS Origins (comma-separated)
CORS_ORIGINS=http://localhost:3000,http://localhost:5173

# ============================================================
# ADVANCED DATABASE SETTINGS (Optional)
# ============================================================

DB_POOL_SIZE=5
DB_MAX_OVERFLOW=10
DB_POOL_TIMEOUT=30
DB_POOL_RECYCLE=3600
DB_MAX_RETRIES=3
DB_RETRY_DELAY=1.0
DB_CONNECTION_TIMEOUT=10
DB_PREFER_IPV4=true
DB_SSL_MODE=require
DB_USE_REST_FALLBACK=true

# ============================================================
# PRODUCTION SETTINGS
# ============================================================

# Set to false in production
DEBUG=false
82 changes: 82 additions & 0 deletions Backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
venv/
env/
ENV/
env.bak/
venv.bak/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store

# Environment files
.env
.env.local
.env.*.local

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# Logs
*.log
logs/

# Database
*.db
*.sqlite
*.sqlite3

# Docker
Dockerfile
Dockerfile.*
.dockerignore
docker-compose*.yml

# Documentation
*.md
docs/

# Git
.git/
.gitignore
.gitattributes

# CI/CD
.github/
.gitlab-ci.yml

# Misc
*.bak
*.tmp
*.temp
.cache/
97 changes: 97 additions & 0 deletions Backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Environment Configuration Template

# ============================================================
# DATABASE CONFIGURATION (PostgreSQL/Supabase)
# ============================================================

# Required: PostgreSQL Connection Credentials
user=your_database_user
password=your_database_password
host=your_database_host
port=5432
dbname=your_database_name
Comment on lines +8 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Inconsistent naming convention for database credentials.

The database credential keys (user, password, host, port, dbname) use lowercase, while all other environment variables follow UPPERCASE_WITH_UNDERSCORES convention. This inconsistency can lead to confusion and errors.

Consider standardizing to uppercase for consistency:

-user=your_database_user
-password=your_database_password
-host=your_database_host
-port=5432
-dbname=your_database_name
+DB_USER=your_database_user
+DB_PASSWORD=your_database_password
+DB_HOST=your_database_host
+DB_PORT=5432
+DB_NAME=your_database_name

Important: This change requires updating Backend/app/config.py (lines 17-21) to use the new variable names.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
πŸͺ› dotenv-linter (4.0.0)

[warning] 8-8: [LowercaseKey] The user key should be in uppercase

(LowercaseKey)


[warning] 9-9: [LowercaseKey] The password key should be in uppercase

(LowercaseKey)


[warning] 9-9: [UnorderedKey] The password key should go before the user key

(UnorderedKey)


[warning] 10-10: [LowercaseKey] The host key should be in uppercase

(LowercaseKey)


[warning] 10-10: [UnorderedKey] The host key should go before the password key

(UnorderedKey)


[warning] 11-11: [LowercaseKey] The port key should be in uppercase

(LowercaseKey)


[warning] 11-11: [UnorderedKey] The port key should go before the user key

(UnorderedKey)


[warning] 12-12: [LowercaseKey] The dbname key should be in uppercase

(LowercaseKey)


[warning] 12-12: [UnorderedKey] The dbname key should go before the host key

(UnorderedKey)

πŸ€– Prompt for AI Agents
In Backend/.env.example around lines 8-12 the database keys use lowercase (user,
password, host, port, dbname) which breaks the repository's
UPPERCASE_WITH_UNDERSCORES convention; rename them to DB_USER, DB_PASSWORD,
DB_HOST, DB_PORT, DB_NAME in the .env.example and then update
Backend/app/config.py (lines 17-21) to read the new environment variable names
via os.getenv("DB_USER") etc. Ensure any defaults or type conversions (e.g., int
for DB_PORT) remain correct and update any documentation or usages that
reference the old lowercase names.


# For Supabase users:
# 1. Go to: https://app.supabase.com/project/YOUR_PROJECT/settings/database
# 2. Copy connection details from the "Connection string" section
# 3. Extract the credentials and paste them above

# Example for Supabase:
# user=postgres
# password=your_project_password
# host=db.xyzabcdefgh.supabase.co
# port=5432
# dbname=postgres

# ============================================================
# SUPABASE REST API (Fallback & Additional Features)
# ============================================================

# Required for REST API fallback when PostgreSQL fails
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_anon_key

# Get these from:
# https://app.supabase.com/project/YOUR_PROJECT/settings/api

# ============================================================
# AI SERVICES
# ============================================================

# Google Gemini API (for trending niches)
GEMINI_API_KEY=your_gemini_api_key
# Get from: https://makersuite.google.com/app/apikey

# YouTube Data API (for channel info)
YOUTUBE_API_KEY=your_youtube_api_key
# Get from: https://console.cloud.google.com/apis/credentials

# ============================================================
# ADVANCED DATABASE SETTINGS (Optional)
# ============================================================

# Connection Pool Configuration
DB_POOL_SIZE=5 # Number of connections in the pool
DB_MAX_OVERFLOW=10 # Additional connections allowed beyond pool_size
DB_POOL_TIMEOUT=30 # Seconds to wait for a connection from the pool
DB_POOL_RECYCLE=3600 # Recycle connections after N seconds (1 hour)

# Connection Retry Settings
DB_MAX_RETRIES=3 # Number of connection retry attempts
DB_RETRY_DELAY=1.0 # Initial delay between retries (exponential backoff)
DB_CONNECTION_TIMEOUT=10 # Seconds to wait for connection establishment

# IPv6/Network Settings
DB_PREFER_IPV4=true # Prefer IPv4 connections (helps with IPv6 issues)
DB_SSL_MODE=require # SSL mode: disable, allow, prefer, require, verify-ca, verify-full

# Fallback Configuration
DB_USE_REST_FALLBACK=true # Use Supabase REST API when PostgreSQL fails

# ============================================================
# APPLICATION SETTINGS (Optional)
# ============================================================

# Debug mode (shows detailed errors)
DEBUG=false

# CORS Origins (comma-separated)
CORS_ORIGINS=http://localhost:5173,http://localhost:3000

# ============================================================
# TROUBLESHOOTING
# ============================================================

# If you experience connection issues:
# 1. IPv6 Issues: Set DB_PREFER_IPV4=true and use Supabase Connection Pooler
# 2. Timeout Issues: Increase DB_CONNECTION_TIMEOUT and DB_POOL_TIMEOUT
# 3. SSL Issues: Try DB_SSL_MODE=disable for local development
# 4. General Issues: Enable DEBUG=true for detailed error messages

# For Supabase Connection Pooler (IPv4 compatible):
# 1. Enable in Supabase Dashboard β†’ Database β†’ Connection Pooler
# 2. Update your host:
# host=aws-0-us-east-1.pooler.supabase.com
# port=6543

# See DATABASE_SETUP.md for detailed troubleshooting guide
Loading