Complete configuration reference for PayNext platform services and components.
- Environment Variables
- Service Configuration
- Database Configuration
- Security Configuration
- Integration Configuration
Configuration file: backend/.env
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| SPRING_PROFILES_ACTIVE | string | dev | Active Spring profile (dev, test, prod) | .env file |
| JWT_SECRET | string | - | JWT signing secret (min 256 bits) | .env file (required) |
| EUREKA_CLIENT_SERVICEURL_DEFAULTZONE | string | http://localhost:8001/eureka/ | Eureka server URL | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| USER_DB_URL | string | jdbc:mysql://localhost:3306/user_db | User service database URL | .env file |
| USER_DB_USERNAME | string | root | Database username | .env file |
| USER_DB_PASSWORD | string | - | Database password | .env file (required) |
| PAYMENT_DB_URL | string | jdbc:mysql://localhost:3306/payment_db | Payment service database URL | .env file |
| PAYMENT_DB_USERNAME | string | root | Database username | .env file |
| PAYMENT_DB_PASSWORD | string | - | Database password | .env file (required) |
| FRAUD_DB_URL | string | jdbc:mysql://localhost:3306/fraud_detection_db | Fraud detection database URL | .env file |
| NOTIFICATION_DB_URL | string | jdbc:mysql://localhost:3306/notification_db | Notification service database URL | .env file |
| JPA_DDL_AUTO | string | update | JPA DDL mode (none, validate, update, create, create-drop) | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| MAIL_HOST | string | smtp.gmail.com | SMTP server host | .env file |
| MAIL_PORT | integer | 587 | SMTP server port | .env file |
| MAIL_USERNAME | string | - | SMTP username | .env file (required) |
| MAIL_PASSWORD | string | - | SMTP password/app password | .env file (required) |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| REDIS_HOST | string | localhost | Redis server host | .env file |
| REDIS_PORT | integer | 6379 | Redis server port | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| KAFKA_BOOTSTRAP_SERVERS | string | localhost:9092 | Kafka bootstrap servers | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| EUREKA_PORT | integer | 8001 | Eureka server port | .env file |
| API_GATEWAY_PORT | integer | 8002 | API Gateway port | .env file |
| USER_SERVICE_PORT | integer | 8003 | User service port | .env file |
| PAYMENT_SERVICE_PORT | integer | 8004 | Payment service port | .env file |
| NOTIFICATION_SERVICE_PORT | integer | 8005 | Notification service port | .env file |
| FRAUD_DETECTION_SERVICE_PORT | integer | 8006 | Fraud detection service port | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| LOGGING_LEVEL_ROOT | string | INFO | Root logging level | .env file |
| LOGGING_LEVEL_FINTECH | string | DEBUG | Application logging level | .env file |
| Option | Type | Default | Description | Where to set (env/file) |
|---|---|---|---|---|
| SECURITY_ENABLED | boolean | true | Enable/disable security | .env file |
| H2_CONSOLE_ENABLED | boolean | true | Enable H2 console in dev mode | .env file |
| EUREKA_ENABLED | boolean | true | Enable/disable Eureka client | .env file |
File: backend/api-gateway/src/main/resources/application.properties
# Server
server.port=8002
# Eureka
eureka.client.service-url.defaultZone=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE:http://localhost:8001/eureka/}
eureka.instance.prefer-ip-address=true
# Application
spring.application.name=api-gateway
# JWT
jwt.secret=${JWT_SECRET:defaultSecretKeyForDevelopment}
jwt.expiration-time=3600000
# Web Application Type
spring.main.web-application-type=reactiveFile: backend/user-service/src/main/resources/application.properties
# Server
server.port=8003
# Database
spring.datasource.url=${USER_DB_URL}
spring.datasource.username=${USER_DB_USERNAME}
spring.datasource.password=${USER_DB_PASSWORD}
spring.jpa.hibernate.ddl-auto=${JPA_DDL_AUTO:update}
# Eureka
eureka.client.service-url.defaultZone=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
spring.application.name=user-serviceFile: backend/payment-service/src/main/resources/application.properties
# Server
server.port=8004
# Database
spring.datasource.url=${PAYMENT_DB_URL}
spring.datasource.username=${PAYMENT_DB_USERNAME}
spring.datasource.password=${PAYMENT_DB_PASSWORD}
# Redis Cache
spring.redis.host=${REDIS_HOST:localhost}
spring.redis.port=${REDIS_PORT:6379}
# Kafka
spring.kafka.bootstrap-servers=${KAFKA_BOOTSTRAP_SERVERS:localhost:9092}File: docker-compose.yml
Key configuration sections:
services:
api-gateway:
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://eureka-server:8001/eureka/
- JWT_SECRET=${JWT_SECRET:-changeme}
ports:
- "8002:8002"
networks:
- fintech-networkCreate .env file in project root:
# Docker configuration
COMPOSE_PROJECT_NAME=paynext
DOCKER_REGISTRY=docker.io
# Service versions
EUREKA_IMAGE_TAG=latest
GATEWAY_IMAGE_TAG=latestFile: infrastructure/kubernetes/values.yaml
# Global settings
global:
environment: production
registry: docker.io/quantsingularity
# Service replicas
replicaCount:
apiGateway: 3
userService: 2
paymentService: 3
# Resource limits
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
# Ingress
ingress:
enabled: true
host: api.paynext.com
tls:
enabled: true
secretName: paynext-tlsConnection String Format:
jdbc:mysql://<host>:<port>/<database>?useSSL=false&allowPublicKeyRetrieval=true
Recommended Settings:
# Connection pool
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=30000
# Performance
spring.jpa.properties.hibernate.jdbc.batch_size=20
spring.jpa.properties.hibernate.order_inserts=true
spring.jpa.properties.hibernate.order_updates=true# JWT Settings
jwt.secret=${JWT_SECRET}
jwt.expiration-time=3600000
jwt.refresh-expiration=86400000Generating Secure JWT Secret:
# Generate 256-bit secret
openssl rand -base64 32# CORS
cors.allowed-origins=http://localhost:3000,https://paynext.com
cors.allowed-methods=GET,POST,PUT,DELETE
cors.allowed-headers=*
cors.max-age=3600# Stripe
stripe.api.key=${STRIPE_API_KEY}
stripe.webhook.secret=${STRIPE_WEBHOOK_SECRET}
# PayPal
paypal.client.id=${PAYPAL_CLIENT_ID}
paypal.client.secret=${PAYPAL_CLIENT_SECRET}
paypal.mode=sandbox# Gmail SMTP
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=${MAIL_USERNAME}
spring.mail.password=${MAIL_PASSWORD}
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true# Fraud Detection Service
fraud.detection.url=http://localhost:5000
fraud.detection.timeout=5000
# Credit Scoring Service
credit.scoring.url=http://localhost:5005
credit.scoring.timeout=3000# prometheus.yml
scrape_configs:
- job_name: "paynext-services"
metrics_path: "/actuator/prometheus"
static_configs:
- targets:
- "api-gateway:8002"
- "user-service:8003"
- "payment-service:8004"# grafana-datasource.yml
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true# Production JVM settings
JAVA_OPTS="-Xms512m -Xmx1024m -XX:+UseG1GC -XX:MaxGCPauseMillis=200"# Actuator endpoints
management.endpoints.web.exposure.include=health,info,metrics,prometheus
management.endpoint.health.show-details=when-authorizedSPRING_PROFILES_ACTIVE=dev
JWT_SECRET=dev-secret-key-for-development-only
USER_DB_URL=jdbc:mysql://localhost:3306/user_db
PAYMENT_DB_URL=jdbc:mysql://localhost:3306/payment_db
MAIL_HOST=smtp.mailtrap.io
LOGGING_LEVEL_ROOT=DEBUGSPRING_PROFILES_ACTIVE=prod
JWT_SECRET=${SECRET_FROM_VAULT}
USER_DB_URL=jdbc:mysql://prod-db.example.com:3306/user_db
PAYMENT_DB_URL=jdbc:mysql://prod-db.example.com:3306/payment_db
MAIL_HOST=smtp.sendgrid.net
LOGGING_LEVEL_ROOT=INFO- Never commit
.envfiles - Use.env.exampleas template - Use environment-specific profiles - dev, test, prod
- Store secrets securely - Use vault services (AWS Secrets Manager, HashiCorp Vault)
- Validate configuration - Check configs before deployment
- Document all options - Keep configuration documented
- Use strong JWT secrets - Minimum 256-bit keys
- Enable SSL/TLS - Always in production
- Configure rate limiting - Protect against abuse
- Set connection timeouts - Prevent hanging connections
- Monitor configuration changes - Track config modifications
- Installation Guide - Setup instructions
- CLI Reference - Command-line tools
- Troubleshooting - Configuration issues