"""Main entry point for the MEDWingS backend.

This module defines the API routes provided by the backend.
"""

from fastapi import FastAPI

from backend import config
from backend.routes.devices import router as devices_router
from backend.routes.devices import tag_metadata as devices_tags
from backend.routes.users import router as users_router
from backend.routes.users import tag_metadata as users_tags
from backend.routes.records import router as records_router
from backend.routes.records import tag_metadata as records_tags


s = config.get_settings()
app = FastAPI(
    title=f"{s.app_name} backend API",
    description=f"This is the backend server API for {s.app_name}, a remote patient monitoring and early warning system.",
    version=f"{s.app_version}",
    contact={
        "name": f"{s.contact_name}",
        "email": f"{s.contact_email}",
        "url": f"{s.contact_url}",
    },
    openapi_tags=[
        users_tags,
        devices_tags,
        records_tags,
    ],
)

app.include_router(devices_router)
app.include_router(users_router)
app.include_router(records_router)


@app.get("/hello/")
def hello():
    """Placeholder for a proper healthcheck endpoint."""

    return "Hello World!"
