Configuration
Environment
Environment variables and configuration options.
Overview
Thesis uses environment variables for configuration. Most variables have sensible defaults for local development.
Frontend Variables
Set in apps/frontend/.env.local. All frontend variables must be prefixed with NEXT_PUBLIC_ to be accessible in the browser.
| Variable | Default | Description |
|---|---|---|
NEXT_PUBLIC_JUPYTER_BASE_URL | http://localhost:8888 | Jupyter server URL for REST API |
NEXT_PUBLIC_JUPYTER_WS_URL | ws://localhost:8888 | Jupyter WebSocket URL |
NEXT_PUBLIC_AGENT_API_URL | http://localhost:4242 | Agent backend URL |
Tip
In most cases, you don't need to set these. The frontend automatically uses window.location.origin and auto-detects the WebSocket protocol.
Backend Variables
The backend (apps/thesis) uses these environment variables:
| Variable | Default | Description |
|---|---|---|
PORT | 4242 | Server listening port |
JUPYTER_BASE_URL | http://localhost:8888 | Jupyter kernel server |
JUPYTER_TOKEN | (empty) | Jupyter authentication token |
JUPYTER_ROOT_DIR | ./ | Root directory for notebooks |
CLI Configuration
The CLI stores configuration in your system config directory using the conf package:
- macOS:
~/Library/Preferences/thesis-nodejs/ - Linux:
~/.config/thesis-nodejs/ - Windows:
%APPDATA%\thesis-nodejs\
Stored values:
openai_api_key- Your OpenAI API key (required)thesis_api_key- Thesis API key (optional)model- Default model preference
Use thesis auth login to configure your API key.
Default Ports
| Service | Port | Notes |
|---|---|---|
| Frontend | 3000 | Next.js dev server |
| Thesis Notebook | 8888 | Main application |
| Jupyter Server | 8898 | Backend kernel server |
| Agent Server | 4242 | NestJS backend |
The CLI automatically finds available ports if defaults are in use.