"""Main entry point for the MEDWingS backend.

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

from fastapi import FastAPI

from todo import config
from todo.routes.users import router as router_users, tag_metadata as tags_users
from todo.routes.todos import router as router_todos, tag_metadata as tags_todos
from todo.routes.auth import router as router_auth, tag_metadata as tags_auth
from todo.routes.admin import router as router_admin, tag_metadata as tags_admin


s = config.get_settings()
app = FastAPI(
    title=f"{s.app_name} API",
    description=f"This is the backend server API for {s.app_name}, a simple TODO-list application.",
    version=f"{s.app_version}",
    contact={
        "name": f"{s.contact_name}",
        "email": f"{s.contact_email}",
        "url": f"{s.contact_url}",
    },
    openapi_tags=[
        tags_users,
        tags_todos,
        tags_auth,
        tags_admin,
    ],
)

app.include_router(router_users)
app.include_router(router_todos)
app.include_router(router_auth)
app.include_router(router_admin)


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

    return "Hello World!"
