- Add project structure with domain-driven design organization - Implement FastAPI endpoints for hotel booking reports - Add data cleaning, statistics, and LLM report generation services - Include configuration management and security utilities - Add repository layer for bookings and metadata access - Setup testing framework with conftest.py - Include example files and documentation
29 lines
725 B
Python
29 lines
725 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from nf_hotel_api.api.v1.router import api_router
|
|
from nf_hotel_api.core.config import get_settings
|
|
|
|
settings = get_settings()
|
|
|
|
app = FastAPI(
|
|
title="NF Hotel Analytics API",
|
|
description="Secure API for descriptive statistics and LLM-generated reports over NF Hotel bookings.",
|
|
version="0.1.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.allowed_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["GET", "POST"],
|
|
allow_headers=["X-API-Key", "Content-Type"],
|
|
)
|
|
|
|
app.include_router(api_router)
|
|
|
|
|
|
@app.get("/health", tags=["health"])
|
|
def health_check() -> dict[str, str]:
|
|
return {"status": "ok"}
|