Skip to main content

meadows-web

MEADOWS web host: a dumb HTTP host that serves index.html and static assets. No Socket.IO, no auth, no domain logic. The browser is the client; the Socket.IO connection runs browser→meadows-server, NOT via this Python webserver. See MEADOWS-migration-intent.md section 2 line 40 and section 4 line 115.

Architecture

graph LR
    B[Browser<br>JS] -->|Socket.IO| S[meadows-server<br>:8080]
    B -->|HTTP| W[meadows-web<br>:8081]
    W -.->|static files only| B

The browser connects directly to meadows-server via Socket.IO. This Python server is just a file host.

What this package contains

  • app.py — the Starlette ASGI app. Serves /dist/index.html and /static/* → assets. Nothing else.
  • build.py — template injection: reads templates/index.html, injects protocol constants + env config, writes dist/index.html.
  • templates/index.html — minimal webchat page (Socket.IO client in the browser).
  • __main__.pypython -m meadows.web entrypoint (uvicorn).

Install

uv pip install -e ".[dev]"

This pulls in meadows-protocol (editable, via the sibling path) — the only MEADOWS dependency. The web host touches meadows.protocol solely to inject EventName constants into the template. It does not import Message, JWTClaims, or any domain model.

Build the template

uv run python -m meadows.web.build

Run

uv run python -m meadows.web
# or
uv run uvicorn meadows.web.app:app --host 0.0.0.0 --port 8081

Test

uv run pytest -q

Architecture invariants

  1. Dumb host. No Socket.IO, no auth, no JWT, no message parsing. It serves files. Period.
  2. TLS is not a concern. Traefik terminates TLS (section 4 line 115). No cert logic here.
  3. Protocol constants only. The only import from meadows.protocol is EventName (for template injection).
  4. PEP 420 namespace. src/meadows/web/__init__.py exists; there is NO src/meadows/__init__.py.

Configuration (env vars, managed via check_env in tasks.py:setup)

variable default purpose
MEADOWS_WEB_HOST 0.0.0.0 bind address for uvicorn
MEADOWS_WEB_PORT 8081 bind port for uvicorn
MEADOWS_SERVER_URL http://localhost:8080 server URL injected into the page (browser Socket.IO target)
MEADOWS_SYSTEM_NAME MEADOWS Chat display name injected into the page
PROJECT meadows Traefik router prefix
HOSTINGDOMAIN localhost Traefik host domain

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meadows_web-0.1.0.tar.gz (114.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

meadows_web-0.1.0-py3-none-any.whl (69.2 kB view details)

Uploaded Python 3

File details

Details for the file meadows_web-0.1.0.tar.gz.

File metadata

  • Download URL: meadows_web-0.1.0.tar.gz
  • Upload date:
  • Size: 114.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for meadows_web-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78facca673686e6f83321a512a093e7d452d06906e280b0bfb7feb7a582f489b
MD5 dd4d216438537c4b38163adc4de2fa45
BLAKE2b-256 135e18927610d2f6798b1c2b3f4f1c2e37da5fa90dd0cd6149b350e62cf6f192

See more details on using hashes here.

File details

Details for the file meadows_web-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: meadows_web-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 69.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for meadows_web-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 960a6a9dca53457af7a3f4ea6a1bdbfa631958ebbe938dbd38d30fe04a9421cb
MD5 b2daa8dbf791034ae87bd16ae1e7c0f6
BLAKE2b-256 99d9f2250d0eff423d6a8bf11893e004aecb9bf212af6ed9fcec6301a55acd1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page