The platform includes a comprehensive application deployment system that allows users to deploy applications from Git repositories directly through the dashboard. The system supports multiple application types and handles the entire deployment lifecycle from git clone to running containers with automatic nginx proxy configuration.
npm)npm install and npm startreact)npm run buildnpm run previewnextjs)npm run buildnpm startphp)python)requirements.txtpython app.pystatic)docker)Deployment Service (services/api/src/services/deployment.ts)
Nginx Service (services/api/src/services/nginx.ts)
/app-slug/)Database Schema
__sys_applications: Stores application metadata__sys_deployments: Tracks deployment history and logsUser submits deployment form
↓
Create application record in database
↓
Create deployment record (status: pending)
↓
Clone git repository
↓
Generate Dockerfile based on app type
↓
Build Docker image
↓
Stop existing container (if any)
↓
Start new container
↓
Update nginx configuration
↓
Reload nginx
↓
Mark deployment as deployed
POST /api/applications/:id/deploy
Starts deployment of an application.
Response:
{
"message": "Deployment started",
"appId": "uuid"
}
POST /api/applications/:id/stop
Stops a running application.
GET /api/applications/:id/deployments?page=1&limit=20
Lists all deployments for an application.
GET /api/applications/:id/deployments/:deploymentId/logs
Returns build and deployment logs.
GET /api/applications/:id/logs
Returns runtime container logs.
Applications are accessible at /<slug>/:
http://localhost:8888/my-app/
Applications can be configured with custom domains:
server {
listen 80;
server_name app.example.com;
location / {
proxy_pass http://saas-app-{id}:3000;
}
}
Applications can define environment variables in the deployment form:
NODE_ENV=production
API_KEY=your-api-key
DATABASE_URL=postgresql://...
PORT=3000
| Type | Build Command | Start Command |
|---|---|---|
| npm | npm install |
npm start |
| react | npm install && npm run build |
npm run preview |
| nextjs | npm install && npm run build |
npm start |
| php | (none) | (apache) |
| python | pip install -r requirements.txt |
python app.py |
| static | (none) | (nginx) |
Users can override the default build and start commands in the deployment form.
Containers are named using the pattern:
saas-app-{application-id}
All deployed applications run in the saas-network Docker network, allowing them to communicate with other platform services.
Containers use unless-stopped restart policy to automatically restart after host reboot.
/var/run/docker.sockFill in the form:
Environment Variables:
VITE_API_URL=http://localhost:8888/api
NODE_ENV=production
Click Create & Deploy
Monitor deployment in the deployments list
Access at http://localhost:8888/my-app/
# Create application
curl -X POST http://localhost:8888/api/applications \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "My App",
"slug": "my-app",
"appType": "react",
"repositoryUrl": "https://github.com/user/repo.git",
"branch": "main",
"buildCommand": "npm install && npm run build",
"startCommand": "npm run preview",
"port": 3000,
"environment": {
"NODE_ENV": "production"
}
}'
# Deploy
curl -X POST http://localhost:8888/api/applications/{id}/deploy \
-H "Authorization: Bearer $TOKEN"
# Check logs
curl http://localhost:8888/api/applications/{id}/logs \
-H "Authorization: Bearer $TOKEN"
Check deployment logs:
curl http://localhost:8888/api/applications/{id}/deployments/{deploymentId}/logs
Check container logs:
docker logs saas-app-{id}
Verify git repository is accessible
Check Dockerfile generation
Ensure build commands are correct
Verify nginx configuration:
docker exec saas-gateway cat /etc/nginx/conf.d/apps-proxy.conf
Test nginx configuration:
docker exec saas-gateway nginx -t
Check container is running:
docker ps | grep saas-app-