# Platform Defaults

Default configurations organized by service and deployment mode.

## Directory Structure

```plaintext
defaults/
├── common/
│   ├── server-defaults.ncl       # Default server config
│   ├── database-defaults.ncl     # Default database config
│   ├── monitoring-defaults.ncl   # Default monitoring config
│   └── README.md
│
├── deployment/
│   ├── solo.ncl                  # Solo mode defaults
│   ├── multiuser.ncl             # Multiuser mode defaults
│   ├── enterprise.ncl            # Enterprise mode defaults
│   └── README.md
│
└── README.md
```

## Common Defaults

Applied to **all deployment modes**:

- `server-defaults.ncl` - HTTP server configuration (host, port, workers)
- `database-defaults.ncl` - Database connection (URL, credentials, pooling)
- `monitoring-defaults.ncl` - Observability settings (log level, metrics)

## Deployment Mode Defaults

Override common defaults for specific modes:

### Solo Mode (`deployment/solo.ncl`)
- Local deployment (127.0.0.1)
- Minimal resources
- File-based database
- Development configuration

### Multiuser Mode (`deployment/multiuser.ncl`)
- Network deployment (0.0.0.0)
- Team collaboration
- Remote SurrealDB
- Cost tracking enabled

### Enterprise Mode (`deployment/enterprise.ncl`)
- High availability (0.0.0.0)
- Maximum resources
- SurrealDB cluster
- Full observability

## Composition Pattern

```nickel
let common = import "defaults/common/server-defaults.ncl" in
let mode = import "defaults/deployment/multiuser.ncl" in
let user = import "user-config.ncl" in

# Merge: common → mode → user (later overrides earlier)
std.record.merge
  (std.record.merge common mode)
  user
```

## References

- Parent: `../README.md`
- Common schemas: `../schemas/common/README.md`
- Values: `../values/README.md`
