1a0b4dc25d
- Add configurable profile questions with conditional visibility, admin-only fields, user answers, and seeded onboarding/volunteer questions
- Add admin UI for managing profile questions and member profile answers
- Add volunteer level/profile data support across backend schemas, models, API, and migration
- Update dashboard/profile UI, super admin menu, membership service types, and related styling
- Add privacy policy, terms of service, cookie notice, and footer links
- Add frontend Vitest coverage for profile question logic
- Add backend pytest coverage for profile answer normalization and validation
- Update restart.sh to build, run frontend/backend unit tests, and restart only after tests pass
- Refresh README, quickstart, project structure, instructions, and Square docs to match current app features
- Protect feature flag reload behind super-admin access
- Restrict admin-triggered password resets so admins can only reset member accounts
- Replace email template HTML preview rendering with escaped text preview
- Update docs for feature flag reload access, password reset scope, and email template preview safety
-- test user questions are also made by AI and not very useful. but i didn't know what to put there so its good enough for a test
-- all tests pass on my vm and seems to run fine
63 lines
1.7 KiB
Python
63 lines
1.7 KiB
Python
from pathlib import Path
|
|
from typing import List
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[3]
|
|
BACKEND_ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# Application
|
|
APP_NAME: str = "Swansea Airport Stakeholders Alliance"
|
|
APP_VERSION: str = "1.0.0"
|
|
DEBUG: bool = True
|
|
ENVIRONMENT: str = "development"
|
|
|
|
# API
|
|
API_V1_PREFIX: str = "/api/v1"
|
|
SECRET_KEY: str
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# Database
|
|
DATABASE_HOST: str
|
|
DATABASE_PORT: int = 3306
|
|
DATABASE_USER: str
|
|
DATABASE_PASSWORD: str
|
|
DATABASE_NAME: str
|
|
|
|
@property
|
|
def DATABASE_URL(self) -> str:
|
|
return f"mysql+pymysql://{self.DATABASE_USER}:{self.DATABASE_PASSWORD}@{self.DATABASE_HOST}:{self.DATABASE_PORT}/{self.DATABASE_NAME}"
|
|
|
|
# Square Payment
|
|
SQUARE_ACCESS_TOKEN: str
|
|
SQUARE_ENVIRONMENT: str = "sandbox"
|
|
SQUARE_LOCATION_ID: str
|
|
SQUARE_APPLICATION_ID: str
|
|
|
|
# Email
|
|
SMTP2GO_API_KEY: str
|
|
SMTP2GO_API_URL: str = "https://api.smtp2go.com/v3/email/send"
|
|
EMAIL_FROM: str
|
|
EMAIL_FROM_NAME: str
|
|
FRONTEND_URL: str = "http://localhost:3500"
|
|
|
|
# CORS
|
|
BACKEND_CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8080", "https://members.sasalliance.org"]
|
|
|
|
# File Storage
|
|
UPLOAD_DIR: str = "/app/uploads"
|
|
MAX_UPLOAD_SIZE: int = 10485760 # 10MB
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=(PROJECT_ROOT / ".env", BACKEND_ROOT / ".env", ".env"),
|
|
case_sensitive=True,
|
|
extra="ignore",
|
|
)
|
|
|
|
|
|
settings = Settings()
|