# XBP Quick Start Guide
## Installation
```bash
# Install from crates.io
cargo install xbp
# Or build from source with Kafka support
git clone https://github.com/your-org/xbp.git
cd xbp
cargo build --release --features kafka
```
## 5-Minute Setup
### 1. Initialize Your Project
Create `.xbp/xbp.json` or `xbp.json` in your project root:
```json
{
"project_name": "my-app",
"port": 3000,
"build_dir": "/home/user/projects/my-app",
"app_type": "rust",
"services": [
{
"name": "api",
"target": "rust",
"port": 3000,
"branch": "main"
}
]
}
```
### 2. Check System Health
```bash
xbp diag
```
This shows:
- CPU, RAM, Disk usage
- Nginx status
- Port availability
- Internet connectivity
- Speed test
### 3. Setup Nginx (Optional)
```bash
xbp nginx setup --domain api.example.com --port 3000
```
### 4. Deploy Your Service
```bash
xbp service build api
xbp service start api
```
### 5. Monitor Health
```bash
# Add to xbp.json:
{
"monitor_url": "http://localhost:3000/health",
"monitor_method": "GET",
"monitor_expected_code": 200,
"monitor_interval": 60
}
# Run check
xbp monitor check
# Or start daemon
xbp monitor start
```
## Common Tasks
### Check What's Running
```bash
xbp ports # All ports
xbp list # PM2 processes
xbp services # XBP services
```
### View Logs
```bash
xbp logs api # PM2 logs
xbp tail # Tail log files
```
### Redeploy
```bash
xbp redeploy api # Single service
xbp redeploy # All services
```
### Diagnostics
```bash
xbp diag # Full diagnostics
xbp diag --nginx # Nginx only
xbp diag --ports 3000,8080 # Specific ports
```
## Advanced Features
### Kafka Logging
```json
{
"log_files": ["/var/log/app/api.log"],
"kafka_brokers": "localhost:9092",
"kafka_topic": "app-logs"
}
```
```bash
xbp tail --ship # Ship to Kafka
xbp tail --kafka # Tail from Kafka
```
### Multi-Service Deployment
```json
{
"services": [
{"name": "api", "target": "rust", "port": 3000},
{"name": "frontend", "target": "nextjs", "port": 3001},
{"name": "worker", "target": "python", "port": 3002}
]
}
```
```bash
xbp services # List all
xbp redeploy # Deploy all
```
### API Mode
```bash
export PORT_XBP_API=8080
xbp
```
Access at `http://localhost:8080`
## Troubleshooting
### Port Already in Use
```bash
xbp ports -p 3000
xbp ports -p 3000 --kill
```
### Nginx Not Working
```bash
xbp diag --nginx
# Follow prompts to fix
```
### Service Won't Start
```bash
xbp service build my-service
xbp service install my-service
xbp service start my-service
xbp logs my-service
```
## Help
```bash
xbp --help # General help
xbp service --help # Service commands
xbp nginx --help # Nginx commands
xbp diag --help # Diagnostics options
```
## Next Steps
1. Read `CLI_GUIDE.md` for complete documentation
2. Check `openapi.yaml` for API reference
3. See `xbp.json.example` for configuration examples
4. Review `CHANGELOG.md` for latest features
## Support
- Issues: GitHub Issues
- Email: floris@xylex.ai
- License: MIT