Configuration¶
This guide covers configuring AzharStore for different environments.
Environment Variables¶
AzharStore uses environment variables for configuration. See Environment Variables for a complete reference.
Required Variables¶
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/medusa
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-jwt-secret
COOKIE_SECRET=your-cookie-secret
ADMIN_EMAIL=admin@azhar.store
ADMIN_PASSWORD=your-admin-password
CORS Configuration¶
STORE_CORS=http://localhost:3000,https://azhar.store
ADMIN_CORS=http://localhost:9000,https://admin.azhar.store
Development Configuration¶
For local development, use the .env.example as a template:
Edit with your local values:
- Use localhost for database and Redis
- Use local frontend URLs for CORS
- Use any strong secrets for JWT and cookies
Production Configuration¶
For production, create a production-specific .env:
Production considerations: - Use strong, randomly generated secrets - Use production database and Redis instances - Use production URLs for CORS - Enable HTTPS - Use environment-specific secrets management
Medusa Configuration¶
The medusa-config.ts file contains additional configuration:
- Database connection
- Redis event bus
- CORS settings
- Module registration
- Admin configuration
See the Infrastructure Guide for details.
Module Configuration¶
Custom modules are registered in medusa-config.ts:
modules: [
{
resolve: "./modules/advertisement"
},
{
resolve: "./modules/settings"
},
{
resolve: "./modules/translation"
}
]
Frontend Configuration¶
The frontend uses VITE_API_BASE_URL to configure the API endpoint:
Docker Configuration¶
Docker Compose configuration is in docker-compose.yml:
- Service definitions
- Volume mounts
- Network configuration
- Port mappings
- Environment variables
See the Docker Services guide for details.
Validation¶
After configuration, validate:
-
Check environment variables are loaded:
-
Test database connection:
-
Test Redis connection:
-
Test backend health: