@digo-labs/backend 0.1.6 → 0.1.9
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 +27 -17
- package/dist/index.d.cts +4 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @digo-labs/backend
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The one Hono backend shared by every digo app — deployed as a container on ECS behind `api.digo-labs.com`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Layout
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- `src/routes/` — one Hono route chain per domain (`bedrock`, `database`, `storage`, `dmx`, `proxy`, `auth`, `admin`), all mounted at `/`.
|
|
8
|
+
- `src/services/` — the `Services` aggregate: one `services-<domain>.ts` instance class per domain, reached as `Services.database.getAll(...)`.
|
|
9
|
+
- `src/middleware/` — CORS, app inference, auth session loading.
|
|
10
|
+
- `src/db/` — Postgres pool, drizzle client, and the schema registry.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
open http://localhost:3000
|
|
14
|
-
```
|
|
12
|
+
Patterns are documented in the design system: [Backend Patterns](https://design.digo-labs.com/docs/development/backend-patterns) and [Backend Architecture](https://design.digo-labs.com/docs/guide/backend-architecture).
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
## Develop locally
|
|
17
15
|
|
|
16
|
+
```bash
|
|
17
|
+
npm run dev # tsx watch on port 3000
|
|
18
18
|
```
|
|
19
|
-
npm install
|
|
20
|
-
vc build
|
|
21
|
-
```
|
|
22
19
|
|
|
23
|
-
|
|
20
|
+
Requires env vars (`DATABASE_URL_MONOREPO` at minimum; `FAL_KEY` for the fal proxy) — the usual workflow is developing apps against the deployed backend instead, which needs nothing locally. See [Environment and Local Backend](https://design.digo-labs.com/docs/guide/environment-and-local-backend).
|
|
21
|
+
|
|
22
|
+
## Build
|
|
24
23
|
|
|
24
|
+
```bash
|
|
25
|
+
npm run build # tsup → dist/index.cjs + dist/index.d.cts
|
|
25
26
|
```
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
The published `@digo-labs/backend` package ships **types only** (`dist/index.d.cts`) — `packages/services` imports the router types from it for its typed client. After changing any exported router type, rebuild and republish or dependent packages resolve stale types.
|
|
29
|
+
|
|
30
|
+
## Deploy
|
|
31
|
+
|
|
32
|
+
From the repo root:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm run deploy:backend
|
|
28
36
|
```
|
|
37
|
+
|
|
38
|
+
Docker build → ECR push → ECS rollout. Details, task-definition/secrets model, and verification steps: [Deploying to AWS](https://design.digo-labs.com/docs/guide/deploying-to-aws).
|
package/dist/index.d.cts
CHANGED
|
@@ -146,6 +146,8 @@ declare const databaseRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
146
146
|
table: string;
|
|
147
147
|
column: string;
|
|
148
148
|
value: string | number | boolean | null;
|
|
149
|
+
limit?: number | undefined;
|
|
150
|
+
offset?: number | undefined;
|
|
149
151
|
};
|
|
150
152
|
};
|
|
151
153
|
output: {
|
|
@@ -212,7 +214,7 @@ declare const databaseRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
212
214
|
};
|
|
213
215
|
}, "/", "database-delete">;
|
|
214
216
|
|
|
215
|
-
declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
217
|
+
declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, hono_types.BlankSchema | hono_types.MergeSchemaPath<{
|
|
216
218
|
"bedrock-text": {
|
|
217
219
|
$post: {
|
|
218
220
|
input: {
|
|
@@ -243,7 +245,7 @@ declare const bedrockRouter: hono_hono_base.HonoBase<hono_types.BlankEnv, {
|
|
|
243
245
|
status: hono_utils_http_status.StatusCode;
|
|
244
246
|
};
|
|
245
247
|
};
|
|
246
|
-
}, "/", "
|
|
248
|
+
}, "/ai">, "/", "/">;
|
|
247
249
|
|
|
248
250
|
declare const app: Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
249
251
|
type DmxRouter = typeof dmxRouter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digo-labs/backend",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"digoDb": {
|
|
28
28
|
"schema": "./src/db/schemas/index.ts",
|
|
29
|
+
"schemaName": "common",
|
|
29
30
|
"schemaFilter": [
|
|
30
31
|
"common"
|
|
31
32
|
],
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
]
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
|
-
"@digo-labs/common": "^0.1.
|
|
40
|
+
"@digo-labs/common": "^0.1.16"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"@aws-sdk/client-bedrock": "^3.1035.0",
|