Why Configuration Management?
Instead of hardcoding URLs in the mobile app or backend code, this system:- Enables Dynamic Updates: Change URLs instantly without app updates
- Provides Audit Trail: Track who changed what and when
- Ensures Consistency: Single source of truth across all platforms
- Improves Flexibility: Support multiple environments or A/B testing
- Maintains Security: Protected by backend secret authentication
Configuration Types
System URLs
Legal and support-related URLs displayed in the app:- Terms and Conditions: Legal terms users must agree to
- Privacy Policy: Data privacy and handling information
- FAQs: Help and support documentation
- Support Email: Contact email for customer support
- Settings screens
- Signup/onboarding flows
- Help sections
- Legal compliance requirements
Social Media URLs
Links to Handa Uncle’s social media profiles:- Facebook: Company Facebook page
- Instagram: Brand Instagram profile
- LinkedIn: Company LinkedIn page
- Twitter/X: Official Twitter/X account
- Social sharing features
- Connect/follow prompts
- About/info screens
- Footer links
Retrieving Configuration
Get All Configuration
The simplest way to get both system and social media URLs:Get Specific Configuration
You can also retrieve system URLs or social media URLs separately:GET /app/config/system-urls- System URLs onlyGET /app/config/social-media-urls- Social media URLs only
Updating Configuration
Update System URLs
Update one or more system URLs:cURL
Node.js
Python
Update Social Media URLs
Update one or more social media URLs:cURL
Node.js
Python
Authentication
All update endpoints require thex-backend-secret header:
Request Headers
BACKEND_SECRET environment variable on the server.
Getting Your Backend Secret:
- Set in
.envfile:BACKEND_SECRET=your-secret-here - Generate a secure secret:
openssl rand -base64 32 - Keep it secure - never commit to version control
x-user-id to track who made the change in the audit trail.
Validation Rules
URL Validation
All URLs must:- Start with
http://orhttps:// - Be properly formatted according to URL standards
- Be accessible (no broken links recommended)
400 Bad Request error.
Email Validation
Support email must:- Follow standard email format:
user@domain.com - Contain valid characters
- Have a proper domain
400 Bad Request error.
Default Values
The system initializes with these defaults on first startup: System URLs:Database Structure
Configuration is stored in theapp_configuration MongoDB collection:
Audit Trail
Every configuration update is logged with:- Timestamp: When the change was made
- User ID: Who made the change (from
x-user-idheader) - Updated Fields: Which URLs were modified
Integration with App Launch
The App Launch endpoint automatically includes the latest configuration:Error Handling
Database Unavailable
If MongoDB is unavailable, the system falls back to default values:- App continues to function
- Warning is logged
- Defaults are returned to clients
Invalid Authentication
Missing or incorrectBACKEND_SECRET:
Validation Errors
Invalid URL or email format:Best Practices
Update Gradually
Update one configuration at a time to test changes and identify issues quickly.
Verify Links
Always verify URLs are working before updating to avoid broken links.
Track Changes
Use meaningful
x-user-id values to maintain a clear audit trail.Test First
Test URL changes in a staging environment before production.
Related Endpoints
Get Configuration
Retrieve all app configuration settings
Get System URLs
Get legal and support URLs
Get Social URLs
Get social media profile links
Update System URLs
Modify legal and support URLs
Update Social URLs
Modify social media links
App Launch
Mobile app initialization endpoint