The LegalMind project uses .env.local for local secret management. This file is NOT committed to version control.
A .env.local file has been created in the backend/ directory with your API key. This file:
- Contains sensitive credentials (API keys, project IDs)
- Is ignored by git (see
.gitignore) - Is loaded automatically when running
python main_new.py
- Backend:
backend/.env.local- Contains Gemini API key and Google Cloud credentials - Reference:
backend/.env.example- Template showing all available configuration options
-
When you run
python main_new.py, it automatically loads:.env.localfirst (highest priority - your local secrets).envsecond (if .env.local doesn't exist)
-
Environment variables are read by Pydantic
BaseSettingsinbackend/config/settings.py -
Settings are accessed throughout the application via:
from config.settings import get_settings settings = get_settings()
To change any configuration:
- Edit
backend/.env.localwith your values - Restart the backend server (
python main_new.py) - Changes take effect immediately
# Terminal 1: Backend
cd backend
python main_new.py
# Terminal 2: Frontend
cd frontend
npm run devNo API keys needed on the command line - they're read from .env.local
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Commit
.env.localto git - Share your API keys in chat, emails, or pull requests
- Use the same API key across different environments
✅ DO:
- Keep
.env.localin your local.gitignore - Rotate API keys regularly
- Use project-specific credentials