Environment overview
Development
Active development and feature testing
Staging
Pre-production testing and QA validation
Alpha
Internal testing and stakeholder review
Production
Live customer-facing environment
Environment configurations
Development
Purpose: Active development and feature testing Infrastructure:- Windows Server instances on AWS
- Development SQL Server databases
- Development Identity Server
- Development payment processor sandbox
appsettings.Development.json
Key settings:
- API:
https://dev-api.chargeworx.com - Admin:
https://dev-admin.chargeworx.com
Staging
Purpose: Pre-production testing and QA validation Infrastructure:- Windows Server instances on AWS
- Staging SQL Server databases
- Staging Identity Server
- Payment processor test environment
appsettings.Staging.json
Key settings:
- API:
https://staging-api.chargeworx.com - Admin:
https://staging-admin.chargeworx.com
Alpha
Purpose: Internal testing and stakeholder review Infrastructure:- Windows Server instances on AWS
- Alpha SQL Server databases
- Alpha Identity Server
- Payment processor test environment
appsettings.Alpha.json
Key settings:
- API:
https://alpha-api.chargeworx.com - Admin:
https://alpha-admin.chargeworx.com
Production
Purpose: Live customer-facing environment Infrastructure:- Windows Server instances on AWS (multi-AZ)
- Production SQL Server databases (with replication)
- Production Identity Server (high availability)
- Live payment processor credentials
appsettings.Production.json
Key settings:
- API:
https://api.chargeworx.com - Admin:
https://admin.chargeworx.com
Configuration management
Application settings
Each environment uses environment-specific configuration files that override base settings inappsettings.json.
Configuration hierarchy:
appsettings.json- Base configurationappsettings.{Environment}.json- Environment-specific overrides- Environment variables - Runtime overrides
- AWS Secrets Manager - Sensitive credentials
Database connections
The platform uses four separate databases:- ChargeworxDb
- ChargeworxCreditCardDb
- ChargeworxReportDb
- ChargeworxKeyDb
Main application databaseContains:
- Companies and projects
- Users and authentication
- Transactions
- Payment processors
- Background processes
Identity Server configuration
Each environment has its own Identity Server instance:Payment processor configuration
Payment processors use environment-specific credentials: CyberSource:Secrets management
Sensitive configuration values are stored in AWS Secrets Manager:Storing secrets
Retrieving secrets
The application retrieves secrets at startup:Environment promotion
Development → Staging
- Merge feature branch to
develop - Verify development deployment
- Create release branch:
sharpdev/release/v{version} - Automatic deployment to Staging
- Run QA test suite
- Verify functionality
Staging → Alpha
- Merge release branch to
sharpdev/main - Automatic deployment to Alpha
- Stakeholder review and testing
- Performance validation
- Security scan
Alpha → Production
- Create pull request from
sharpdev/maintomain - Require approvals from reviewers
- Merge to
mainbranch - Automatic deployment to Production
- Monitor deployment health
- Verify production functionality
Environment variables
Key environment variables used by the application:| Variable | Description | Example |
|---|---|---|
ASPNETCORE_ENVIRONMENT | Current environment name | Production |
AWS_REGION | AWS region for services | us-east-1 |
SECRETS_PREFIX | Prefix for Secrets Manager | chargeworx/production |
LOG_LEVEL | Logging verbosity | Information |
Monitoring and health checks
Health check endpoints
Each environment exposes health check endpoints:Application monitoring
- CloudWatch Logs - Application and IIS logs
- CloudWatch Metrics - Performance metrics
- SumoLogic - Centralized log aggregation
- AWS X-Ray - Distributed tracing
Troubleshooting
Configuration not loading
Configuration not loading
- Verify environment variable
ASPNETCORE_ENVIRONMENTis set correctly - Check configuration file exists in deployment directory
- Review application startup logs
- Verify file permissions
Database connection failures
Database connection failures
- Verify connection string in Secrets Manager
- Check database server accessibility
- Verify SQL Server authentication
- Review firewall rules and security groups
Identity Server authentication fails
Identity Server authentication fails
- Verify Authority URL is correct
- Check Identity Server is running
- Verify API credentials in Secrets Manager
- Review HTTPS certificate validity
Payment processor errors
Payment processor errors
- Verify processor credentials in Secrets Manager
- Check processor environment (test vs production)
- Review processor API endpoint configuration
- Verify merchant account status
Best practices
Configuration isolation
Never share credentials between environments
Secrets rotation
Regularly rotate sensitive credentials
Environment parity
Keep environments as similar as possible
Monitoring
Monitor all environments for issues
