EstateHub

Environment Variables

EstateHub uses two configuration sources: deployment environment variables and settings stored through the Admin Dashboard. Environment variables provide infrastructure, security, and fallback integration values. The dashboard manages platform-facing settings without requiring a redeployment.

Configuration precedence

Configure Email, Storage, and Social Login through Admin Dashboard → Settings → Integrations. Integration configuration is encrypted in the database using PLATFORM_CONFIG_ENCRYPTION_KEY; keep that key stable and backed up. For Email and Storage, each non-empty value from an enabled integration takes precedence over its environment equivalent; missing values fall back to environment variables. Social Login can also use backend environment values when no dashboard integration is configured. General, Branding, and Commission settings are database-backed and do not use environment fallbacks.

Environment Configuration

EstateHub loads backend environment variables through python-dotenv. manage.py, WSGI, ASGI, and Celery default to core.settings.dev; production deployments must explicitly select core.settings.prod.

DOTENV
DJANGO_SETTINGS_MODULE=core.settings.dev
SECRET_KEY=<unique-long-random-value>
ALLOWED_HOSTS=127.0.0.1,localhost

DB_NAME=<postgres-database>
DB_USER=<postgres-user>
DB_PASSWORD=<postgres-password>
DB_HOST=127.0.0.1
DB_PORT=5432

Production settings include WhiteNoise for Django static files. Run collectstatic, use a production ASGI or WSGI process, and configure HTTPS before exposing the application publicly.

Security and public URLs

KeysPurpose
SECRET_KEYRequired by Django. Generate a unique value for each deployment and keep it server-side.
PLATFORM_CONFIG_ENCRYPTION_KEYEncrypts sensitive integration values stored in the database. It falls back to `SECRET_KEY`, but an explicit stable production value is recommended.
ALLOWED_HOSTSComma-separated host names accepted by Django. Do not include URL schemes.
CSRF_TRUSTED_ORIGINSComma-separated trusted origins including their URL schemes.
CORS_ALLOWED_ORIGINSComma-separated browser origins allowed to call the backend.
CORS_ALLOW_ALL_ORIGINSBoolean; defaults to false and should remain false in production.
CORS_ALLOW_CREDENTIALSBoolean; defaults to true.
PUBLIC_API_BASE_URLPublic backend origin used to build absolute protected-upload delivery URLs.
EMAIL_FRONTEND_URLFrontend origin used to build email-verification links, such as `/verify-email?token=...`.

DEBUG is read in base settings but forced to True by development settings and False by production settings. DB_ENGINE may appear in supplied environment files, but the current database settings do not read it.

Authentication tokens

  • JWT_ACCESS_TOKEN_MINUTES defaults to 1440 minutes.
  • JWT_REFRESH_TOKEN_DAYS defaults to 7 days.

General Platform Settings

Open Admin Dashboard → Settings → General at /admin/settings. These values are stored in the database:

  • Platform name
  • Default currency
  • Default language
  • Timezone
  • Support email

These settings do not come from environment variables. Save them after creating the initial administrator account.

Frontend Configuration

Configure the Next.js application in frontend/.env.local or through the frontend hosting provider. Variables prefixed with NEXT_PUBLIC_ are included in browser-delivered code and must never contain secrets.

KeyPurpose
NEXT_PUBLIC_API_BASE_URLFull REST API base URL, including the `/api/v1` namespace.
NEXT_PUBLIC_WS_BASE_URLWebSocket base URL used by realtime features.
NEXT_PUBLIC_SITE_URLPublic frontend origin used for metadata and canonical URLs.

Set frontend environment variables before running npm run build; public variables are compiled into the client bundle.

Storage and Media

Open Admin Dashboard → Settings → Integrations → Storage at /admin/settings/integrations/storage. Enable the integration and select one of the supported providers:

  • Google Cloud Storage
  • Amazon S3 or an S3-compatible service
  • Cloudinary
  • Azure Blob Storage

The upload service uses the enabled dashboard configuration first and falls back per value to these backend environment variables:

ProviderEnvironment variables
Shared`STORAGE_PROVIDER`, `STORAGE_MAKE_FILES_PRIVATE`, `STORAGE_ALLOWED_FILE_TYPES`
S3 / S3-compatible`STORAGE_BUCKET_NAME`, `STORAGE_REGION`, `STORAGE_ACCESS_KEY_ID`, `STORAGE_SECRET_ACCESS_KEY`, `STORAGE_ENDPOINT_URL`
Google Cloud Storage`STORAGE_BUCKET_NAME`, `STORAGE_PROJECT_ID`, `STORAGE_SERVICE_ACCOUNT_JSON`
Cloudinary`STORAGE_CLOUD_NAME`, `STORAGE_API_KEY`, `STORAGE_API_SECRET`
Azure Blob Storage`STORAGE_ACCOUNT_NAME`, `STORAGE_CONTAINER_NAME`, `STORAGE_CONNECTION_STRING`

