Overview
Masar Eagle uses a combination ofappsettings.json files and environment variables for configuration. This guide covers all configuration options for each service.
Configuration follows the .NET configuration hierarchy: Environment Variables > appsettings..json > appsettings.json
Configuration Structure
Each service has its own configuration in itsappsettings.json file:
Global Configuration
Logging Configuration
All services use consistent logging configuration:- Environment Variable
- Docker Compose
OpenTelemetry Configuration
All services send telemetry to the OpenTelemetry Collector:Service Names
Service Names
user- Users Servicetrip- Trips Servicenotifications- Notifications Serviceidentity- Identity Servicegateway- API Gateway
Collector Configuration
Collector Configuration
The OpenTelemetry Collector forwards to:
- Prometheus: http://prometheus:9090/api/v1/otlp
- Jaeger: http://jaeger:4317
- Loki: http://loki:3100/otlp
Service-Specific Configuration
Identity Service
JWT Configuration Options
| Setting | Description | Default | Required |
|---|---|---|---|
SecretKey | HMAC signing key | Development key | Yes |
Issuer | Token issuer | masareagle.identity | Yes |
Audience | Token audience | masar-eagle-api | Yes |
AccessTokenExpiryMinutes | Token lifetime | 60 | Yes |
SMS Configuration Options
| Setting | Description | Options |
|---|---|---|
Provider | SMS provider | InMemory, Mock, Taqnyat |
OtpExpiryMinutes | OTP validity period | Default: 5 |
OtpLength | OTP code length | Default: 6 |
MaxOtpAttempts | Max verification attempts | Default: 5 |
MaxResendAttempts | Max resend attempts | Default: 3 |
ResendCooldownMinutes | Time between resends | Default: 1 |
Users Service
File Storage Options
- Local Storage
- Cloud Storage
Trips Service
Background Job Configuration
| Job | Cron Expression | Description |
|---|---|---|
| Trip Reminders | */5 * * * * | Send reminders 60min before trip |
| Auto-Cancel | */10 * * * * | Cancel trips 5h past scheduled time |
Notifications Service
Firebase configuration requires a service account JSON from the Firebase Console. Download it from Project Settings > Service Accounts.
Gateway Service
The gateway uses YARP (Yet Another Reverse Proxy) for routing. Service discovery is automatic when using .NET Aspire.
Database Configuration
Connection Strings
Connection strings are automatically configured by .NET Aspire:- Aspire (Automatic)
- Manual Configuration
AppHost.cs
Migration Configuration
Migrations run automatically on startup. To control migration behavior:Message Queue Configuration
RabbitMQ Connection
- Aspire Configuration
- Manual Configuration
AppHost.cs
Wolverine Configuration
Masar Eagle uses Wolverine for message handling:Environment-Specific Configuration
Development
Staging
Production
Secrets Management
Docker Secrets
docker-compose.yml
Azure Key Vault
Kubernetes Secrets
Health Checks
All services expose health check endpoints:Health Check Configuration
Performance Tuning
Connection Pooling
Caching
Validation
Validate your configuration:Next Steps
Docker Deployment
Deploy using Docker Compose
Aspire Deployment
Deploy with .NET Aspire