This is a Rust-based backend API service for DevBox built using the Axum web framework.
Devbox (written in Rust) is similar to devcontainer but devbox can be deployed on cloud as well.
- Initialize the App for local usage by sending GET request to
/config/edit.
/devbox/create: Create new container (Currently swagger does not mention all it's features)./devbox/list: List containers from DB./devbox/logs/{id}: Get detailed logs for a container./devbox/{id}?action=start|stop|delete: Start/Stop/Delete container./artifactories: Add, Remove, Modify and List artifactories./providers/docker|aws|azure: Modify, List providers./builders: Add, Remove, List Builders./config/edit: API routes for configuration management for anonymous user/config/provider/docker|azure|aws/edit: Endpoint to configure specific provider./ws/docker/{id}: Websocket endpoint to get interactive shell with container./api-docs/openapi.json: OpenAPI JSON specification for the API/swagger: Interactive Swagger UI for API exploration
The backend server runs on http://127.0.0.1:8000 by default and can be change by setting BINDING_ADDRESS env.
RUST_LOG=debug cargo runEnsure you have Rust, docker daemon installed and dependencies resolved via Cargo.
The server allows Cross-Origin Resource Sharing (CORS) for origins like http://127.0.0.1:3000, typically used for local frontend development and can be change by setting ALLOWED_ORIGIN env.
The backend uses the tracing crate for structured logging. Logs are output to the console. Logs for building containers are also stored in separate file.
The example/ directory inside example branch demonstrates the expected project structure for DevBox:
A DevBox-compatible project should include:
-
.devbox/folder - Contains configuration files:devbox.json- Main configuration file with project settings:{ "name": "project-name", "image": "base-image:latest", "build": { "dockerfile": "Dockerfile", "context": "." }, "features": { "feature-name": { "option": "value" } } }
-
.devbox/features/folder (optional) - Contains custom DevBox features:- Each feature in its own subfolder:
.devbox/features/{feature-name}/ devcontainer-feature.json- Feature metadata and configurationinstall.sh- Installation script for the feature- Features are based on devcontainer projects but modified for DevBox
- Each feature in its own subfolder:
-
Base files:
Dockerfile- Base container definition (if using custom build)- Application files (
.py,.js, etc.)
- name: Unique identifier for the DevBox container
- image: Base Docker image to use
- build: Docker build configuration (dockerfile path and context)
- features: HashMap of features to install with their configurations
Features are modular components that can be added to DevBox containers and are just modified features from devcontainer project (https://github.com/devcontainers/features):
- Located in
.devbox/features/{feature-name}/directories - Each feature includes metadata in
devcontainer-feature.json - Installation scripts in
install.sh(Bash/PowerShell) - Features support configuration through JSON options
- Based on devcontainer feature specification but adapted for DevBox
- Example features included in the project demonstrate common development tools
Projects can be configured through:
.devbox/devbox.json- Main project configuration- Feature-specific settings within the devbox.json
- Provider configurations (Docker, AWS, Azure) via API endpoints
- Environment variables and custom scripts
project-root/
├── .devbox/
│ ├── devbox.json
│ └── features/
│ ├── feature-name-1/
│ │ ├── devcontainer-feature.json
│ │ └── install.sh
│ └── feature-name-2/
│ ├── devcontainer-feature.json
│ └── install.sh
├── Dockerfile (optional)
├── myfile.py (example application file)
└── dummy_project/ (optional project subdirectory)
- Background tasks update container statuses every 5 seconds asynchronously.
- API documentation is accessible via the
/swaggerendpoint for ease of testing and exploration.

