Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
ASGI And Realtime Direction
The working prototype used plain ASGI with Uvicorn, not Django ASGI, Channels, FastAPI, or Starlette.
The shape was simple:
flowchart LR
A["Uvicorn"] --> B["ASGI app"]
B --> C["Filesystem router"]
C --> D["api/*.py handlers"]
That kept the useful part of classic CGI:
flowchart LR
A["URL"] --> B["File"]
B --> C["Function"]
but without classic CGI's process-per-request cost.
That is a better comparison than saying DBBASIC is a Rails-like app structure. The goal is closer to persistent CGI with a reusable object runtime:
- filesystem paths can map to runnable code
- the server stays warm between requests
- routing is derived from object source placement
- common helpers provide state, logs, files, versions, and scheduling
- object boundaries stay small enough for humans and AI tools to inspect
Classic CGI made deployment easy but left too much work to each script. DBBASIC keeps the direct path-to-code idea and adds the shared runtime pieces that make objects reusable as application building blocks.
Why ASGI Matters
ASGI gives DBBASIC one server surface for:
- normal HTTP requests
- long-lived WebSocket connections
- Server-Sent Events
- startup and shutdown lifecycle hooks
That matters because DBBASIC objects are not only pages or REST handlers. They can also be jobs, event handlers, admin actions, realtime screens, data feeds, and AI-edited live application pieces.
The important loop is:
flowchart LR
A["Object changes"] --> B["Version saved"]
B --> C["Object event"]
C --> D["UI/client updates"]
HTTP can handle the command. WebSockets or SSE can carry the feedback.
Phoenix And Erlang
Phoenix and Erlang/BEAM show why realtime application systems can feel so much better than request/response-only web frameworks:
- long-lived connections are normal
- PubSub is a core idea
- server-side events can update clients quickly
- stateful processes can model active parts of the application
- failures are isolated and supervised
DBBASIC should learn from that direction.
The DBBASIC version is not Erlang and does not get BEAM supervision for free. Python ASGI does not automatically give per-object process isolation, hot code replacement, distributed process registries, or Phoenix PubSub semantics.
What DBBASIC can still use well is the product shape:
flowchart TD
A["Object source"]
B["Object state"]
C["Object logs"]
D["Object versions"]
E["Realtime object events"]
A --> E
B --> E
C --> E
D --> E
That can support live admin screens, Scroll object inspectors, AI repair loops, dashboards, collaborative editing, queues, and business app interfaces without forcing everything through a Rails/Django-style request/deploy cycle.
Public V1 Direction
The public v1 server should stay single-node first and keep clustering separate until replication and conflict behavior are proven.
The first public ASGI layer is now small and runnable. It includes:
GET /healthGET /objects?format=jsonGET /objects/{object_id}?source=true&format=json- object execution
- source update and rollback
- state/log/version endpoints
- metadata endpoints
- temporary admin-token gate for object listing and introspection reads
Role, object, and row-level permissions, resource limits, and backup/restore checks all shipped. The websocket event stream is now implemented too (see below).
Realtime: implemented
Realtime arrived as an event system, not a decorative feature, and it reuses the durable event log rather than inventing a parallel path:
- Durable log (source of truth). Every record write already publishes
collection.record.created/updated/deleted to object_events, which is persisted, capped, and pollable with a cursor. This is the reliable, cross-restart, cross-worker path.
- Live overlay (
/ws). An in-process pub/sub hub (object_realtime)
pushes those same events to connected websockets the instant they happen. See the HTTP API contract for the connect + subscribe protocol.
Events are boring JSON signals — collection, record id, action — never the record body, so a push can never leak a field. Delivery obeys the permission engine: you can only subscribe to a collection you may read, and with enforcement on you only receive events for records your row filters would show you. The client refetches through the normal enforced API.
Single-process assumption. The live hub lives in one process; with one uvicorn worker every write and every socket share the event loop, so push is immediate and consistent. Across multiple workers each has its own hub, and clients fall back to polling the durable log — which is why the durable log, not the socket, is the source of truth. Keep the public v1 single-worker (or add a shared broker before scaling workers) so live push stays whole; either way correctness never depends on the socket.
An object-scoped room model (/ws/objects/{object_id} for source/state/log changes) is a natural next addition on the same hub, using the existing source/state/version change events.
Design Rule
Keep the ASGI layer thin.
The server should route requests and streams to object operations. It should not become a second framework with its own competing object model.