-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Priority: HIGH
Severity: Production Blocker
Identified in: Design QA Review (2026-01-10)
Locations: Multiple dashboard files
Description
API base URLs are hardcoded in JavaScript, preventing deployment to different environments without code changes. This blocks production deployment and creates inconsistent behavior between dashboards.
Current State
login.html:276
const API_BASE = 'http://localhost:8000';dashboard.html:1884
const API_BASE = 'http://localhost:8000';governance_dashboard.html:783
const API_BASE = ''; // Same originProblems
- Deployment Blocker: Cannot deploy to staging/production without modifying code
- Inconsistent Behavior: Three dashboards use different approaches
- Security Risk: HTTP hardcoded instead of HTTPS for production
- No Environment Separation: Dev/staging/production all require code changes
Recommended Solution
1. Create Environment Configuration System
Create config.js:
// config.js - Load from environment or defaults
window.LEXECON_CONFIG = {
API_BASE: window.ENV?.API_BASE ||
(window.location.hostname === 'localhost'
? 'http://localhost:8000'
: `${window.location.protocol}//${window.location.host}/api`),
ENVIRONMENT: window.ENV?.ENVIRONMENT || 'production'
};2. Update All Dashboards
Replace hardcoded URLs with:
const API_BASE = window.LEXECON_CONFIG.API_BASE;3. Environment-Specific Configuration
Development:
<script>
window.ENV = {
API_BASE: 'http://localhost:8000',
ENVIRONMENT: 'development'
};
</script>
<script src="config.js"></script>Production:
<script>
window.ENV = {
API_BASE: 'https://api.lexecon.app',
ENVIRONMENT: 'production'
};
</script>
<script src="config.js"></script>Implementation Steps
- Create
config.jswith environment configuration system - Update
login.htmlto use config - Update
dashboard.htmlto use config - Update
governance_dashboard.htmlto use config - Update deployment scripts to inject environment-specific config
- Test in dev, staging, and production environments
- Document configuration in deployment guide
Acceptance Criteria
- No hardcoded API URLs in any JavaScript files
- Configuration works in dev, staging, and production
- HTTPS enforced in production
- Consistent approach across all dashboards
- Environment configuration documented
Files to Update
- Create:
/frontend/public/config.js - Update:
login.html - Update:
dashboard.html - Update:
governance_dashboard.html - Update:
docs/PRODUCTION_DEPLOYMENT.md
Related Documentation
- See:
docs/PRODUCTION_DEPLOYMENT.md - See: Design QA Report Issue 🗺️ Lexecon Development Roadmap #3
Labels
configuration, high-priority, production-blocker, devops