.env.example to .env and fill in the values for your environment. The application reads these variables at startup.
.env.example for quick reference:
Application
The public URL of your ThinkEx instance. Used to generate absolute URLs for links, redirects, and OAuth callbacks. Set this to your domain when deploying (e.g.,
https://thinkex.example.com).Authentication
A secret key used to sign and verify authentication sessions. Generate a secure value with:
The base URL used for authentication callbacks and redirects. Set this to the same value as
NEXT_PUBLIC_APP_URL when deploying to a public domain.Database
PostgreSQL connection string for your ThinkEx database.
The automated setup script (
./setup.sh) configures this value for you if you use Docker.Google OAuth (optional)
Enable Google sign-in by creating OAuth 2.0 credentials in the Google Cloud Console. If you omit these variables, users can still sign in with email and password.The OAuth 2.0 client ID from your Google Cloud project.
The OAuth 2.0 client secret from your Google Cloud project.
AI
API key for Google’s Generative AI (Gemini). ThinkEx uses this for all AI chat features. Get your key from Google AI Studio.
Storage
Controls where uploaded files are stored. Accepted values:
local or supabase.local— Files are saved to the./uploads/directory on the server. Recommended for most self-hosted setups.supabase— Files are stored in a Supabase storage bucket. Requires the Supabase variables below.
Supabase storage (optional)
These variables are only required whenSTORAGE_TYPE=supabase.
The URL of your Supabase project (e.g.,
https://your-project.supabase.co). Found in your Supabase project’s Settings → API.The anon (public) key for your Supabase project. Used by the browser to request signed upload URLs.
The service role key for your Supabase project. Used server-side to generate signed upload URLs and manage storage. Keep this secret — it bypasses Supabase row-level security.
Optional integrations
API key for Firecrawl. When set, ThinkEx uses Firecrawl to fetch richer content from web URLs (full page text, structured data). Without this key, ThinkEx falls back to basic URL fetching.
API key for Mistral AI. Used to power OCR on images and PDFs via Mistral’s OCR API. Without this key, ThinkEx cannot extract text from image-based documents.
Base URL of an external FastAPI service (e.g.,
https://your-fastapi-service.com). When configured alongside FASTAPI_API_KEY, ThinkEx uses this service for file conversion, document-to-markdown conversion, and audio/video analysis.Bearer token used to authenticate server-to-server requests to the FastAPI service. Required when
FASTAPI_BASE_URL is set.