
- Add requirements.txt with FastAPI, uvicorn, SQLAlchemy, alembic, python-multipart, and ruff - Create main.py with FastAPI app setup including CORS configuration - Set up app directory structure with api/, db/, models/, and schemas/ subdirectories - Add basic root endpoint with app info and health check endpoint - Configure CORS to allow all origins
14 lines
534 B
Python
14 lines
534 B
Python
from sqlalchemy import Column, Integer, String, Boolean, DateTime
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
|
|
class Todo(Base):
|
|
__tablename__ = "todos"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String, nullable=False)
|
|
description = Column(String, nullable=True)
|
|
completed = Column(Boolean, default=False, nullable=False)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now()) |