Overview
EverShop uses a JSON-based configuration system with environment-specific overrides. Configuration files control extensions, themes, shop settings, and system behavior.Configuration Files
File Hierarchy
Configuration files are merged in order:
default.json → environment file → .env variables.Configuration Structure
Base Configuration (config/default.json)
Here’s the actual configuration from the project:config/default.json
Configuration Sections
Configuration Sections
Development Configuration
config/development.json
Development config typically includes:
- Debug flags
- Local database connections
- Development-only extensions
- Verbose logging
Production Configuration
config/production.json
Extension Configuration
Extension Object Structure
Real Examples
Adding New Extensions
To register a new extension:1
Create Extension Directory
2
Update config/default.json
3
Restart Development Server
Extensions are loaded in the order they appear in the configuration array.
Theme Configuration
Setting Active Theme
config/default.json
themes/anasuplements/.
Switching Themes
Shop Configuration
Language Settings
Currency Settings
USD- US DollarEUR- EuroGBP- British PoundCAD- Canadian Dollar- And more…
Environment Variables
.env File
Sensitive configuration goes in.env (never commit this file):
.env
Accessing Environment Variables
Advanced Configuration
Conditional Extension Loading
You can enable/disable extensions per environment:Extension-Specific Configuration
Extensions can read custom config:config/default.json
extensions/emailNotifications/src/bootstrap.ts
Configuration Best Practices
1. Never Hardcode Secrets
1. Never Hardcode Secrets
❌ Bad:✅ Good:
2. Use Environment-Specific Overrides
2. Use Environment-Specific Overrides
Keep
default.json minimal and override in environment files:config/default.json
config/production.json
3. Document Extension Dependencies
3. Document Extension Dependencies
If extensions depend on each other, document the required load order:
4. Version Control Strategy
4. Version Control Strategy
Troubleshooting
Extension Not Loading
1
Check Configuration
Verify extension is registered in
config/default.json:2
Verify Path
Ensure the
resolve path is correct:3
Check Enabled Flag
Make sure
"enabled": true4
Rebuild
Theme Not Applying
1
Check Theme Name
2
Verify Theme Directory
3
Rebuild Theme
Configuration Not Merging
Config files merge using deep merge:
Configuration API
Reading Configuration in Code
Setting Configuration Programmatically
Example Configurations
Minimal Setup
config/default.json
Full Production Setup
config/production.json
Next Steps
System Architecture
Learn how extensions and themes work together
Create Extension
Build your first extension