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

47 lines
1.1 KiB
Python

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
# Shared properties
class ProjectBase(BaseModel):
title: Optional[str] = None
slug: Optional[str] = None
description: Optional[str] = None
client: Optional[str] = None
completion_date: Optional[datetime] = None
featured_image: Optional[str] = None
is_featured: Optional[bool] = False
is_active: Optional[bool] = True
# Properties to receive via API on creation
class ProjectCreate(ProjectBase):
title: str = Field(..., min_length=1, max_length=100)
slug: str = Field(..., min_length=1, max_length=100)
description: str
client: str = Field(..., min_length=1, max_length=100)
# Properties to receive via API on update
class ProjectUpdate(ProjectBase):
pass
class ProjectInDBBase(ProjectBase):
id: int
title: str
slug: str
description: str
client: str
created_at: datetime
updated_at: Optional[datetime] = None
class Config:
from_attributes = True
# Additional properties to return via API
class Project(ProjectInDBBase):
pass