Automated Action 980400187c Create FastAPI backend for communications agency website
- 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
2025-06-10 11:00:53 +00:00

44 lines
988 B
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
# Shared properties
class ServiceBase(BaseModel):
title: Optional[str] = None
slug: Optional[str] = None
description: Optional[str] = None
icon: Optional[str] = None
image_path: Optional[str] = None
is_active: Optional[bool] = True
order: Optional[int] = 0
# Properties to receive via API on creation
class ServiceCreate(ServiceBase):
title: str = Field(..., min_length=1, max_length=100)
slug: str = Field(..., min_length=1, max_length=100)
description: str
# Properties to receive via API on update
class ServiceUpdate(ServiceBase):
pass
class ServiceInDBBase(ServiceBase):
id: int
title: str
slug: str
description: str
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
# Additional properties to return via API
class Service(ServiceInDBBase):
pass