A modern, web-based code editor specifically designed for developing Soroban smart contracts on the Stellar blockchain. Built with Next.js, Monaco Editor, and Docker for a seamless development experience.
- Monaco Editor Integration - Professional code editing with syntax highlighting and IntelliSense
- Docker Container Support - Isolated development environments for each project
- File Management - Create, edit, and manage project files in a visual file tree
- Terminal Integration - Built-in terminal for running commands and viewing output
- Wallet Integration - Connect Stellar wallet (Freighter) to manage blockchain interactions
- Multi-Tab Support - Work on multiple files simultaneously with an intuitive tab system
- Project Management - Create, delete, and organize multiple Soroban projects
- Real-Time Logging - View build output, compilation errors, and runtime logs
- Smart Contract Deployment - Deploy contracts to the Stellar blockchain directly from the editor
The screenshot above shows the main editor interface with the code editor, file explorer, and integrated terminal.
- Installation
- Getting Started
- User Guide
- Features Guide
- Keyboard Shortcuts
- Docker Setup
- API Reference
- Troubleshooting
- Node.js 18.x or higher
- npm or yarn package manager
- Docker (for container-based development)
-
Clone the repository
cd code-editor -
Install dependencies
npm install
-
Set up environment variables (if needed)
# Create a .env.local file for any required configuration -
Start the development server
npm run dev
-
Open in browser
- Navigate to
https://localhost:3000 - The application uses experimental HTTPS for wallet integration
- Navigate to
-
Open the Application
- Go to
https://localhost:3000 - You'll see the Home page with project management
- Go to
-
Create Your First Project
- Click the "+ New Project" button
- Enter a project name (e.g., "Hello Soroban")
- Optionally add a project description
- Click "Create Project"
- A Docker container will be created automatically with the Soroban contract template
-
Open the Project in Editor
- Click on the project card or the "Open in Editor" button
- The editor will load with your project files
-
Connect Your Wallet
- Click the "Connect Wallet" button in the top right
- Approve the connection in your Freighter wallet extension
- Your wallet address and balance will appear at the top
-
Start Editing
- Browse files in the left sidebar
- Click any file to open it in the editor
- Write or modify your Soroban contract code
- Changes are automatically saved
-
Build and Deploy
- Use the "Build" button to compile your contract
- View build output in the Terminal panel
- Once successful, click "Deploy" to deploy to the Stellar network
- Confirm the transaction in your Freighter wallet
The editor interface is divided into four main sections:
┌─────────────────────────────────────────┐
│ Top Bar (Menu & Wallet) │
├────────────────────────────────────────┤
│ Left Panel │ Editor Panel │ │
│ (Chat) │ (Code Editor) │ │
│ │ Main Area │ │
├────────────────────────────────────────┤
│ Terminal/Output Panel │
└────────────────────────────────────────┘
Left Side:
- Project name and breadcrumb navigation
- Toggle buttons for different panel views
Right Side:
- Connect Wallet - Connect your Stellar wallet (Freighter)
- Wallet address display (when connected)
- Wallet balance in XLM
- Build button - Compile your contract
- Deploy button - Deploy to Stellar network
The Chat/Assistant Panel provides:
- AI-powered development assistance
- Code suggestions and explanations
- Real-time feedback on your code
- Message history with previous interactions
How to use:
- Type your question or request in the text area at the bottom
- Press Enter or click Send
- View the AI response and any suggested actions
- Click on suggested actions to implement recommendations
Located on the left side of the editor panel:
File Operations:
- Click a file to open it in the editor
- Right-click for context menu (create, rename, delete)
- Drag to resize - Adjust sidebar width by dragging the divider
Folder Structure:
- Navigate through project directories
- Expand/collapse folders to view contents
- Current file is highlighted in the tree
Tab Management:
- Open files appear as tabs at the top
- Click tabs to switch between files
- Click × on a tab to close the file
- Unsaved files show a dot indicator
Code Editing:
- Full Monaco Editor with syntax highlighting
- IntelliSense for Rust/Soroban SDK
- Code formatting and linting
- Line numbers and code folding
- Minimap on the right side (toggle with Ctrl+B)
Font and Appearance:
- Adjust editor font size with mouse wheel (Ctrl/Cmd + scroll)
- Light and dark mode support
- Customizable theme
Features:
- Real-time build output
- Compilation errors and warnings
- Runtime logs and debug information
- Auto-scroll to latest messages
Controls:
- Resize - Drag the top edge to adjust height
- Close - Click the × button to hide
- Clear - Click "Clear Logs" to remove all messages
- Filter - Toggle log types (Logs, Errors, Warnings)
Additional Tools:
- Quick access buttons for common operations
- Status indicators
- Additional file/project information
- From the Home page, click "+ New Project"
- Fill in the project details:
- Project Name (required): Unique identifier for your project
- Description (optional): Brief description of the project
- Contract Type: Select "Soroban" (default)
- Click "Create Project"
- The system will:
- Create a Docker container for isolated development
- Initialize a Soroban contract template
- Set up necessary dependencies
- Click on any project card to open it in the editor
- Or click the folder icon and select a project
- The editor loads with all project files ready to edit
- From the Home page, hover over a project and click the trash icon
- Confirm the deletion
- The Docker container and all project files will be removed
- Right-click in the file explorer sidebar
- Select "New File"
- Enter the filename (e.g.,
helper.rs) - Press Enter
- The file is created and automatically opened
- Click on a file in the sidebar to open it
- Edit the content in the main editor area
- Your changes are automatically saved to the Docker container
- Right-click on a file in the sidebar
- Select "Delete"
- Confirm the deletion
- The file is removed from the project
- Click any file to preview its content
- The file opens in a new tab
- Switch between open files using the tab bar
- Click the "Build" button in the top right
- The system will:
- Compile your Soroban contract
- Run any tests
- Generate a
.wasmfile
- View build output in the Terminal panel:
- Green messages: Successful compilation steps
- Red messages: Errors that need fixing
- Yellow messages: Warnings to review
Troubleshooting Build Errors:
- Check the error message in the terminal
- Review the line number indicated in the error
- Common issues:
- Missing dependencies in
Cargo.toml - Syntax errors in your contract code
- Type mismatches
- Missing dependencies in
- Wallet Connected - Connect your Freighter wallet
- Build Successful - Build your contract without errors
- Funded Wallet - Have at least 1 XLM for transaction fees
- Click the "Deploy" button in the top bar
- A deployment dialog will appear showing:
- Network selection (Testnet/Mainnet)
- Contract details
- Estimated fees
- Review and confirm the deployment details
- Click "Confirm Deployment"
- Approve the transaction in your Freighter wallet
- Wait for confirmation (usually 5-30 seconds)
- View deployment logs in the Terminal panel
- The contract address will be displayed upon success
- Click "Connect Wallet" button in the top right corner
- Choose Freighter wallet from the available options
- Approve the connection request in your Freighter extension
- Your wallet address will appear in the top bar
- Address: Truncated wallet address with copy button
- Balance: Current XLM balance in the wallet
- Network: Current Stellar network (Testnet/Mainnet)
- Click on wallet address to copy it to clipboard
- Click the wallet icon to view full address and options
- Use the network selector to switch between Testnet and Mainnet
Log (Blue) - Informational messages
- Build progress
- File operations
- General status updates
Error (Red) - Errors that require attention
- Compilation failures
- Runtime exceptions
- Failed transactions
Warn (Yellow) - Warnings for review
- Deprecation notices
- Potential issues
- Best practice suggestions
Info (Green) - Success messages
- Build completed
- File saved
- Deployment successful
- Monitor the terminal during builds and deployments
- Scroll through logs to find specific messages
- Click "Clear Logs" to start fresh
- Use filter buttons to show only specific log types
| Action | Windows/Linux | macOS |
|---|---|---|
| Save File | Ctrl + S | Cmd + S |
| Open File | Ctrl + O | Cmd + O |
| New File | Ctrl + N | Cmd + N |
| Close Tab | Ctrl + W | Cmd + W |
| Next Tab | Ctrl + Tab | Cmd + Tab |
| Previous Tab | Ctrl + Shift + Tab | Cmd + Shift + Tab |
| Find | Ctrl + F | Cmd + F |
| Find & Replace | Ctrl + H | Cmd + H |
| Action | Shortcut |
|---|---|
| Format Code | Ctrl + Shift + F |
| Comment Line | Ctrl + / |
| Undo | Ctrl + Z |
| Redo | Ctrl + Y |
| Copy Line | Ctrl + C |
| Paste | Ctrl + V |
| Delete Line | Ctrl + Shift + K |
| Duplicate Line | Ctrl + Shift + D |
The application uses Docker containers to provide isolated development environments:
- One container per project - Each project runs in its own Docker container
- Soroban template initialized - Every new project comes with a working contract template
- File persistence - Files are stored within the container and synced with the UI
When you create a new project:
- A Docker container is created with a unique name (
project-{id}) - The Soroban contract template is automatically initialized
- Dependencies are installed (
cargo build)
The backend provides API endpoints for container management:
POST /api/docker
Available Actions:
createProject- Create and initialize a new containerdeleteProject- Stop and remove a containergetFiles- List all files in a projectgetFileContent- Read file contentsaveFileContent- Write file contentbuildProject- Build the contractdeployProject- Deploy the contract
# View running containers
docker ps
# View all containers
docker ps -a
# View container logs
docker logs <container-name>
# Execute command in container
docker exec <container-name> <command>
# Remove a project container
docker stop <container-name>
docker rm <container-name>- Docker installed on your system
- Docker daemon running and accessible
- stellar-sandbox image available (pre-built or pulled automatically)
- Sufficient disk space for container images and project files
For detailed Docker setup instructions, see DOCKER_SETUP.md
POST /api/docker
Content-Type: application/json
{
"action": "createProject",
"userId": "1",
"projectName": "My Contract",
"description": "A sample contract"
}
Response:
{
"success": true,
"projectId": "project-123",
"message": "Project created successfully"
}
POST /api/docker
Content-Type: application/json
{
"action": "deleteProject",
"projectId": "project-123"
}
Response:
{
"success": true,
"message": "Project deleted successfully"
}
POST /api/docker
Content-Type: application/json
{
"action": "getAllProjects",
"userId": "1"
}
Response:
{
"success": true,
"projects": [
{
"id": "project-123",
"name": "My Contract",
"createdAt": "2024-01-15T10:30:00Z",
"description": "A sample contract"
}
]
}
POST /api/docker
{
"action": "getFiles",
"projectId": "project-123",
"path": "/src"
}
Response:
{
"success": true,
"files": [
{ "name": "lib.rs", "type": "file", "path": "/src/lib.rs" },
{ "name": "config", "type": "directory", "path": "/src/config" }
]
}
POST /api/docker
{
"action": "getFileContent",
"projectId": "project-123",
"filePath": "/src/lib.rs"
}
Response:
{
"success": true,
"content": "// Your contract code here\n..."
}
POST /api/docker
{
"action": "saveFileContent",
"projectId": "project-123",
"filePath": "/src/lib.rs",
"content": "// Updated code here\n..."
}
Response:
{
"success": true,
"message": "File saved successfully"
}
POST /api/docker
{
"action": "buildProject",
"projectId": "project-123"
}
Response:
"success": true,
"wasmPath": "/path/to/contract.wasm",
"output": "Build output logs..."
}
POST /api/docker
{
"action": "deployProject",
"projectId": "project-123",
"walletAddress": "G...",
"network": "testnet"
}
Response:
{
"success": true,
"contractId": "C...",
"transactionHash": "tx-hash-...",
"message": "Contract deployed successfully"
}
Problem: The Docker container for your project is not running or has been deleted.
Solutions:
- Verify Docker is installed and running:
docker ps - Check if the container exists:
docker ps -a - Delete and recreate the project from the Home page
Problem: Your contract code has syntax errors or missing dependencies.
Solutions:
- Check the error message in the Terminal panel
- Review the line number indicated in the error
- Verify all imports are correct:
use soroban_sdk::... - Check
Cargo.tomlfor required dependencies - Fix the code and click Build again
Problem: Cannot connect to Freighter wallet.
Solutions:
- Ensure Freighter extension is installed in your browser
- Verify the extension is enabled
- Try refreshing the page (Ctrl + R / Cmd + R)
- Clear browser cache and cookies
- Try a different browser or device
Problem: Cannot deploy contract due to insufficient funds.
Solutions:
- Check your wallet balance in the top right corner
- Ensure you have at least 1 XLM for transaction fees
- Get testnet XLM from the Stellar Testnet Faucet
- Wait a few seconds and try deploying again
Problem: Changes to files are not being persisted.
Solutions:
- Check the Terminal for any error messages
- Verify the Docker container is still running:
docker ps - Try closing and reopening the file
- Refresh the page and open the file again
- Check available disk space on your system
Problem: Editor is running slow or unresponsive.
Solutions:
- Close unnecessary tabs to reduce memory usage
- Clear browser cache and restart
- Reduce terminal log history (clear logs)
- Check available system memory and CPU
- Try a different browser
If you encounter issues not listed above:
- Check the Terminal panel for detailed error messages
- Review the console (F12 → Console tab) for JavaScript errors
- Check Docker logs for container-related issues:
docker logs <container-name>
- Restart the application:
- Stop the dev server (Ctrl + C)
- Clear node cache:
rm -rf .next - Restart:
npm run dev
- Soroban Documentation: soroban.stellar.org
- Stellar SDK: js-stellar-sdk
- Freighter Wallet: freighter.app
- Monaco Editor: microsoft.github.io/monaco-editor
- Private containers - Each project runs in an isolated Docker container
- Wallet security - Private keys never leave your Freighter wallet
- HTTPS only - All connections use secure HTTPS
- No data collection - Your code and wallet information remain private
This project is built with Next.js, React, and Monaco Editor.
npm run devServer runs on https://localhost:3000
npm run build
npm startnpm run lint**Happy Coding! **
Start building your Soroban smart contracts today with a modern, intuitive development environment.
