File size: 1,673 Bytes
e650b33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a2c567f
e650b33
 
 
 
 
 
 
 
 
 
 
 
 
a2c567f
e650b33
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
from pydantic_settings import BaseSettings
from pydantic import Field
from typing import Optional


class Settings(BaseSettings):
    """
    Application settings loaded from environment variables.
    """
    # Database settings
    database_url: str = Field(default="postgresql://postgres:postgres@localhost:5432/todoapp", alias="DATABASE_URL")

    # Authentication settings
    auth_secret: str = Field(default="dev_secret_for_development_do_not_use_in_production", alias="SECRET_KEY")
    jwt_algorithm: str = Field(default="HS256", alias="ALGORITHM")
    jwt_expiration_minutes: int = Field(default=10080, alias="ACCESS_TOKEN_EXPIRE_MINUTES")  # 7 days

    # Server settings
    server_host: str = Field(default="0.0.0.0", alias="SERVER_HOST")
    server_port: int = Field(default=8000, alias="SERVER_PORT")
    debug: bool = Field(default=True, alias="DEBUG")

    # CORS settings
    frontend_url: str = Field(default="https://full-stack-the-evolution-of-todo.vercel.app", alias="FRONTEND_URL")
    DATABASE_URL: str = "postgresql://neondb_owner:npg_LE9V4bojIRQD@ep-blue-block-ahgb84lf-pooler.c-3.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require"

    # Authentication settings
    AUTH_SECRET: str = "dev_secret_for_development_do_not_use_in_production"
    JWT_ALGORITHM: str = "HS256"
    JWT_EXPIRATION_MINUTES: int = 10080  # 7 days

    # Server settings
    SERVER_HOST: str = "0.0.0.0"
    SERVER_PORT: int = 8000
    DEBUG: bool = True

    # CORS settings
    FRONTEND_URL: str = "https://full-stack-the-evolution-of-todo.vercel.app"

    class Config:
        env_file = ".env"
        case_sensitive = True


settings = Settings()