
- 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
20 lines
980 B
Python
20 lines
980 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from sqlalchemy import Boolean, DateTime, Integer, String
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from app.db.base_class import Base
|
|
|
|
|
|
class User(Base):
|
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, index=True)
|
|
email: Mapped[str] = mapped_column(String, unique=True, index=True, nullable=False)
|
|
full_name: Mapped[str] = mapped_column(String, index=True)
|
|
hashed_password: Mapped[str] = mapped_column(String, nullable=False)
|
|
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
|
is_superuser: Mapped[bool] = mapped_column(Boolean, default=False)
|
|
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
|
|
updated_at: Mapped[Optional[datetime]] = mapped_column(DateTime,
|
|
default=datetime.utcnow,
|
|
onupdate=datetime.utcnow) |