55 lines
1.0 KiB
Markdown
55 lines
1.0 KiB
Markdown
# Gateway Service
|
|
|
|
WebSocket API gateway for vehicle (TRex), HMI, and mobile app connections.
|
|
|
|
## What it does
|
|
|
|
- Authenticates WebSocket connections via JWT
|
|
- Routes messages to Kafka topics
|
|
- Manages connection state in Redis
|
|
- Serves Swagger docs
|
|
|
|
## Ports
|
|
|
|
| Port | Purpose |
|
|
|------|---------|
|
|
| 8077 | HTTP/WebSocket |
|
|
| 11011 | Health check |
|
|
|
|
## WebSocket Endpoints
|
|
|
|
- `/ws/trex` - Vehicle connections
|
|
- `/ws/hmi` - HMI connections
|
|
- `/ws/mobile` - Mobile app connections
|
|
|
|
## Build
|
|
|
|
```bash
|
|
# Local
|
|
go build .
|
|
|
|
# Docker
|
|
docker build -t gateway -f Dockerfile ../..
|
|
```
|
|
|
|
## Run
|
|
|
|
```bash
|
|
# Required env vars
|
|
export KAFKA_HOSTS=localhost:9092
|
|
export REDIS_HOST=localhost
|
|
export JWK_URL=https://keycloak.example.com/realms/consumer/protocol/openid-connect/certs
|
|
|
|
./gateway
|
|
```
|
|
|
|
## Configuration
|
|
|
|
See `deploy/base/configmap-common.yaml` for all options.
|
|
|
|
Key settings:
|
|
- `KAFKA_HOSTS` - Kafka bootstrap servers
|
|
- `REDIS_HOST/PORT` - Redis for session state
|
|
- `JWK_URL` - JWKS endpoint for JWT validation
|
|
- `LOG_LEVEL` - debug, info, warn, error
|