# Health App

Service health monitoring for Dexxy.

## Purpose

This app provides a health check endpoint for container orchestration and load balancers. It enables Kubernetes liveness/readiness probes and monitoring systems to verify the service is operational.

## Views

### `health_view`

Simple health check endpoint.

**Endpoint:** `GET /health/` or `HEAD /health/`

**Response:**
```json
{"status": "ok"}
```

**Status Codes:**
- `200 OK` - Service is healthy

## Usage

### Kubernetes Probes

```yaml
livenessProbe:
  httpGet:
    path: /health/
    port: 8000
  initialDelaySeconds: 5
  periodSeconds: 10

readinessProbe:
  httpGet:
    path: /health/
    port: 8000
  initialDelaySeconds: 5
  periodSeconds: 5
```

### Load Balancer Health Check

Configure your load balancer to check `/health/` and expect a `200` response.

## Key Patterns

1. **Minimal Response**: Fast, lightweight check
2. **HEAD Support**: Efficient probing without body
3. **No Authentication**: Accessible without credentials
4. **No Database**: Doesn't verify DB connection (fast path)

## Future Enhancements

For deeper health checks, consider:
- Database connectivity check
- Redis connectivity check
- Background worker status
- Disk space monitoring

These would be separate endpoints (e.g., `/health/ready/`) to keep the basic liveness check fast.

## Dependencies

None - Standalone health check

## File Structure

```
core/health/
├── views.py       # health_view function
├── apps.py        # Django app config
└── __init__.py
```

## URL Configuration

The health endpoint is registered in the core URL configuration:

```python
# core/urls.py
urlpatterns = [
    path("health/", health_view, name="health"),
    # ...
]
```
