
- Set up project structure with FastAPI application - Implement SQLAlchemy models for users, services, projects, team members, contacts - Create API endpoints for website functionality - Implement JWT authentication system with user roles - Add file upload functionality for media - Configure CORS and health check endpoints - Add database migrations with Alembic - Create comprehensive README with setup instructions
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, EmailStr, Field
|
|
|
|
|
|
# Shared properties
|
|
class SettingsBase(BaseModel):
|
|
site_name: Optional[str] = None
|
|
site_description: Optional[str] = None
|
|
contact_email: Optional[EmailStr] = None
|
|
contact_phone: Optional[str] = None
|
|
address: Optional[str] = None
|
|
facebook: Optional[str] = None
|
|
twitter: Optional[str] = None
|
|
linkedin: Optional[str] = None
|
|
instagram: Optional[str] = None
|
|
logo_path: Optional[str] = None
|
|
favicon_path: Optional[str] = None
|
|
|
|
|
|
# Properties to receive via API on creation
|
|
class SettingsCreate(SettingsBase):
|
|
site_name: str = Field(..., min_length=1, max_length=100)
|
|
contact_email: EmailStr
|
|
|
|
|
|
# Properties to receive via API on update
|
|
class SettingsUpdate(SettingsBase):
|
|
pass
|
|
|
|
|
|
class SettingsInDBBase(SettingsBase):
|
|
id: int
|
|
site_name: str
|
|
contact_email: EmailStr
|
|
created_at: datetime
|
|
updated_at: Optional[datetime] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
# Additional properties to return via API
|
|
class Settings(SettingsInDBBase):
|
|
pass |