
- FastAPI application with user management, destinations, and trip planning - SQLite database with SQLAlchemy ORM - Database models for Users, Destinations, and Trips - Pydantic schemas for request/response validation - Full CRUD API endpoints for all resources - Alembic migrations setup - Health check endpoint - CORS configuration for development - Comprehensive documentation and README
19 lines
688 B
Python
19 lines
688 B
Python
from sqlalchemy import Column, Integer, String, DateTime, Boolean
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from app.db.base import Base
|
|
|
|
|
|
class User(Base):
|
|
__tablename__ = "users"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
email = Column(String, unique=True, index=True, nullable=False)
|
|
full_name = Column(String, nullable=False)
|
|
hashed_password = Column(String, nullable=False)
|
|
is_active = Column(Boolean, default=True)
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
|
|
|
trips = relationship("Trip", back_populates="user")
|