create-oke 0.2.8 → 0.3.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 +11 -32
- package/package.json +2 -4
- package/src/cli.test.ts +29 -117
- package/src/cli.ts +16 -139
- package/src/docs-origin.ts +2 -3
- package/src/index.ts +1 -2
- package/src/scaffold.ts +13 -31
- package/src/templates.ts +12 -90
- package/src/transform.ts +1 -1
- package/template/.env.example +56 -0
- package/{templates/standard → template}/README.md +25 -12
- package/template/bun.lock +845 -0
- package/template/drizzle.config.ts +25 -0
- package/{templates/full → template}/oke.config.ts +11 -7
- package/{templates/minimal → template}/src/core.ts +1 -1
- package/template/src/schema.decl.ts +12 -0
- package/examples/linkly/.env.example +0 -15
- package/examples/linkly/drizzle.config.ts +0 -11
- package/examples/linkly/oke.config.ts +0 -12
- package/examples/linkly/package.json +0 -18
- package/examples/linkly/src/app.ts +0 -21
- package/examples/linkly/src/core.ts +0 -4
- package/examples/linkly/src/flows/analytics/index.ts +0 -39
- package/examples/linkly/src/flows/links/index.ts +0 -82
- package/examples/linkly/src/flows/links/shapes.ts +0 -22
- package/examples/linkly/src/flows/links/signals.ts +0 -14
- package/examples/linkly/src/gates.ts +0 -10
- package/examples/linkly/src/schema.decl.ts +0 -39
- package/examples/linkly/src/schema.generated.ts +0 -30
- package/examples/linkly/src/schema.ts +0 -2
- package/examples/linkly/tests/linkly.test.ts +0 -19
- package/examples/notes/.env.example +0 -12
- package/examples/notes/drizzle.config.ts +0 -11
- package/examples/notes/oke.config.ts +0 -14
- package/examples/notes/package.json +0 -19
- package/examples/notes/src/app.ts +0 -13
- package/examples/notes/src/core.ts +0 -4
- package/examples/notes/src/flows/notes/index.ts +0 -58
- package/examples/notes/src/schema.ts +0 -9
- package/examples/notes/tests/notes.test.ts +0 -10
- package/examples/provisions/.env.example +0 -19
- package/examples/provisions/drizzle.config.ts +0 -11
- package/examples/provisions/oke.config.ts +0 -19
- package/examples/provisions/package.json +0 -18
- package/examples/provisions/src/app.ts +0 -60
- package/examples/provisions/src/channels.ts +0 -15
- package/examples/provisions/src/core.ts +0 -4
- package/examples/provisions/src/flows/notifications/index.ts +0 -25
- package/examples/provisions/src/flows/orders/index.ts +0 -97
- package/examples/provisions/src/flows/orders/shapes.ts +0 -21
- package/examples/provisions/src/flows/orders/signals.ts +0 -19
- package/examples/provisions/src/flows/payments/index.ts +0 -43
- package/examples/provisions/src/flows/payments/shapes.ts +0 -3
- package/examples/provisions/src/flows/payments/stripe.ts +0 -18
- package/examples/provisions/src/gates.ts +0 -4
- package/examples/provisions/src/locales/ar.ts +0 -1
- package/examples/provisions/src/locales/en.ts +0 -1
- package/examples/provisions/src/plugins/audit-schema.ts +0 -2
- package/examples/provisions/src/plugins/audit.ts +0 -14
- package/examples/provisions/src/schema.ts +0 -16
- package/examples/provisions/src/vault.ts +0 -16
- package/examples/provisions/tests/orders.test.ts +0 -19
- package/examples/skyport/.env.example +0 -34
- package/examples/skyport/drizzle.config.ts +0 -11
- package/examples/skyport/evals/triage.jsonl +0 -1
- package/examples/skyport/oke.config.ts +0 -47
- package/examples/skyport/oke.images.lock +0 -4
- package/examples/skyport/package.json +0 -19
- package/examples/skyport/src/ai.ts +0 -25
- package/examples/skyport/src/app.ts +0 -46
- package/examples/skyport/src/channels.ts +0 -12
- package/examples/skyport/src/core.ts +0 -4
- package/examples/skyport/src/flows/bookings/index.ts +0 -73
- package/examples/skyport/src/flows/bookings/shapes.ts +0 -6
- package/examples/skyport/src/flows/bookings/signals.ts +0 -13
- package/examples/skyport/src/flows/notifications/index.ts +0 -16
- package/examples/skyport/src/flows/payments/index.ts +0 -14
- package/examples/skyport/src/flows/payments/shapes.ts +0 -5
- package/examples/skyport/src/flows/support/index.ts +0 -50
- package/examples/skyport/src/flows/users/elements.ts +0 -2
- package/examples/skyport/src/flows/users/index.ts +0 -12
- package/examples/skyport/src/flows/users/shapes.ts +0 -6
- package/examples/skyport/src/gates.ts +0 -10
- package/examples/skyport/src/journeys.ts +0 -9
- package/examples/skyport/src/locales/ar.ts +0 -4
- package/examples/skyport/src/locales/en.ts +0 -4
- package/examples/skyport/src/plugins/audit-schema.ts +0 -7
- package/examples/skyport/src/plugins/audit.ts +0 -14
- package/examples/skyport/src/plugins/panel.tsx +0 -4
- package/examples/skyport/src/schema.ts +0 -25
- package/examples/skyport/src/vault.ts +0 -24
- package/examples/skyport/tests/support.test.ts +0 -16
- package/src/sync-templates.ts +0 -77
- package/templates/full/.env.example +0 -24
- package/templates/full/README.md +0 -65
- package/templates/full/drizzle.config.ts +0 -14
- package/templates/full/package.json +0 -18
- package/templates/full/src/ai.ts +0 -11
- package/templates/full/src/app.ts +0 -34
- package/templates/full/src/channels.ts +0 -9
- package/templates/full/src/core.ts +0 -4
- package/templates/full/src/flows/main/index.ts +0 -45
- package/templates/full/src/flows/main/shapes.ts +0 -3
- package/templates/full/src/flows/main/signals.ts +0 -8
- package/templates/full/src/gates.ts +0 -4
- package/templates/full/src/locales/ar.ts +0 -3
- package/templates/full/src/locales/en.ts +0 -3
- package/templates/full/src/schema.ts +0 -8
- package/templates/full/src/vault.ts +0 -9
- package/templates/full/tests/full.test.ts +0 -11
- package/templates/hello/.env.example +0 -9
- package/templates/hello/README.md +0 -40
- package/templates/hello/oke.config.ts +0 -3
- package/templates/hello/package.json +0 -14
- package/templates/hello/src/app.ts +0 -10
- package/templates/hello/src/flows/hello/index.ts +0 -27
- package/templates/hello/tests/hello.test.ts +0 -10
- package/templates/minimal/.env.example +0 -13
- package/templates/minimal/README.md +0 -49
- package/templates/minimal/drizzle.config.ts +0 -14
- package/templates/minimal/oke.config.ts +0 -14
- package/templates/minimal/package.json +0 -18
- package/templates/minimal/src/app.ts +0 -13
- package/templates/minimal/src/flows/main/index.ts +0 -49
- package/templates/minimal/src/schema.ts +0 -8
- package/templates/minimal/tests/minimal.test.ts +0 -13
- package/templates/standard/.env.example +0 -21
- package/templates/standard/drizzle.config.ts +0 -14
- package/templates/standard/oke.config.ts +0 -51
- package/templates/standard/src/core.ts +0 -4
- package/templates/standard/src/schema.ts +0 -9
- /package/{templates/standard → template}/package.json +0 -0
- /package/{templates/standard → template}/src/app.ts +0 -0
- /package/{templates/standard → template}/src/channels.ts +0 -0
- /package/{templates/standard → template}/src/flows/main/index.ts +0 -0
- /package/{templates/standard → template}/src/flows/main/shapes.ts +0 -0
- /package/{templates/standard → template}/src/flows/main/signals.ts +0 -0
- /package/{templates/standard → template}/src/gates.ts +0 -0
- /package/{templates/standard → template}/src/locales/ar.ts +0 -0
- /package/{templates/standard → template}/src/locales/en.ts +0 -0
- /package/{templates/standard → template}/src/vault.ts +0 -0
- /package/{templates/standard → template}/tests/standard.test.ts +0 -0
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
2
|
-
import { id, now } from "okengine/store";
|
|
3
|
-
|
|
4
|
-
export const entries = sqliteTable("entries", {
|
|
5
|
-
id: text("id").primaryKey().$defaultFn(id),
|
|
6
|
-
body: text("body").notNull(),
|
|
7
|
-
createdAt: integer("created_at").notNull().$defaultFn(now),
|
|
8
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { vault } from "okengine";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
/** Stub secret contract — replace with your secrets. */
|
|
5
|
-
export const appSecret = vault.secret("APP_SECRET", {
|
|
6
|
-
schema: z.string().min(1),
|
|
7
|
-
description: "Application secret",
|
|
8
|
-
dev: "dev-only-secret",
|
|
9
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "bun:test";
|
|
2
|
-
import { createTestApp } from "okengine/test";
|
|
3
|
-
import { app } from "../src/app";
|
|
4
|
-
|
|
5
|
-
test("boots — health flow with wired elements", async () => {
|
|
6
|
-
const t = await createTestApp(app);
|
|
7
|
-
const { data, error } = await t.api.main.health({});
|
|
8
|
-
expect(error).toBeNull();
|
|
9
|
-
expect(data).toEqual({ ok: true });
|
|
10
|
-
await t.signals.drain();
|
|
11
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Environment template — copy to `.env.local` for local overrides.
|
|
2
|
-
# create-oke copies this file to `.env.local` when you scaffold a new project.
|
|
3
|
-
#
|
|
4
|
-
# Resolution order (first hit wins):
|
|
5
|
-
# process.env → .env.local → docker/.env.docker → vault driver → dev fallback
|
|
6
|
-
#
|
|
7
|
-
# This template has no Vault declarations and no pinned infrastructure drivers.
|
|
8
|
-
# Add variables here when you introduce `vault.secret(...)` in src/vault.ts or
|
|
9
|
-
# pin postgres/redis/s3/smtp drivers in oke.config.ts.
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# hello
|
|
2
|
-
|
|
3
|
-
Fastest possible “it works” — one unit, two HTTP flows, **no Store**.
|
|
4
|
-
|
|
5
|
-
## Run
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
bun install
|
|
9
|
-
oke dev # app :6530 · Console :6533 · MCP :6535
|
|
10
|
-
# or: oke mode docker && oke dev # compose infra on host Bun
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
| Port | Try |
|
|
14
|
-
| ------- | ---------------------- |
|
|
15
|
-
| `:6530` | `GET /` · `GET /hello` |
|
|
16
|
-
| `:6533` | Console |
|
|
17
|
-
| `:6535` | MCP |
|
|
18
|
-
|
|
19
|
-
## What’s in this template
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
hello/
|
|
23
|
-
├── .env.example # copied to .env.local by create-oke
|
|
24
|
-
├── oke.config.ts
|
|
25
|
-
├── src/
|
|
26
|
-
│ ├── app.ts # oke({ name: "hello" }).adopt({ hello })
|
|
27
|
-
│ └── flows/hello/index.ts # GET / · GET /hello
|
|
28
|
-
└── tests/hello.test.ts
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
- **Elements:** Flow only (no `store`, `gate`, `vault`, `channel`, or `ai`)
|
|
32
|
-
- **Unit:** `hello`
|
|
33
|
-
- **Flows:** `root` (`GET /`), `hello` (`GET /hello` → `{ message: "ok" }`)
|
|
34
|
-
|
|
35
|
-
Replace `/hello` with your first real route. When you need persistence, move up to
|
|
36
|
-
`minimal` or `standard` — or keep growing this tree.
|
|
37
|
-
|
|
38
|
-
## Agent contract
|
|
39
|
-
|
|
40
|
-
See [`AGENTS.md`](./AGENTS.md). Handbook: [okengine.vercel.app/docs](https://okengine.vercel.app/docs)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { on, flow, http } from "okengine";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
/** First-run welcome — visit :6530/ after `oke dev`. */
|
|
5
|
-
export const root = on(
|
|
6
|
-
http.get("/"),
|
|
7
|
-
flow({
|
|
8
|
-
out: z.object({
|
|
9
|
-
ok: z.literal(true),
|
|
10
|
-
console: z.string(),
|
|
11
|
-
try: z.string(),
|
|
12
|
-
}),
|
|
13
|
-
do: () => ({
|
|
14
|
-
ok: true as const,
|
|
15
|
-
console: "http://127.0.0.1:6533",
|
|
16
|
-
try: "/hello",
|
|
17
|
-
}),
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
export const hello = on(
|
|
22
|
-
http.get("/hello"),
|
|
23
|
-
flow({
|
|
24
|
-
out: z.object({ message: z.string() }),
|
|
25
|
-
do: () => ({ message: "ok" }),
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "bun:test";
|
|
2
|
-
import { createTestApp } from "okengine/test";
|
|
3
|
-
import { app } from "../src/app";
|
|
4
|
-
|
|
5
|
-
test("boots and answers /hello", async () => {
|
|
6
|
-
const t = await createTestApp(app);
|
|
7
|
-
const { data, error } = await t.api.hello.hello({});
|
|
8
|
-
expect(error).toBeNull();
|
|
9
|
-
expect(data?.message).toBe("ok");
|
|
10
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# Environment template — copy to `.env.local` for local overrides.
|
|
2
|
-
# create-oke copies this file to `.env.local` when you scaffold a new project.
|
|
3
|
-
#
|
|
4
|
-
# Resolution order (first hit wins):
|
|
5
|
-
# process.env → .env.local → docker/.env.docker → vault driver → dev fallback
|
|
6
|
-
#
|
|
7
|
-
# --- Infrastructure (optional) ---
|
|
8
|
-
# This app pins postgres for docker/prod SQL in oke.config.ts.
|
|
9
|
-
# Local dev uses sqlite by default; uncomment only when overriding postgres URLs.
|
|
10
|
-
# Run `oke dev --docker` to write role-accurate keys into `docker/.env.docker`.
|
|
11
|
-
|
|
12
|
-
# DATABASE_URL — primary Postgres connection; from your host (Neon, RDS, …) or `docker/.env.docker` after `oke dev --docker`
|
|
13
|
-
# DATABASE_URL=postgres://user:password@127.0.0.1:5432/oke
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# minimal
|
|
2
|
-
|
|
3
|
-
Smallest shape you’d actually ship — **Store + HTTP flows** over a single table.
|
|
4
|
-
|
|
5
|
-
## Run
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
bun install
|
|
9
|
-
oke dev # app :6530 · Console :6533 · MCP :6535
|
|
10
|
-
# or: oke mode docker && oke dev # postgres via compose
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Local `oke dev` auto-runs `oke db push` when `schema.ts` changes (opt out:
|
|
14
|
-
`--no-db-push`). Docker/prod never auto-apply DDL — use `oke db migrate`.
|
|
15
|
-
|
|
16
|
-
| Port | Try |
|
|
17
|
-
| ------- | ------------------------------------------- |
|
|
18
|
-
| `:6530` | `GET /` · `GET /entries` · `POST /entries` |
|
|
19
|
-
| `:6533` | Console |
|
|
20
|
-
| `:6535` | MCP |
|
|
21
|
-
|
|
22
|
-
## What’s in this template
|
|
23
|
-
|
|
24
|
-
```text
|
|
25
|
-
minimal/
|
|
26
|
-
├── .env.example # copied to .env.local by create-oke
|
|
27
|
-
├── drizzle.config.ts # oke db push|generate|migrate
|
|
28
|
-
├── oke.config.ts # local: sqlite · docker/prod: postgres
|
|
29
|
-
├── src/
|
|
30
|
-
│ ├── app.ts # adopt({ main }), stores: [db]
|
|
31
|
-
│ ├── core.ts # store.sql("…")
|
|
32
|
-
│ ├── schema.ts # entries table (Drizzle escape hatch)
|
|
33
|
-
│ └── flows/main/index.ts # GET / · GET|POST /entries
|
|
34
|
-
└── tests/minimal.test.ts
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- **Elements:** Flow · Store (`sql`)
|
|
38
|
-
- **Unit:** `main`
|
|
39
|
-
- **Flows:** `root`, `list` (`GET /entries`), `create` (`POST /entries` with `{ body }`)
|
|
40
|
-
- **Schema:** `entries` — `id`, `body`, `createdAt`
|
|
41
|
-
|
|
42
|
-
Swap `entries` for your domain table and grow flows beside it. Prefer
|
|
43
|
-
`store.schema.table` + `field.*` in `schema.decl.ts` when you want ORM-agnostic
|
|
44
|
-
declare (Linkly); hand-written `schema.ts` remains the escape hatch. Need gates,
|
|
45
|
-
channels, or locales? Use `standard`.
|
|
46
|
-
|
|
47
|
-
## Agent contract
|
|
48
|
-
|
|
49
|
-
See [`AGENTS.md`](./AGENTS.md). Handbook: [okengine.vercel.app/docs](https://okengine.vercel.app/docs)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Domain schema sync for `oke db push|generate|migrate`.
|
|
5
|
-
* Versioned prod migrations land in `./drizzle` — never mix with `.oke/`.
|
|
6
|
-
*/
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
dialect: "sqlite",
|
|
9
|
-
schema: "./src/schema.ts",
|
|
10
|
-
out: "./drizzle",
|
|
11
|
-
dbCredentials: {
|
|
12
|
-
url: process.env.OKE_SQLITE_URL ?? "file:.oke/app.sqlite",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@oke/template-minimal",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"okengine": "file:../..",
|
|
8
|
-
"drizzle-orm": "^1.0.0-rc.4",
|
|
9
|
-
"zod": "^4.4.3"
|
|
10
|
-
},
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"drizzle-kit": "^1.0.0-rc.4"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"test": "bun test",
|
|
16
|
-
"dev": "oke dev"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { db } from "./core";
|
|
2
|
-
|
|
3
|
-
import { oke } from "okengine";
|
|
4
|
-
import * as main from "./flows/main";
|
|
5
|
-
|
|
6
|
-
export const app = oke({ name: "minimal" }).adopt({ main });
|
|
7
|
-
|
|
8
|
-
export type App = typeof app;
|
|
9
|
-
|
|
10
|
-
Object.assign(app.$options, {
|
|
11
|
-
env: "test",
|
|
12
|
-
stores: [db],
|
|
13
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { on, flow, http } from "okengine";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { db } from "../../core";
|
|
4
|
-
import { entries } from "../../schema";
|
|
5
|
-
|
|
6
|
-
const NewEntry = z.object({ body: z.string().min(1) });
|
|
7
|
-
const EntryId = z.object({ id: z.string() });
|
|
8
|
-
const Entry = z.object({
|
|
9
|
-
id: z.string(),
|
|
10
|
-
body: z.string(),
|
|
11
|
-
createdAt: z.number(),
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
/** First-run welcome — visit :6530/ after `oke dev`. */
|
|
15
|
-
export const root = on(
|
|
16
|
-
http.get("/"),
|
|
17
|
-
flow({
|
|
18
|
-
out: z.object({
|
|
19
|
-
ok: z.literal(true),
|
|
20
|
-
console: z.string(),
|
|
21
|
-
try: z.string(),
|
|
22
|
-
}),
|
|
23
|
-
do: () => ({
|
|
24
|
-
ok: true as const,
|
|
25
|
-
console: "http://127.0.0.1:6533",
|
|
26
|
-
try: "GET /entries",
|
|
27
|
-
}),
|
|
28
|
-
}),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
export const create = on(
|
|
32
|
-
http.post("/entries"),
|
|
33
|
-
flow({
|
|
34
|
-
in: NewEntry,
|
|
35
|
-
out: EntryId,
|
|
36
|
-
do: async (input, fx) => {
|
|
37
|
-
const [row] = await fx.store(db).insert(entries).values(input).returning();
|
|
38
|
-
return { id: row.id };
|
|
39
|
-
},
|
|
40
|
-
}),
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
export const list = on(
|
|
44
|
-
http.get("/entries"),
|
|
45
|
-
flow({
|
|
46
|
-
out: Entry.array(),
|
|
47
|
-
do: (_, fx) => fx.store(db).select().from(entries),
|
|
48
|
-
}),
|
|
49
|
-
);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
2
|
-
import { id, now } from "okengine/store";
|
|
3
|
-
|
|
4
|
-
export const entries = sqliteTable("entries", {
|
|
5
|
-
id: text("id").primaryKey().$defaultFn(id),
|
|
6
|
-
body: text("body").notNull(),
|
|
7
|
-
createdAt: integer("created_at").notNull().$defaultFn(now),
|
|
8
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { test, expect } from "bun:test";
|
|
2
|
-
import { createTestApp } from "okengine/test";
|
|
3
|
-
import { app } from "../src/app";
|
|
4
|
-
|
|
5
|
-
test("boots — create then list", async () => {
|
|
6
|
-
const t = await createTestApp(app);
|
|
7
|
-
const { data, error } = await t.api.main.create({ body: "hello" });
|
|
8
|
-
expect(error).toBeNull();
|
|
9
|
-
expect(data?.id).toBeTruthy();
|
|
10
|
-
const { data: rows } = await t.api.main.list({});
|
|
11
|
-
expect(rows?.length).toBe(1);
|
|
12
|
-
expect(rows?.[0]?.body).toBe("hello");
|
|
13
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# Environment template — copy to `.env.local` for local overrides.
|
|
2
|
-
# create-oke copies this file to `.env.local` when you scaffold a new project.
|
|
3
|
-
#
|
|
4
|
-
# Resolution order (first hit wins):
|
|
5
|
-
# process.env → .env.local → docker/.env.docker → vault driver → dev fallback
|
|
6
|
-
#
|
|
7
|
-
# --- Vault (app secrets) ---
|
|
8
|
-
# Declare secrets in src/vault.ts with `vault.secret(...)`, then uncomment lines here.
|
|
9
|
-
|
|
10
|
-
# --- Infrastructure (optional) ---
|
|
11
|
-
# Commented — this app pins postgres, redis, and smtp (Mailpit) in oke.config.ts.
|
|
12
|
-
# Run `oke dev --docker` to write role-accurate keys into `docker/.env.docker`.
|
|
13
|
-
|
|
14
|
-
# DATABASE_URL — primary Postgres connection; from your host or `docker/.env.docker` after `oke dev --docker`
|
|
15
|
-
# DATABASE_URL=postgres://user:password@127.0.0.1:5432/oke
|
|
16
|
-
|
|
17
|
-
# REDIS_URL — Redis/Valkey connection for store.kv; from your host or `docker/.env.docker` after `oke dev --docker`
|
|
18
|
-
# REDIS_URL=redis://:password@127.0.0.1:6379
|
|
19
|
-
|
|
20
|
-
# SMTP_URL — outbound email (Mailpit in docker dev); from your provider or `docker/.env.docker` after `oke dev --docker`
|
|
21
|
-
# SMTP_URL=smtp://127.0.0.1:1025
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "drizzle-kit";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Domain schema sync for `oke db push|generate|migrate`.
|
|
5
|
-
* Versioned prod migrations land in `./drizzle` — never mix with `.oke/`.
|
|
6
|
-
*/
|
|
7
|
-
export default defineConfig({
|
|
8
|
-
dialect: "sqlite",
|
|
9
|
-
schema: "./src/schema.ts",
|
|
10
|
-
out: "./drizzle",
|
|
11
|
-
dbCredentials: {
|
|
12
|
-
url: process.env.OKE_SQLITE_URL ?? "file:.oke/app.sqlite",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "okengine/config";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
drivers: {
|
|
5
|
-
store: {
|
|
6
|
-
sql: {
|
|
7
|
-
local: "sqlite",
|
|
8
|
-
docker: "postgres",
|
|
9
|
-
test: "memory",
|
|
10
|
-
prod: "postgres",
|
|
11
|
-
},
|
|
12
|
-
kv: {
|
|
13
|
-
local: "memory",
|
|
14
|
-
docker: "redis",
|
|
15
|
-
test: "memory",
|
|
16
|
-
prod: "redis",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
signal: {
|
|
20
|
-
local: "memory",
|
|
21
|
-
docker: "postgres",
|
|
22
|
-
test: "memory",
|
|
23
|
-
prod: "postgres",
|
|
24
|
-
},
|
|
25
|
-
clock: {
|
|
26
|
-
local: "memory",
|
|
27
|
-
docker: "postgres",
|
|
28
|
-
test: "frozen",
|
|
29
|
-
prod: "postgres",
|
|
30
|
-
},
|
|
31
|
-
vault: {
|
|
32
|
-
local: "dotenv",
|
|
33
|
-
docker: "dotenv",
|
|
34
|
-
test: "memory",
|
|
35
|
-
prod: "sops",
|
|
36
|
-
},
|
|
37
|
-
channel: {
|
|
38
|
-
email: {
|
|
39
|
-
local: "console",
|
|
40
|
-
docker: "smtp",
|
|
41
|
-
test: "console",
|
|
42
|
-
prod: "smtp",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
images: {
|
|
47
|
-
"store.sql": "postgres:18-alpine",
|
|
48
|
-
"store.kv": "redis:8-alpine",
|
|
49
|
-
},
|
|
50
|
-
i18n: { locales: ["en", "ar"], default: "en", dir: { ar: "rtl" } },
|
|
51
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { sqliteTable, text, integer } from "drizzle-orm/sqlite-core";
|
|
2
|
-
import { id, now } from "okengine/store";
|
|
3
|
-
|
|
4
|
-
/** Replace with your tables — keep defaults on the schema. */
|
|
5
|
-
export const entries = sqliteTable("entries", {
|
|
6
|
-
id: text("id").primaryKey().$defaultFn(id),
|
|
7
|
-
body: text("body").notNull(),
|
|
8
|
-
createdAt: integer("created_at").notNull().$defaultFn(now),
|
|
9
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|