A real-time chat application built with ARO, demonstrating WebSocket support for live message updates.
- Post messages via HTTP API
- Real-time updates via WebSocket broadcast
- In-memory message storage
- HTML template rendering
aro run .The server starts on http://localhost:8080 with WebSocket available at ws://localhost:8080/ws.
| Method | Path | Description |
|---|---|---|
| GET | /home | HTML chat interface |
| GET | /messages | Retrieve all messages |
| POST | /messages | Post a new message |
StatusPost/
├── openapi.yaml # API contract
├── main.aro # Application lifecycle
├── api.aro # HTTP route handlers
├── websocket.aro # WebSocket event handlers
└── templates/
└── index.html # Chat UI template
- Users open
/homein a browser - The page connects to
/wsvia WebSocket - When a message is posted, it's stored and broadcast to all connected clients
- All clients receive the new message in real-time
Build the container image:
docker build -t statuspost:latest .Run locally:
docker run -p 8080:8080 statuspost:latestDeploy to Kubernetes using kustomize:
# Preview the manifests
kubectl kustomize deployment/k8s/
# Apply to cluster
kubectl apply -k deployment/k8s/Or apply manifests directly:
kubectl apply -f deployment/k8s/deployment.yaml
kubectl apply -f deployment/k8s/service.yaml
kubectl apply -f deployment/k8s/ingress.yamlEdit deployment/k8s/kustomization.yaml to customize the image:
images:
- name: statuspost
newName: your-registry/statuspost
newTag: v1.0.0Edit deployment/k8s/ingress.yaml to set your hostname:
spec:
rules:
- host: your-domain.comGitHub Actions automatically builds and pushes the Docker image to ghcr.io on:
- Push to
mainbranch → tagged asmain - Version tags (
v*) → tagged as version (e.g.,v1.0.0→1.0.0) - Pull requests → build only (no push)