Social Media Backend uses pydantic-settings to load all runtime configuration from environment variables or aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/pvnm4/Social-Media-Backend/llms.txt
Use this file to discover all available pages before exploring further.
.env file placed in the project root (the directory containing pyproject.toml). Every variable listed below is required — the application calls Settings() at import time and will raise a ValidationError and refuse to start if any variable is absent or incorrectly typed.
Environment file template
Copy the block below into a file named.env in the project root and fill in your values before starting the server.
.env
Variable reference
Database connection
The application constructs the SQLAlchemy connection URL internally from the five individual database variables below. There is noDATABASE_URL variable in the Settings class — do not set one in your .env file.
JWT authentication
How settings are loaded
TheSettings class in app/config.py inherits from pydantic_settings.BaseSettings. At startup, pydantic-settings reads variables from the process environment first, then falls back to the .env file declared in the inner Config class:
settings singleton is imported throughout the application (e.g. in database.py and oauth2.py), so it is evaluated once at import time. Any missing or mis-typed variable causes an immediate startup failure with a descriptive validation error.