Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ BACKEND_CORS_ORIGINS="http://localhost:5173"
SECRET_KEY=changethis
FIRST_SUPERUSER=superuser@example.com
FIRST_SUPERUSER_PASSWORD=changethis
EMAIL_TEST_USER = test@example.com

# Emails

Expand Down Expand Up @@ -62,6 +63,7 @@ DOCKER_IMAGE_FRONTEND=frontend
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=ap-south-1
AWS_S3_BUCKET_PREFIX = "bucket-prefix-name"

# OpenAI

Expand Down
7 changes: 4 additions & 3 deletions backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Settings(BaseSettings):
SECRET_KEY: str = secrets.token_urlsafe(32)
# 60 minutes * 24 hours * 1 days = 1 days
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 1
FRONTEND_HOST: str = "http://localhost:5173"
FRONTEND_HOST: str
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need FRONTEND_HOST ?

Copy link
Copy Markdown
Collaborator Author

@nishika26 nishika26 Jun 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, hence I have removed it from config.py and everything else related to frontend configuration

ENVIRONMENT: Literal["local", "staging", "production"] = "local"

BACKEND_CORS_ORIGINS: Annotated[
Expand Down Expand Up @@ -96,18 +96,19 @@ def _set_default_emails_from(self) -> Self:
def emails_enabled(self) -> bool:
return bool(self.SMTP_HOST and self.EMAILS_FROM_EMAIL)

EMAIL_TEST_USER: EmailStr = "test@example.com"
EMAIL_TEST_USER: EmailStr
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is also to check if we are using these variables and if not then remove it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is being used in test cases for user and login routes

FIRST_SUPERUSER: EmailStr
FIRST_SUPERUSER_PASSWORD: str

AWS_ACCESS_KEY_ID: str = ""
AWS_SECRET_ACCESS_KEY: str = ""
AWS_DEFAULT_REGION: str = ""
AWS_S3_BUCKET_PREFIX: str = ""

@computed_field # type: ignore[prop-decorator]
@property
def AWS_S3_BUCKET(self) -> str:
return f"ai-platform-documents-{self.ENVIRONMENT}"
return f"{self.AWS_S3_BUCKET_PREFIX}-{self.ENVIRONMENT}"

LOG_DIR: str = os.path.join(os.path.dirname(os.path.dirname(__file__)), "logs")

Expand Down