- Backend: FastAPI app with all models, services, schemas, routes - Admin Panel: Next.js dashboard with all modules (CRM, POS, repairs, warranties, billing, notifications, etc.) - Ecommerce: storefront (submodule) + product catalog - AI Agents: .agents/ skill library for Antigravity IDE - Docs: architecture, billing, notification gateway markdown - Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
68 lines
2.8 KiB
Python
68 lines
2.8 KiB
Python
import os
|
|
from pathlib import Path
|
|
from typing import Any
|
|
from pydantic_settings import BaseSettings
|
|
|
|
class Settings(BaseSettings):
|
|
RUNTIME_ENV: str = "development"
|
|
ENVIRONMENT: str = "development"
|
|
DATABASE_URL: str = "mysql+pymysql://Adithiyan:Adithiyan$2025Mysql@127.0.0.1:3306/ifixkartecommerceadmin"
|
|
CORE_DATABASE_URL: str = "mysql+pymysql://Adithiyan:Adithiyan$2025Mysql@127.0.0.1:3306/ifixkartecommerceadmin"
|
|
CRM_DATABASE_URL: str = "mysql+pymysql://Adithiyan:Adithiyan$2025Mysql@127.0.0.1:3306/ifixkartcrm"
|
|
COMMERCE_DATABASE_URL: str = "mysql+pymysql://Adithiyan:Adithiyan$2025Mysql@127.0.0.1:3306/ifixkartecommerce"
|
|
JWT_PRIVATE_KEY_PATH: str = "jwt_private.pem"
|
|
JWT_PUBLIC_KEY_PATH: str = "jwt_public.pem"
|
|
ALGORITHM: str = "RS512"
|
|
ACCESS_TOKEN_EXPIRE_MIN: int = 1440
|
|
REFRESH_TOKEN_EXPIRE_DAYS: int = 120
|
|
PROJECT_NAME: str = "iFixKart"
|
|
MAX_FAILED_LOGIN: int = 5
|
|
LOCKOUT_MINUTES: int = 15
|
|
SECRET_KEY: str
|
|
PUBLIC_API_KEY: str
|
|
GOOGLE_CLIENT_ID: str = ""
|
|
GOOGLE_CLIENT_SECRET: str = ""
|
|
GOOGLE_REDIRECT_URI: str = ""
|
|
RAZORPAY_KEY_ID: str = "rzp_test_TTUzPFYF0hRV89"
|
|
RAZORPAY_KEY_SECRET: str = "74tmlSkS4qK7zQaH1zclQfeH"
|
|
RAZORPAY_WEBHOOK_SECRET: str = "6TjjXgErPG3@ZpM"
|
|
RAZORPAY_ENABLED: bool = True
|
|
|
|
# ZeptoMail / Zoho CPaaS Configuration
|
|
ZEPTOMAIL_HOST: str = "smtp.zeptomail.in"
|
|
ZEPTOMAIL_API_ENDPOINT: str = "https://cpaas.zoho.in/v1.1/email"
|
|
ZEPTOMAIL_API_KEY: str = "PHtE6r0PQujsjDQnoBYH4aLsH8H3Z458+rtjKwcVuYcQWfVVF00G+d5+xzTl/UsqB/QTFPXPmolptuzP5bqHLW7pMWwfCGqyqK3sx/VYSPOZsbq6x00Zsl8dcEzdV4TtddNq0CDfv97TNA=="
|
|
EMAIL_SENDER_ADDRESS: str = "info@trionixsolution.com"
|
|
|
|
# Self-Hosted OpenWA WhatsApp Gateway Configuration
|
|
OPENWA_GATEWAY_URL: str = "http://localhost:8088"
|
|
OPENWA_MASTER_KEY: str = "owa_k1_df65037ea78c5ca9f19c63a6fb591e1d766581705c1dde392f098f6364387948"
|
|
|
|
# Redis Streams Event Bus Configuration
|
|
REDIS_URL: str = "redis://127.0.0.1:6379/0"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
extra = "ignore"
|
|
|
|
settings = Settings()
|
|
|
|
def load_private_key_bytes(path=None):
|
|
p = Path(path or settings.JWT_PRIVATE_KEY_PATH)
|
|
if not p.is_absolute():
|
|
# resolve relative to project root (parent of app directory)
|
|
project_root = Path(__file__).resolve().parents[3]
|
|
p = project_root / p
|
|
if not p.exists():
|
|
raise FileNotFoundError(f"Private key not found at {p}")
|
|
return p.read_bytes()
|
|
|
|
def load_public_key_bytes(path=None):
|
|
p = Path(path or settings.JWT_PUBLIC_KEY_PATH)
|
|
if not p.is_absolute():
|
|
# resolve relative to project root (parent of app directory)
|
|
project_root = Path(__file__).resolve().parents[3]
|
|
p = project_root / p
|
|
if not p.exists():
|
|
raise FileNotFoundError(f"Public key not found at {p}")
|
|
return p.read_bytes()
|