Skip to content

Commit 6fa7e99

Browse files
committed
Add a first-class bring-your-own-web-app path to the docs
Fulora's current docs describe the greenfield template path well, but teams with an existing web product still have to infer too much of the adoption model from scattered bridge, hosting, and CLI references. This change adds a dedicated BYO-web-app quickstart plus a fuller guide, and links that path from the README and docs index so existing-product teams can find the right entrypoint immediately. Constraint: Keep the docs aligned with the current shipped DX path rather than speculating about future commands that do not exist yet Constraint: Preserve the main greenfield onboarding path while adding a parallel existing-web adoption path Rejected: Fold all BYO guidance into Getting Started only | would over-expand the default onboarding path and bury the most relevant guidance for migration/adoption teams Rejected: Write only a deep long-form guide | users also need a short top-level entrypoint that explains the adoption model quickly Confidence: high Scope-risk: narrow Reversibility: clean Directive: Maintain both quickstart and full-guide versions of the BYO-web-app story so README/index can stay concise while the deeper guide stays thorough Tested: `dotnet test tests/Agibuild.Fulora.UnitTests/Agibuild.Fulora.UnitTests.csproj --filter "FullyQualifiedName~DocumentationGovernanceTests" -v minimal` (28 passed) Tested: `dotnet docfx docs/docfx.json` (succeeded) Not-tested: Public reader comprehension of the new guidance without user research Related: 95c22d0
1 parent b5c4c00 commit 6fa7e99

File tree

5 files changed

+569
-0
lines changed

5 files changed

+569
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,41 @@ Need a little more than just a WebView? Fulora gives your app typed app services
2828

2929
Go deeper with [Getting Started](docs/articles/getting-started.md), the [Documentation Index](docs/index.md), [Bridge guide](docs/articles/bridge-guide.md), and [SPA hosting](docs/articles/spa-hosting.md).
3030

31+
## Already have a web app?
32+
33+
You do not need to rebuild your frontend to adopt Fulora.
34+
35+
The recommended path is:
36+
37+
1. keep your existing React/Vue/Next-style web app
38+
2. point Fulora at your dev server during development
39+
3. switch to embedded or packaged static assets in production
40+
4. add native capabilities gradually through typed app services
41+
42+
In development, that usually looks like:
43+
44+
```csharp
45+
webView.EnableSpaHosting(new SpaHostingOptions
46+
{
47+
DevServerUrl = "http://localhost:5173"
48+
});
49+
50+
await webView.NavigateAsync(new Uri("app://localhost/index.html"));
51+
```
52+
53+
Your frontend can then use generated services such as:
54+
55+
```ts
56+
import { services } from "./bridge/client";
57+
58+
const profile = await services.userProfile.get();
59+
```
60+
61+
Start here:
62+
63+
- [Bring Your Existing Web App — Quick Start](docs/articles/bring-your-own-web-app-quickstart.md)
64+
- [Bring Your Existing Web App](docs/articles/bring-your-own-web-app.md)
65+
3166
If you want a different onboarding path:
3267

3368
**Alternative (template only):**
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Bring Your Existing Web App to Fulora — Quick Start
2+
3+
If you already have a React, Vue, or similar web application, you can adopt Fulora without rewriting your frontend.
4+
5+
The recommended path is:
6+
7+
1. keep your existing web project
8+
2. add a lightweight Avalonia + Fulora desktop host
9+
3. connect the host to your web dev server in development
10+
4. add native capabilities gradually through typed services
11+
12+
## Development model
13+
14+
In development, your web app continues to run through its normal dev server:
15+
16+
```bash
17+
cd app/web
18+
npm run dev
19+
```
20+
21+
Your Fulora host points to it:
22+
23+
```csharp
24+
WebView.EnableSpaHosting(new SpaHostingOptions
25+
{
26+
DevServerUrl = "http://localhost:5173"
27+
});
28+
29+
await WebView.NavigateAsync(new Uri("app://localhost/index.html"));
30+
```
31+
32+
That keeps HMR and the existing frontend workflow intact.
33+
34+
## Production model
35+
36+
In production, switch to embedded or packaged static assets:
37+
38+
```csharp
39+
WebView.EnableSpaHosting(new SpaHostingOptions
40+
{
41+
EmbeddedResourcePrefix = "wwwroot",
42+
ResourceAssembly = typeof(MainWindow).Assembly
43+
});
44+
45+
await WebView.NavigateAsync(new Uri("app://localhost/index.html"));
46+
```
47+
48+
The same `app://localhost/...` surface works in both development and production.
49+
50+
## Add native capabilities only where needed
51+
52+
Expose host capabilities through typed bridge services:
53+
54+
```csharp
55+
[JsExport]
56+
public interface IUserProfileService
57+
{
58+
Task<UserProfileDto> Get();
59+
}
60+
```
61+
62+
Use them from the frontend through the generated app-service surface:
63+
64+
```ts
65+
import { services } from "./bridge/client";
66+
67+
const profile = await services.userProfile.get();
68+
```
69+
70+
## Best practices
71+
72+
- keep your existing frontend framework and structure
73+
- use the dev server in development
74+
- use packaged assets in production
75+
- keep generated bridge files under `src/bridge/generated`
76+
- let app code use `services.*`, not raw RPC calls
77+
- use preflight checks before development and packaging
78+
79+
## Useful commands
80+
81+
```bash
82+
fulora dev --preflight-only
83+
fulora package --profile desktop-public --preflight-only
84+
fulora generate types --project ./app/bridge/MyProduct.Bridge.csproj
85+
```
86+
87+
## Next step
88+
89+
For the full recommended structure, integration steps, and troubleshooting guidance, see the full guide:
90+
91+
- [Bring Your Existing Web App to Fulora](./bring-your-own-web-app.md)

0 commit comments

Comments
 (0)