This commit is contained in:
Tobias Weise 2025-07-23 22:02:36 +02:00
commit 17d7f9751b
6 changed files with 1291 additions and 0 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
# Virtual environments
.venv

1
.python-version Normal file
View File

@ -0,0 +1 @@
3.12

0
README.md Normal file
View File

31
main.py Normal file
View File

@ -0,0 +1,31 @@
from fastapi import FastAPI
from nicegui import app as nicegui_app, ui
app = FastAPI()
@app.get('/')
def read_root():
return {'Hello': 'World'}
# Register a page with a custom path
@ui.page('/show')
def show():
# Your UI code goes here
ui.label('Hello, FastAPI!')
# Some bindings
ui.dark_mode().bind_value(nicegui_app.storage.user, 'dark_mode')
ui.checkbox('dark mode').bind_value(nicegui_app.storage.user, 'dark_mode')
# Integrate with your FastAPI Application
ui.run_with(
app=app,
storage_secret='pick your private secret here',
)

10
pyproject.toml Normal file
View File

@ -0,0 +1,10 @@
[project]
name = "nicegui-api-test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"fastapi[standard]>=0.116.1",
"nicegui>=2.21.1",
]

1239
uv.lock generated Normal file

File diff suppressed because it is too large Load Diff