Prerequisites
Before you begin, ensure you have the following installed:Bun
Version 1.3.9 or higher
Node.js
Version 24.13.1 or higher
Quick Start
Install dependencies
Start development mode
Development Modes
Web Development
Starts the full web stack with hot reload:@t3tools/contractsbuild in watch mode- WebSocket server on port
3773(configurable) - Vite dev server on port
5733(configurable)
Development mode uses
~/.t3/dev as the state directory to keep dev state isolated from production.Desktop Development
Starts the Electron desktop app:Component-Specific Development
Run individual parts of the stack:Running Multiple Dev Instances
You can run multiple development instances simultaneously without port conflicts:How port shifting works
How port shifting works
The
T3CODE_DEV_INSTANCE environment variable hashes to a deterministic port offset:- Default server port:
3773 - Default web port:
5733 - Shifted ports:
base + hash(T3CODE_DEV_INSTANCE)
T3CODE_PORT_OFFSET with a numeric value.Environment Variables
Development Configuration
| Variable | Purpose | Default |
|---|---|---|
T3CODE_STATE_DIR | State/data directory | ~/.t3/dev (dev mode) |
T3CODE_PORT | WebSocket server port | 3773 |
T3CODE_NO_BROWSER | Skip auto-opening browser | false |
T3CODE_DEV_INSTANCE | Instance name for port shifting | - |
T3CODE_PORT_OFFSET | Manual port offset | - |
T3CODE_LOG_WS_EVENTS | Enable WebSocket event logging | false |
Turbo Configuration
These are automatically managed by the build system:PORT- Application portVITE_WS_URL- WebSocket connection URLVITE_DEV_SERVER_URL- Vite dev server URLELECTRON_RENDERER_PORT- Electron renderer port
Passing Server Arguments
You can pass CLI arguments to the server from root dev commands:IDE Setup
VS Code
Recommended extensions:.vscode/extensions.json
Effect Language Service
The project uses Effect with language service support. Run this after installing dependencies:Troubleshooting
Port already in use
Port already in use
If you see port conflicts:
-
Kill existing processes:
-
Or use a different instance:
Module resolution errors
Module resolution errors
If you see TypeScript errors about missing modules:
Codex not found
Codex not found
Next Steps
Architecture
Learn about the system architecture
Monorepo Structure
Understand the workspace layout
Testing
Write and run tests
Building
Build for production
