@valentinkolb/cloud 0.1.0 → 0.1.2
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.
- package/README.md +78 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/ValentinKolb/cloud/main/packages/cloud/public/logo.svg" alt="Cloud" width="96" height="96">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">@valentinkolb/cloud</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<em>Modular Hono+SolidJS framework for building per-app docker services behind a dynamic gateway.</em>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
The runtime that powers [github.com/ValentinKolb/cloud](https://github.com/ValentinKolb/cloud) — a self-hosted application platform where every feature ships as its own Bun container, registers with a gateway through Redis, and inherits a shared session, UI kit, settings store, search, logging, email, websockets, and admin surface.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun add @valentinkolb/cloud
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The package is published as `.ts` source. It is intended for **Bun** consumers.
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
// packages/my-app/src/config.ts
|
|
25
|
+
import { defineApp } from "@valentinkolb/cloud";
|
|
26
|
+
|
|
27
|
+
export const app = defineApp({
|
|
28
|
+
id: "my-app",
|
|
29
|
+
name: "My App",
|
|
30
|
+
icon: "ti ti-rocket",
|
|
31
|
+
description: "What this app does",
|
|
32
|
+
basePath: "/app/my-app",
|
|
33
|
+
baseUrl: "http://app-my-app:3000",
|
|
34
|
+
nav: { href: "/app/my-app", section: "more", requiresAuth: true },
|
|
35
|
+
routes: ["/api/my-app", "/app/my-app", "/admin/my-app", "/public/my-app"],
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const { ssr, plugin } = app;
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// packages/my-app/src/index.ts
|
|
43
|
+
import { app } from "./config";
|
|
44
|
+
import { Hono } from "hono";
|
|
45
|
+
|
|
46
|
+
export default await app.start({
|
|
47
|
+
routes: {
|
|
48
|
+
api: new Hono().get("/", (c) => c.json({ ok: true })),
|
|
49
|
+
pages: new Hono().get("/", ...ssr(() => () => <div>hello</div>)),
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
A standard app declares four prefixes (`/api/<id>`, `/app/<id>`, `/admin/<id>`, `/public/<id>`); the gateway routes them to your container by URL prefix from a Redis-backed registry.
|
|
55
|
+
|
|
56
|
+
## Subpath exports
|
|
57
|
+
|
|
58
|
+
| Import | Use for |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `@valentinkolb/cloud` | `defineApp`, common types |
|
|
61
|
+
| `@valentinkolb/cloud/server` | server context, auth, route helpers |
|
|
62
|
+
| `@valentinkolb/cloud/ui` | UI kit (Layout, AdminLayout, primitives) |
|
|
63
|
+
| `@valentinkolb/cloud/ssr` | SSR helpers, islands, plugin registration |
|
|
64
|
+
| `@valentinkolb/cloud/services` | settings, logging, notifications, search |
|
|
65
|
+
| `@valentinkolb/cloud/api` | typed clients for the platform's own APIs |
|
|
66
|
+
| `@valentinkolb/cloud/contracts` | shared TS contracts |
|
|
67
|
+
| `@valentinkolb/cloud/styles/global.css` | base Tailwind stylesheet |
|
|
68
|
+
|
|
69
|
+
## Documentation
|
|
70
|
+
|
|
71
|
+
Full walkthroughs, the per-app anatomy, deployment templates, and a reference app live in the repo:
|
|
72
|
+
|
|
73
|
+
- **[APPS.md](https://github.com/ValentinKolb/cloud/blob/main/APPS.md)** — end-to-end app authoring guide
|
|
74
|
+
- **[github.com/ValentinKolb/cloud](https://github.com/ValentinKolb/cloud)** — monorepo, docker images, prod compose template
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT © Valentin Kolb
|
package/package.json
CHANGED