
- Setup project structure with FastAPI - Create database models for users, gifts, preferences, and recommendations - Configure SQLite database with SQLAlchemy ORM - Setup Alembic for database migrations - Implement user authentication with JWT - Create API endpoints for users, gifts, preferences, and recommendations - Integrate OpenAI API for gift recommendations - Add comprehensive documentation
25 lines
571 B
Python
25 lines
571 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.db.deps import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("")
|
|
def health_check(db: Session = Depends(get_db)):
|
|
"""
|
|
Health check endpoint to verify API and database are running.
|
|
"""
|
|
try:
|
|
# Check if DB connection is working
|
|
db.execute("SELECT 1")
|
|
db_status = "healthy"
|
|
except Exception as e:
|
|
db_status = f"unhealthy: {str(e)}"
|
|
|
|
return {
|
|
"status": "healthy",
|
|
"database": db_status,
|
|
"version": "1.0.0"
|
|
} |