Upload lifecycle settings are environment-only:

  • UPLOAD_PREPARATION_TTL_MINUTES defaults to 15.
  • UPLOAD_DELIVERY_TOKEN_TTL_SECONDS defaults to 300.
  • UPLOAD_PROVIDER_DOWNLOAD_TTL_SECONDS defaults to 300.
  • UPLOAD_UNATTACHED_RETENTION_HOURS defaults to 24.

Use private storage for identity documents, payment evidence, receipts, and other sensitive files. Keep provider credentials server-side.

Email Configuration

Open Admin Dashboard → Settings → Integrations → Email at /admin/settings/integrations/email. EstateHub supports SMTP, Resend, SendGrid, and Mailgun.

The enabled dashboard configuration takes precedence per value. Environment variables provide the fallback:

ProviderEnvironment variables
Shared`EMAIL_PROVIDER`, `DEFAULT_FROM_EMAIL`
SMTP`EMAIL_BACKEND`, `EMAIL_HOST`, `EMAIL_PORT`, `EMAIL_HOST_USER`, `EMAIL_HOST_PASSWORD`, `EMAIL_USE_TLS`, `EMAIL_USE_SSL`
Resend`RESEND_API_KEY`
SendGrid`SENDGRID_API_KEY`
Mailgun`MAILGUN_API_KEY`, `MAILGUN_DOMAIN`

Customer password recovery sends a six-digit code that expires after 10 minutes. Seller and administrator recovery use signed tokens. Email verification produces a frontend link when EMAIL_FRONTEND_URL is configured.

Send a test email to an actual inbox and check the selected provider's delivery logs.

Payment and Commission

Open Admin Dashboard → Settings → Financial Settings at /admin/settings to set property-sale and rental commission percentages and the purchase/rental reservation calculation type and value. Reservations support percentage or fixed charges, with a 2% default. These values are stored in the database.

Open Admin Dashboard → Settings → Integrations → Bank Transfer at /admin/settings/integrations/bank-transfer to store the receiving bank account and payment instructions. Sensitive account values are encrypted.

Purchase and lease workflows currently use manually reviewed bank-transfer evidence. Configure Bank Transfer settings in the administrator dashboard and verify the transfer details with the operator before accepting payments.

Maps Configuration

Open Admin Dashboard → Settings → Integrations → Maps at /admin/settings/integrations/maps to store a provider, API key, default coordinates, and enabled map features.

The current application can save and enable this integration, but runtime map and geospatial features do not yet read the stored configuration. Do not treat an enabled status as proof that Google Maps is connected.

Branding and Customization

Open Admin Dashboard → Settings → Branding at /admin/settings. Administrators can manage:

  • Platform logo
  • Favicon
  • Homepage hero image
  • Hero title
  • Hero description

Uploaded branding images use the configured Storage integration. For code-level theme and interface changes, see Extending EstateHub.

Social Authentication

Open Admin Dashboard → Settings → Integrations → Social Login at /admin/settings/integrations/oauth. Configure and enable the provider there. The frontend reads enabled public IDs from backend platform settings; it does not read separate NEXT_PUBLIC_GOOGLE_CLIENT_ID or NEXT_PUBLIC_FACEBOOK_APP_ID variables. Backend environment values below remain available as fallbacks when no dashboard integration is configured.

ProviderBackend environment fallbackFrontend behavior
Google`SOCIAL_AUTH_GOOGLE_OAUTH2_KEY`, `SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET`Shows a button when enabled with a public client ID.
Facebook`SOCIAL_AUTH_FACEBOOK_KEY`, `SOCIAL_AUTH_FACEBOOK_SECRET`Shows a button when enabled with a public app ID.

Allow the frontend origin or app domain in the provider console, then verify the complete browser-to-backend token flow. Keep provider secrets server-side.

Realtime and Background Services

AreaConfiguration
CacheReview the Django cache configuration and test account recovery across the processes used in your deployment.
ChannelsReview channel-layer configuration and test realtime delivery across your deployment processes.
CelerySet `CELERY_BROKER_URL` and `CELERY_RESULT_BACKEND`. Both default to `redis://localhost:6379/0`.

Configuration Checklist

  1. Set backend secrets, database values, allowed hosts, CORS, CSRF, and public URLs.
  2. Set frontend API, WebSocket, and site URLs before building Next.js; configure social login in the Admin Dashboard if needed.
  3. Create the administrator and save General, Branding, and Commission settings.
  4. Configure and enable Email and Storage, then test real delivery and upload access.
  5. Review Bank Transfer and Maps settings for your installation.
  6. Run python manage.py check, open /health/, and continue to First-time Setup.