shadlet 0.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. shadlet-0.1.1/.gitignore +119 -0
  2. shadlet-0.1.1/LICENSE +21 -0
  3. shadlet-0.1.1/PKG-INFO +263 -0
  4. shadlet-0.1.1/README.md +223 -0
  5. shadlet-0.1.1/packages/python/shadlet/__init__.py +260 -0
  6. shadlet-0.1.1/packages/python/shadlet/_json.py +108 -0
  7. shadlet-0.1.1/packages/python/shadlet/app/__init__.py +4 -0
  8. shadlet-0.1.1/packages/python/shadlet/app/app.py +225 -0
  9. shadlet-0.1.1/packages/python/shadlet/app/context.py +90 -0
  10. shadlet-0.1.1/packages/python/shadlet/assets/banner.svg +102 -0
  11. shadlet-0.1.1/packages/python/shadlet/assets/logo-32.png +0 -0
  12. shadlet-0.1.1/packages/python/shadlet/assets/logo-64.png +0 -0
  13. shadlet-0.1.1/packages/python/shadlet/assets/logo.png +0 -0
  14. shadlet-0.1.1/packages/python/shadlet/assets/logo.svg +4 -0
  15. shadlet-0.1.1/packages/python/shadlet/assets/shadlet-icon.svg +4 -0
  16. shadlet-0.1.1/packages/python/shadlet/cli/__init__.py +0 -0
  17. shadlet-0.1.1/packages/python/shadlet/cli/main.py +219 -0
  18. shadlet-0.1.1/packages/python/shadlet/components/__init__.py +199 -0
  19. shadlet-0.1.1/packages/python/shadlet/components/base.py +138 -0
  20. shadlet-0.1.1/packages/python/shadlet/components/display.py +701 -0
  21. shadlet-0.1.1/packages/python/shadlet/components/enums.py +180 -0
  22. shadlet-0.1.1/packages/python/shadlet/components/forms.py +527 -0
  23. shadlet-0.1.1/packages/python/shadlet/components/navigation.py +252 -0
  24. shadlet-0.1.1/packages/python/shadlet/components/options.py +108 -0
  25. shadlet-0.1.1/packages/python/shadlet/components/overlays.py +419 -0
  26. shadlet-0.1.1/packages/python/shadlet/components/typography.py +206 -0
  27. shadlet-0.1.1/packages/python/shadlet/events/__init__.py +22 -0
  28. shadlet-0.1.1/packages/python/shadlet/events/registry.py +62 -0
  29. shadlet-0.1.1/packages/python/shadlet/events/types.py +80 -0
  30. shadlet-0.1.1/packages/python/shadlet/layout/__init__.py +35 -0
  31. shadlet-0.1.1/packages/python/shadlet/layout/layout.py +395 -0
  32. shadlet-0.1.1/packages/python/shadlet/layout/values.py +108 -0
  33. shadlet-0.1.1/packages/python/shadlet/protocol/__init__.py +53 -0
  34. shadlet-0.1.1/packages/python/shadlet/protocol/models.py +214 -0
  35. shadlet-0.1.1/packages/python/shadlet/protocol/version.py +45 -0
  36. shadlet-0.1.1/packages/python/shadlet/runtime/__init__.py +13 -0
  37. shadlet-0.1.1/packages/python/shadlet/runtime/diff.py +51 -0
  38. shadlet-0.1.1/packages/python/shadlet/runtime/errors.py +22 -0
  39. shadlet-0.1.1/packages/python/shadlet/runtime/render.py +94 -0
  40. shadlet-0.1.1/packages/python/shadlet/runtime/session.py +375 -0
  41. shadlet-0.1.1/packages/python/shadlet/state/__init__.py +4 -0
  42. shadlet-0.1.1/packages/python/shadlet/state/state.py +60 -0
  43. shadlet-0.1.1/packages/python/shadlet/state/store.py +54 -0
  44. shadlet-0.1.1/packages/python/shadlet/templates/__init__.py +19 -0
  45. shadlet-0.1.1/packages/python/shadlet/templates/github.py +278 -0
  46. shadlet-0.1.1/packages/python/shadlet/web/__init__.py +0 -0
  47. shadlet-0.1.1/packages/python/shadlet/web/server.py +304 -0
  48. shadlet-0.1.1/packages/renderer/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  49. shadlet-0.1.1/packages/renderer/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  50. shadlet-0.1.1/packages/renderer/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  51. shadlet-0.1.1/packages/renderer/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  52. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  53. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  54. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  55. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  56. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  57. shadlet-0.1.1/packages/renderer/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  58. shadlet-0.1.1/packages/renderer/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  59. shadlet-0.1.1/packages/renderer/dist/assets/index-B5FX5UAO.css +1 -0
  60. shadlet-0.1.1/packages/renderer/dist/assets/index-S8TJoQ_W.js +114 -0
  61. shadlet-0.1.1/packages/renderer/dist/favicon.png +0 -0
  62. shadlet-0.1.1/packages/renderer/dist/index.html +20 -0
  63. shadlet-0.1.1/packages/renderer/dist/logo.png +0 -0
  64. shadlet-0.1.1/packages/renderer/dist/logo.svg +4 -0
  65. shadlet-0.1.1/pyproject.toml +91 -0
  66. shadlet-0.1.1/templates/dashboard/main.py +179 -0
  67. shadlet-0.1.1/templates/dashboard/shadlet-template.toml +13 -0
  68. shadlet-0.1.1/templates/landing-page/main.py +33 -0
  69. shadlet-0.1.1/templates/landing-page/shadlet-template.toml +13 -0
  70. shadlet-0.1.1/templates/minimal/README.md +3 -0
  71. shadlet-0.1.1/templates/minimal/main.py +25 -0
  72. shadlet-0.1.1/templates/minimal/pyproject.toml +5 -0
  73. shadlet-0.1.1/templates/minimal/shadlet-template.toml +13 -0
  74. shadlet-0.1.1/tooling/__init__.py +0 -0
  75. shadlet-0.1.1/tooling/compatibility/component-coverage.json +456 -0
  76. shadlet-0.1.1/tooling/compatibility/vendored-components.json +679 -0
