studyhub-app / studyhub /app /__main__.py
parhamkhoshsolat's picture
StudyHub web — custom Docker frontend (FastAPI + SPA)
8db761b verified
Raw
History Blame Contribute Delete
636 Bytes
from __future__ import annotations
from .auth import make_auth_fn, parse_users
from .config import load_settings
from .factory import build_service
from .ui import build_app
def main() -> None:
settings = load_settings()
service = build_service(settings)
users = parse_users(settings.app_users_raw)
demo = build_app(service, title=settings.title)
auth = make_auth_fn(users) if users else None
# auth gates the whole app; never use share=True (it would bypass the gate)
demo.queue(max_size=16).launch(auth=auth, server_name="0.0.0.0", server_port=7860, share=False)
if __name__ == "__main__":
main()