Complete configuration guide for FinovaBank services.
- Environment Variables
- Application Configuration Files
- Service-Specific Configuration
- Database Configuration
- Security Configuration
- Monitoring Configuration
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| SPRING_PROFILES_ACTIVE | string | dev | Active Spring profile (dev, docker, prod) | env/file |
| JAVA_OPTS | string | "-Xmx512m" | JVM options for Java services | env |
| LOG_LEVEL | string | INFO | Logging level (DEBUG, INFO, WARN, ERROR) | env/file |
| TZ | string | UTC | Timezone for all services | env |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| EUREKA_SERVER_URL | string | http://localhost:8001/eureka/ | Eureka server URL | env/file |
| EUREKA_SERVER_PORT | integer | 8001 | Eureka server port | env/file |
| EUREKA_INSTANCE_HOSTNAME | string | localhost | Instance hostname | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| API_GATEWAY_PORT | integer | 8002 | API Gateway port | env/file |
| JWT_SECRET | string | changeme | JWT signing secret (CHANGE IN PRODUCTION) | env/file |
| JWT_EXPIRATION_TIME | integer | 3600000 | JWT expiration (ms) | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| AUTH_SERVICE_PORT | integer | 8011 | Auth service port | env/file |
| JWT_SECRET | string | (required) | JWT secret key | env/file |
| ACCESS_TOKEN_EXPIRATION | integer | 3600 | Access token lifetime (seconds) | env/file |
| REFRESH_TOKEN_EXPIRATION | integer | 86400 | Refresh token lifetime (seconds) | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| DB_URL | string | jdbc:postgresql://localhost:5432/finovabank | Database URL | env/file |
| DB_USERNAME | string | finova_user | Database username | env/file |
| DB_PASSWORD | string | finova_password | Database password | env/file |
| DB_DRIVER | string | org.postgresql.Driver | JDBC driver class | env/file |
| DB_MAX_POOL_SIZE | integer | 20 | Max connection pool size | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| REDIS_HOST | string | localhost | Redis server host | env/file |
| REDIS_PORT | integer | 6379 | Redis server port | env/file |
| REDIS_PASSWORD | string | null | Redis password (optional) | env/file |
| REDIS_TIMEOUT | integer | 2000 | Connection timeout (ms) | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| KAFKA_BOOTSTRAP_SERVERS | string | localhost:9092 | Kafka broker addresses | env/file |
| KAFKA_GROUP_ID | string | finovabank-group | Consumer group ID | env/file |
| KAFKA_AUTO_OFFSET_RESET | string | earliest | Offset reset strategy | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| AI_SERVICE_PORT | integer | 8090 | AI service port | env |
| FLASK_ENV | string | production | Flask environment | env |
| SQLALCHEMY_DATABASE_URI | string | sqlite:///database/app.db | AI service database | env/file |
| SECRET_KEY | string | (required) | Flask secret key | env/file |
| Option | Type | Default | Description | Where to set |
|---|---|---|---|---|
| REACT_APP_API_BASE_URL | string | http://localhost:8002 | Backend API URL | env/file |
| REACT_APP_WS_URL | string | ws://localhost:8002/ws | WebSocket URL | env/file |
| PORT | integer | 3000 | Web frontend port | env |
| REACT_NATIVE_API_BASE_URL | string | http://localhost:8002 | API for mobile app | env |
Location: backend/<service>/src/main/resources/application.yml
Example configuration structure:
server:
port: 8080
spring:
application:
name: service-name
datasource:
url: ${DB_URL}
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
jpa:
hibernate:
ddl-auto: update
show-sql: false
eureka:
client:
service-url:
defaultZone: ${EUREKA_SERVER_URL}
management:
endpoints:
web:
exposure:
include: health,info,metrics,prometheusapplication.yml- Default configurationapplication-dev.yml- Development profileapplication-docker.yml- Docker profileapplication-prod.yml- Production profile
Activate via: SPRING_PROFILES_ACTIVE=prod
File: backend/eureka-server/src/main/resources/application.yml
server:
port: ${EUREKA_SERVER_PORT:8001}
spring:
application:
name: eureka-server
eureka:
client:
register-with-eureka: false
fetch-registry: false
server:
enable-self-preservation: true
eviction-interval-timer-in-ms: 60000File: backend/api-gateway/src/main/resources/application.yml
server:
port: ${API_GATEWAY_PORT:8002}
spring:
application:
name: api-gateway
cloud:
gateway:
routes:
- id: auth-service
uri: lb://auth-service
predicates:
- Path=/api/auth/**
jwt:
secret: ${JWT_SECRET}
expiration-time: ${JWT_EXPIRATION_TIME:3600000}File: backend/account-management/src/main/resources/application.yml
server:
port: ${ACCOUNT_MANAGEMENT_PORT:8081}
spring:
application:
name: account-management
datasource:
url: ${DB_URL:jdbc:postgresql://localhost:5432/finovabank_accounts}Environment variables:
# Main database
DB_URL=jdbc:postgresql://localhost:5432/finovabank
DB_USERNAME=finova_user
DB_PASSWORD=finova_password
# Per-service databases (optional)
AUTH_DB_URL=jdbc:postgresql://localhost:5432/finovabank_auth
ACCOUNTS_DB_URL=jdbc:postgresql://localhost:5432/finovabank_accounts
TRANSACTIONS_DB_URL=jdbc:postgresql://localhost:5432/finovabank_transactionsspring:
datasource:
hikari:
maximum-pool-size: 20 # Max connections
minimum-idle: 5 # Min idle connections
connection-timeout: 30000 # 30 seconds
idle-timeout: 600000 # 10 minutes
max-lifetime: 1800000 # 30 minutesspring:
jpa:
hibernate:
ddl-auto: update # Options: none, validate, update, create, create-drop
show-sql: false # Log SQL queries
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
jdbc:
batch_size: 20
order_inserts: true
order_updates: trueapp:
jwt:
secret: ${JWT_SECRET:myVerySecureSecretKey123456789!@#$%^&*()}
access-token-expiration: 3600 # 1 hour in seconds
refresh-token-expiration: 86400 # 24 hours in secondsIMPORTANT: Change JWT_SECRET in production to a strong random string.
Generate secure secret:
openssl rand -base64 64spring:
security:
cors:
allowed-origins: "*" # Restrict in production
allowed-methods: GET,POST,PUT,DELETE
allowed-headers: "*"
allow-credentials: true
max-age: 3600server:
ssl:
enabled: true
key-store: classpath:keystore.p12
key-store-password: ${SSL_KEYSTORE_PASSWORD}
key-store-type: PKCS12
key-alias: finovabankmanagement:
endpoints:
web:
exposure:
include: health,info,metrics,prometheus
base-path: /actuator
endpoint:
health:
show-details: always # Options: never, when-authorized, always
metrics:
export:
prometheus:
enabled: trueFile: monitoring/prometheus/prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: "spring-boot-services"
metrics_path: "/actuator/prometheus"
static_configs:
- targets:
- "api-gateway:8002"
- "auth-service:8011"
- "account-management:8081"File: monitoring/grafana/datasource.yml
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: trueFile: docker-compose.yml
Key configurations:
services:
eureka-server:
environment:
- EUREKA_SERVER_PORT=8001
ports:
- "8001:8001"
networks:
- finova-network
api-gateway:
environment:
- EUREKA_SERVER_URL=http://eureka-server:8001/eureka/
- API_GATEWAY_PORT=8002
- SPRING_PROFILES_ACTIVE=docker
depends_on:
eureka-server:
condition: service_healthyFile: infrastructure/kubernetes/values.yaml
replicaCount: 2
image:
repository: finovabank
pullPolicy: IfNotPresent
tag: "latest"
service:
type: ClusterIP
port: 8080
ingress:
enabled: true
className: nginx
hosts:
- host: api.finovabank.com
paths:
- path: /
pathType: Prefix
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 80-
Development:
- Use H2 in-memory database
- Enable SQL logging
- Relaxed security
- Debug logging
-
Docker:
- Use service names for URLs
- Enable health checks
- Container-optimized settings
-
Production:
- PostgreSQL with connection pooling
- Disable SQL logging
- Strict security
- INFO/WARN logging only
- Enable monitoring
- Never commit secrets to version control
- Use environment variables or secrets management
- Rotate credentials regularly
- Use strong passwords (min 16 characters)
- Enable SSL/TLS in production
- Implement rate limiting
- Configure CORS properly
# JVM Options
JAVA_OPTS: "-Xmx1g -Xms512m -XX:MaxMetaspaceSize=256m"
# Database Connection Pool
hikari:
maximum-pool-size: 20
minimum-idle: 10
# Caching
spring:
cache:
type: redis
redis:
time-to-live: 600000 # 10 minutes# Test database connection
./scripts/finovabank_db.sh status
# Verify service registration
curl http://localhost:8001/eureka/apps
# Check health endpoints
curl http://localhost:8002/actuator/health
curl http://localhost:8011/actuator/health| Service | Config File Path |
|---|---|
| Eureka Server | backend/eureka-server/src/main/resources/application.yml |
| API Gateway | backend/api-gateway/src/main/resources/application.yml |
| Auth Service | backend/auth-service/src/main/resources/application.yml |
| Account Management | backend/account-management/src/main/resources/application.yml |
| AI Service | backend/ai-service/src/main.py |
| Web Frontend | web-frontend/.env |
| Mobile Frontend | mobile-frontend/.env |
Common issues:
- Service won't start: Check port conflicts, database connectivity
- Can't connect to Eureka: Verify EUREKA_SERVER_URL
- Database errors: Check credentials and URL format
- JWT errors: Ensure JWT_SECRET is consistent across services
- CORS issues: Configure allowed origins properly
See TROUBLESHOOTING.md for detailed solutions.
- INSTALLATION.md - Installation guide
- USAGE.md - Usage instructions
- CLI.md - CLI reference
- TROUBLESHOOTING.md - Problem solving