WasmMvcRuntime supports multiple hosting models from the same compiled codebase. The MVC controllers, views, and business logic remain identical — only the hosting environment changes.
The primary hosting model. The application runs as a static Single-Page Application in the browser.
dotnet publishproduces static files:index.html,main.js,.wasm, DLLs- Deploy to any static file host (CDN, GitHub Pages, Cloudflare Pages, Azure Static Web Apps, S3, nginx)
- Browser loads
index.html→ boots .NET WASM in a Web Worker - All MVC processing happens client-side — no server needed
# Build
dotnet publish -c Release
# Output is in bin/Release/net10.0/publish/wwwroot/
# Deploy this folder to any static host- ✅ Fully offline-capable
- ✅ Zero server infrastructure
- ✅ Database persisted to OPFS
- ✅ Identity system runs locally
⚠️ Bundle size: ~15-25MB (first load)⚠️ Cold start: ~2-4 seconds
The same compiled WASM application runs inside Node.js, serving MVC responses over HTTP.
cepha-server.mjsboots the .NET WASM runtime in Node.js- HTTP requests are routed to
MvcEngine.ProcessRequestAsync() - Controllers execute and return HTML/JSON responses
- The Node.js process serves these responses over HTTP
# Via CLI
cepha kit
# Or directly
node cepha-server.mjs// cepha-server.mjs (simplified)
import { createServer } from 'http';
const handler = async (req, res) => {
const body = await readBody(req);
const response = await exports.HandleRequest(
req.method, req.url, JSON.stringify(req.headers), body
);
res.writeHead(response.statusCode, { 'Content-Type': response.contentType });
res.end(response.body);
};
createServer(handler).listen(3000);- ✅ Server-rendered MVC responses
- ✅ Same controllers and views as browser SPA
- ✅ Can serve API endpoints (
[ApiController]) - ✅ Runs on any Node.js 18+ host
⚠️ No OPFS (uses filesystem for SQLite)
Deploy the same MVC application to edge computing platforms.
# Via CLI
cepha kit --wrangler
# Or configure wrangler.toml manually# wrangler.toml
name = "my-mvc-app"
main = "cepha-server.mjs"
compatibility_date = "2024-01-01"
compatibility_flags = ["nodejs_compat"]import { serve } from "https://deno.land/std/http/server.ts";
// Boot .NET WASM and handle requests the same way- ✅ Global edge distribution
- ✅ Sub-100ms cold starts (V8 isolates)
- ✅ Same controllers and views
⚠️ No OPFS or persistent storage (use KV/D1 for data)
Ship the MVC application inside a native application shell.
Native App Shell
└── WebView
└── index.html → main.js → Web Worker → .NET WASM
└── Full MVC pipeline + SQLite + Identity
- Desktop applications with MVC UI
- Mobile applications (MAUI WebView)
- Kiosk / embedded systems
- Field applications (fully offline)
This hosting model requires additional integration work for native file system access and WebView configuration.
| Feature | Browser SPA | Node.js API | Edge Workers | Embedded WebView |
|---|---|---|---|---|
| Server required | ❌ | ✅ (Node.js) | ✅ (Edge platform) | ❌ |
| Offline capable | ✅ | ❌ | ❌ | ✅ |
| Database | SQLite + OPFS | SQLite + filesystem | Platform KV/D1 | SQLite + filesystem |
| Identity | Client-side | Server-side | Stateless | Client-side |
| Bundle delivery | Browser download | Server-local | Edge cache | App bundle |
| Cold start | ~2-4s | ~1-2s | <100ms | ~1-2s |
| Status | ✅ Complete | ✅ Complete | ✅ Complete | 🔲 Planned |
| File | Purpose |
|---|---|
CephaApp.cs |
Browser SPA bootstrap |
cepha-server.mjs |
Node.js / Edge Worker host |
cepha-runtime-worker.js |
Web Worker WASM host |
main.js |
Browser SPA engine |