@@ -0,0 +1,119 @@
1
+ # ==========================================
2
+ # Shadlet Monorepo Root .gitignore
3
+ # Python, Node/React, OS
4
+ # ==========================================
5
+
6
+ # --- Python ---
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ *.pyd
12
+ *.dll
13
+ *.dylib
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ /lib/
22
+ /lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Virtual environments
36
+ .env
37
+ .env.*
38
+ !.env.example
39
+ .venv
40
+ venv/
41
+ ENV/
42
+ env/
43
+ env.bak/
44
+ venv.bak/
45
+
46
+ # Python test, coverage & type checking
47
+ .pytest_cache/
48
+ .coverage
49
+ .coverage.*
50
+ htmlcov/
51
+ .tox/
52
+ .nox/
53
+ .hypothesis/
54
+ .mypy_cache/
55
+ .ruff_cache/
56
+
57
+ # --- Node / JavaScript / TypeScript / React ---
58
+ node_modules/
59
+ .npm
60
+ *.tsbuildinfo
61
+ .eslintcache
62
+ .turbo/
63
+ package-lock.json.bak
64
+ npm-debug.log*
65
+ yarn-debug.log*
66
+ yarn-error.log*
67
+ pnpm-debug.log*
68
+
69
+ # Vite / bundler temporary output
70
+ .cache/
71
+ packages/renderer/dist/
72
+ packages/renderer/.vite/
73
+
74
+
75
+
76
+
77
+ # --- MkDocs & Documentation ---
78
+ site/
79
+
80
+ # --- OS & Editor Specific ---
81
+ # Windows
82
+ Thumbs.db
83
+ Thumbs.db:encryptable
84
+ ehthumbs.db
85
+ ehthumbs_vista.db
86
+ [Dd]esktop.ini
87
+ $RECYCLE.BIN/
88
+ *.cab
89
+ *.msi
90
+ *.msix
91
+ *.msm
92
+ *.msp
93
+ *.lnk
94
+
95
+ # macOS
96
+ .DS_Store
97
+ .AppleDouble
98
+ .LSOverride
99
+ Icon
100
+ ._*
101
+ .Spotlight-V100
102
+ .Trashes
103
+
104
+ # Linux
105
+ *~
106
+ .fuse_hidden*
107
+ .directory
108
+ .Trash-*
109
+
110
+ # Editors and IDEs
111
+ .idea/
112
+ .vscode/
113
+ *.code-workspace
114
+ *.swp
115
+ *.swo
116
+ *~
117
+ *.bak
118
+ *.sublime-project
119
+ *.sublime-workspace
shadlet-0.1.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Soumalya Das and shadlet contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
shadlet-0.1.1/PKG-INFO ADDED
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.5
2
+ Name: shadlet
3
+ Version: 0.1.1
4
+ Summary: A Python-first web framework for building beautiful, interactive web applications with genuine shadcn/ui components
5
+ Project-URL: Homepage, https://github.com/programmersd21/shadlet
6
+ Project-URL: Documentation, https://github.com/programmersd21/shadlet#readme
7
+ Project-URL: Repository, https://github.com/programmersd21/shadlet
8
+ Author: shadlet Authors
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: framework,react,shadcn,shadcn-ui,ui,web
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
21
+ Classifier: Topic :: Software Development :: User Interfaces
22
+ Requires-Python: >=3.11
23
+ Requires-Dist: anyio>=4.0.0
24
+ Requires-Dist: pydantic>=2.0.0
25
+ Requires-Dist: rich>=13.0.0
26
+ Requires-Dist: starlette>=0.30.0
27
+ Requires-Dist: typer>=0.9.0
28
+ Requires-Dist: uvicorn[standard]>=0.20.0
29
+ Requires-Dist: websockets>=12.0
30
+ Provides-Extra: dev
31
+ Requires-Dist: build>=1.0.0; extra == 'dev'
32
+ Requires-Dist: httpx2>=0.28.0; extra == 'dev'
33
+ Requires-Dist: mypy>=1.10.0; extra == 'dev'
34
+ Requires-Dist: pyright>=1.1.0; extra == 'dev'
35
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
36
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
37
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
38
+ Requires-Dist: twine>=5.0.0; extra == 'dev'
39
+ Description-Content-Type: text/markdown
40
+
41
+ <div align="center">
42
+
43
+ ![banner](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/banner.png)
44
+
45
+ [![ci](https://img.shields.io/github/actions/workflow/status/programmersd21/shadlet/ci.yml?branch=main&label=ci&style=flat-square)](https://github.com/programmersd21/shadlet/actions/workflows/ci.yml)
46
+ [![docs](https://img.shields.io/github/actions/workflow/status/programmersd21/shadlet/docs.yml?branch=main&label=docs&style=flat-square)](https://github.com/programmersd21/shadlet/actions/workflows/docs.yml)
47
+ [![python](https://img.shields.io/badge/python-3.11%2B-3776ab?style=flat-square&logo=python&logoColor=white)](https://www.python.org/)
48
+ [![license](https://img.shields.io/github/license/programmersd21/shadlet?style=flat-square)](https://github.com/programmersd21/shadlet/blob/main/LICENSE)
49
+ [![pypi](https://img.shields.io/pypi/v/shadlet?style=flat-square)](https://pypi.org/project/shadlet/)
50
+ [![docs site](https://img.shields.io/badge/docs-online-5c4ee5?style=flat-square)](https://programmersd21.github.io/shadlet/)
51
+
52
+ **python-first web applications with a genuine shadcn/ui renderer.**
53
+
54
+ </div>
55
+
56
+ shadlet is a framework that lets developers build modern web applications in python. react renders the interface with authentic shadcn/ui components. python manages application state, events, routing and server-side logic. end users run applications with python only; node.js is only needed to build the renderer.
57
+
58
+ ## showcase
59
+
60
+ ![demo1](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/demo1.png)
61
+
62
+ ## why shadlet
63
+
64
+ - python developers can build web applications using pure python.
65
+ - the frontend is genuine shadcn/ui (tailwind + base-ui), not an imitation.
66
+ - components are strictly typed and validated across the protocol.
67
+ - reactive session state, async event handlers, and incremental patches.
68
+
69
+ ## comparison
70
+
71
+ | feature | shadlet | typical python web ui |
72
+ |---|---|---|
73
+ | rendering | react + authentic shadcn/ui | server-rendered templates |
74
+ | state | reactive session state | request/response state |
75
+ | components | 56 built-in shadcn/ui components | custom widget sets |
76
+ | packaging | python wheel with bundled renderer | manual frontend build |
77
+
78
+ ## features
79
+
80
+ - typed python component api with enums and validation
81
+ - 56 built-in components from shadcn/ui base-vega
82
+ - official bundled geist variable & geist mono typography
83
+ - smooth animations, backdrop blur, and spring physics
84
+ - automatic port switching when default port is occupied
85
+ - hot reload with diff-based patches
86
+ - session-scoped reactive state
87
+ - async event handlers with cancellation
88
+ - versioned json protocol with incremental patches
89
+ - typer and rich cli
90
+ - github project templates
91
+ - mkdocs documentation website
92
+
93
+ ## installation
94
+
95
+ requirements:
96
+
97
+ - python 3.11 or newer
98
+
99
+ node.js is only required for maintainers building the renderer from source.
100
+
101
+ ```bash
102
+ uv pip install -e '.[dev]'
103
+ ```
104
+
105
+ verify:
106
+
107
+ ```bash
108
+ shadlet doctor
109
+ shadlet info
110
+ ```
111
+
112
+ ## quick start
113
+
114
+ create a project:
115
+
116
+ ```bash
117
+ shadlet create my-app
118
+ cd my-app
119
+ shadlet dev
120
+ ```
121
+
122
+ or write `main.py` directly:
123
+
124
+ ```python
125
+ import shadlet as ui
126
+
127
+ app = ui.App("counter")
128
+
129
+
130
+ @app.page("/")
131
+ def home(ctx: ui.Context):
132
+ count = ctx.state(0, key="count")
133
+
134
+ def increment(event: ui.ClickEvent):
135
+ count.value += 1
136
+
137
+ return ui.Center(
138
+ ui.Column(
139
+ ui.Heading("counter"),
140
+ ui.Text(count),
141
+ ui.Button("increment", on_click=increment),
142
+ gap=16,
143
+ ),
144
+ min_height="100vh",
145
+ )
146
+
147
+
148
+ if __name__ == "__main__":
149
+ app.run()
150
+ ```
151
+
152
+ run:
153
+
154
+ ```bash
155
+ python main.py
156
+ ```
157
+
158
+ open `http://127.0.0.1:8000`.
159
+
160
+ ![demo2](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/demo2.png)
161
+
162
+ ## architecture
163
+
164
+ ```mermaid
165
+ flowchart LR
166
+ A[python application] --> B[component api]
167
+ B --> C[validation and normalisation]
168
+ C --> D[versioned json protocol]
169
+ D --> E[react renderer]
170
+ E --> F[browser]
171
+ ```
172
+
173
+ - python handles application logic.
174
+ - react handles rendering.
175
+ - communication uses a versioned json protocol over websocket.
176
+
177
+ ## project structure
178
+
179
+ ```text
180
+ shadlet/
181
+ packages/python/shadlet python runtime
182
+ packages/renderer react renderer
183
+ templates project templates
184
+ examples example applications
185
+ tests python tests
186
+ docs documentation
187
+ ```
188
+
189
+ ## examples
190
+
191
+ - `examples/counter` minimal counter
192
+ - `examples/todo` todo list with forms
193
+ - `examples/dashboard` dashboard with charts and tables
194
+
195
+ run any example:
196
+
197
+ ```bash
198
+ cd examples/counter
199
+ PYTHONPATH=../../packages/python python main.py
200
+ ```
201
+
202
+ ## documentation
203
+
204
+ full documentation is in `docs/` and built with mkdocs.
205
+
206
+ ```bash
207
+ python -m mkdocs serve
208
+ python -m mkdocs build --strict
209
+ ```
210
+
211
+ ## development
212
+
213
+ clone and set up:
214
+
215
+ ```bash
216
+ git clone https://github.com/programmersd21/shadlet
217
+ cd shadlet
218
+ uv venv --python 3.11
219
+ uv pip install -e '.[dev]'
220
+ cd packages/renderer && npm ci
221
+ ```
222
+
223
+ checks:
224
+
225
+ ```bash
226
+ ruff check .
227
+ ruff format --check .
228
+ mypy .
229
+ pyright packages/python/shadlet
230
+ pytest
231
+ cd packages/renderer && npm run lint && npm run format:check && npm run typecheck && npm run test && npm run build
232
+ python -m mkdocs build --strict
233
+ ```
234
+
235
+ ## compatibility
236
+
237
+ - python 3.11 or newer
238
+ - browsers: modern desktop browsers
239
+
240
+ ## community
241
+
242
+ - [contributing](CONTRIBUTING.md)
243
+ - [code of conduct](CODE_OF_CONDUCT.md)
244
+ - [security](SECURITY.md)
245
+ - [support](SUPPORT.md)
246
+ - [discussions](https://github.com/programmersd21/shadlet/discussions)
247
+ - [changelog](CHANGELOG.md)
248
+
249
+ ## ai assistance and transparency
250
+
251
+ shadlet is developed by human maintainers with assistance from ai tooling.
252
+ ai assistance is used for drafting, refactoring, documentation, and review support.
253
+ all code is reviewed by maintainers and must pass the project's lint, type, test,
254
+ and build checks before release. see [contributing](CONTRIBUTING.md) for the
255
+ ai code policy.
256
+
257
+ ## license
258
+
259
+ mit licensed. see [LICENSE](LICENSE) for full details.
260
+
261
+ ## status
262
+
263
+ release ready (v0.1.1). see `docs/limitations.md` for the verified support matrix and capabilities.
@@ -0,0 +1,223 @@
1
+ <div align="center">
2
+
3
+ ![banner](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/banner.png)
4
+
5
+ [![ci](https://img.shields.io/github/actions/workflow/status/programmersd21/shadlet/ci.yml?branch=main&label=ci&style=flat-square)](https://github.com/programmersd21/shadlet/actions/workflows/ci.yml)
6
+ [![docs](https://img.shields.io/github/actions/workflow/status/programmersd21/shadlet/docs.yml?branch=main&label=docs&style=flat-square)](https://github.com/programmersd21/shadlet/actions/workflows/docs.yml)
7
+ [![python](https://img.shields.io/badge/python-3.11%2B-3776ab?style=flat-square&logo=python&logoColor=white)](https://www.python.org/)
8
+ [![license](https://img.shields.io/github/license/programmersd21/shadlet?style=flat-square)](https://github.com/programmersd21/shadlet/blob/main/LICENSE)
9
+ [![pypi](https://img.shields.io/pypi/v/shadlet?style=flat-square)](https://pypi.org/project/shadlet/)
10
+ [![docs site](https://img.shields.io/badge/docs-online-5c4ee5?style=flat-square)](https://programmersd21.github.io/shadlet/)
11
+
12
+ **python-first web applications with a genuine shadcn/ui renderer.**
13
+
14
+ </div>
15
+
16
+ shadlet is a framework that lets developers build modern web applications in python. react renders the interface with authentic shadcn/ui components. python manages application state, events, routing and server-side logic. end users run applications with python only; node.js is only needed to build the renderer.
17
+
18
+ ## showcase
19
+
20
+ ![demo1](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/demo1.png)
21
+
22
+ ## why shadlet
23
+
24
+ - python developers can build web applications using pure python.
25
+ - the frontend is genuine shadcn/ui (tailwind + base-ui), not an imitation.
26
+ - components are strictly typed and validated across the protocol.
27
+ - reactive session state, async event handlers, and incremental patches.
28
+
29
+ ## comparison
30
+
31
+ | feature | shadlet | typical python web ui |
32
+ |---|---|---|
33
+ | rendering | react + authentic shadcn/ui | server-rendered templates |
34
+ | state | reactive session state | request/response state |
35
+ | components | 56 built-in shadcn/ui components | custom widget sets |
36
+ | packaging | python wheel with bundled renderer | manual frontend build |
37
+
38
+ ## features
39
+
40
+ - typed python component api with enums and validation
41
+ - 56 built-in components from shadcn/ui base-vega
42
+ - official bundled geist variable & geist mono typography
43
+ - smooth animations, backdrop blur, and spring physics
44
+ - automatic port switching when default port is occupied
45
+ - hot reload with diff-based patches
46
+ - session-scoped reactive state
47
+ - async event handlers with cancellation
48
+ - versioned json protocol with incremental patches
49
+ - typer and rich cli
50
+ - github project templates
51
+ - mkdocs documentation website
52
+
53
+ ## installation
54
+
55
+ requirements:
56
+
57
+ - python 3.11 or newer
58
+
59
+ node.js is only required for maintainers building the renderer from source.
60
+
61
+ ```bash
62
+ uv pip install -e '.[dev]'
63
+ ```
64
+
65
+ verify:
66
+
67
+ ```bash
68
+ shadlet doctor
69
+ shadlet info
70
+ ```
71
+
72
+ ## quick start
73
+
74
+ create a project:
75
+
76
+ ```bash
77
+ shadlet create my-app
78
+ cd my-app
79
+ shadlet dev
80
+ ```
81
+
82
+ or write `main.py` directly:
83
+
84
+ ```python
85
+ import shadlet as ui
86
+
87
+ app = ui.App("counter")
88
+
89
+
90
+ @app.page("/")
91
+ def home(ctx: ui.Context):
92
+ count = ctx.state(0, key="count")
93
+
94
+ def increment(event: ui.ClickEvent):
95
+ count.value += 1
96
+
97
+ return ui.Center(
98
+ ui.Column(
99
+ ui.Heading("counter"),
100
+ ui.Text(count),
101
+ ui.Button("increment", on_click=increment),
102
+ gap=16,
103
+ ),
104
+ min_height="100vh",
105
+ )
106
+
107
+
108
+ if __name__ == "__main__":
109
+ app.run()
110
+ ```
111
+
112
+ run:
113
+
114
+ ```bash
115
+ python main.py
116
+ ```
117
+
118
+ open `http://127.0.0.1:8000`.
119
+
120
+ ![demo2](https://raw.githubusercontent.com/programmersd21/shadlet/main/community/demo2.png)
121
+
122
+ ## architecture
123
+
124
+ ```mermaid
125
+ flowchart LR
126
+ A[python application] --> B[component api]
127
+ B --> C[validation and normalisation]
128
+ C --> D[versioned json protocol]
129
+ D --> E[react renderer]
130
+ E --> F[browser]
131
+ ```
132
+
133
+ - python handles application logic.
134
+ - react handles rendering.
135
+ - communication uses a versioned json protocol over websocket.
136
+
137
+ ## project structure
138
+
139
+ ```text
140
+ shadlet/
141
+ packages/python/shadlet python runtime
142
+ packages/renderer react renderer
143
+ templates project templates
144
+ examples example applications
145
+ tests python tests
146
+ docs documentation
147
+ ```
148
+
149
+ ## examples
150
+
151
+ - `examples/counter` minimal counter
152
+ - `examples/todo` todo list with forms
153
+ - `examples/dashboard` dashboard with charts and tables
154
+
155
+ run any example:
156
+
157
+ ```bash
158
+ cd examples/counter
159
+ PYTHONPATH=../../packages/python python main.py
160
+ ```
161
+
162
+ ## documentation
163
+
164
+ full documentation is in `docs/` and built with mkdocs.
165
+
166
+ ```bash
167
+ python -m mkdocs serve
168
+ python -m mkdocs build --strict
169
+ ```
170
+
171
+ ## development
172
+
173
+ clone and set up:
174
+
175
+ ```bash
176
+ git clone https://github.com/programmersd21/shadlet
177
+ cd shadlet
178
+ uv venv --python 3.11
179
+ uv pip install -e '.[dev]'
180
+ cd packages/renderer && npm ci
181
+ ```
182
+
183
+ checks:
184
+
185
+ ```bash
186
+ ruff check .
187
+ ruff format --check .
188
+ mypy .
189
+ pyright packages/python/shadlet
190
+ pytest
191
+ cd packages/renderer && npm run lint && npm run format:check && npm run typecheck && npm run test && npm run build
192
+ python -m mkdocs build --strict
193
+ ```
194
+
195
+ ## compatibility
196
+
197
+ - python 3.11 or newer
198
+ - browsers: modern desktop browsers
199
+
200
+ ## community
201
+
202
+ - [contributing](CONTRIBUTING.md)
203
+ - [code of conduct](CODE_OF_CONDUCT.md)
204
+ - [security](SECURITY.md)
205
+ - [support](SUPPORT.md)
206
+ - [discussions](https://github.com/programmersd21/shadlet/discussions)
207
+ - [changelog](CHANGELOG.md)
208
+
209
+ ## ai assistance and transparency
210
+
211
+ shadlet is developed by human maintainers with assistance from ai tooling.
212
+ ai assistance is used for drafting, refactoring, documentation, and review support.
213
+ all code is reviewed by maintainers and must pass the project's lint, type, test,
214
+ and build checks before release. see [contributing](CONTRIBUTING.md) for the
215
+ ai code policy.
216
+
217
+ ## license
218
+
219
+ mit licensed. see [LICENSE](LICENSE) for full details.
220
+
221
+ ## status
222
+
223
+ release ready (v0.1.1). see `docs/limitations.md` for the verified support matrix and capabilities.