create-feltkit 0.3.5 → 0.3.6
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/package.json +1 -1
- package/template/README.md +19 -8
- package/template/package.json +1 -1
- package/template/src/App.tsx +2 -1
- package/template-managed/package.json +1 -1
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -214,25 +214,31 @@ without their FeltDB settings.
|
|
|
214
214
|
`.feltkit/deploy/.env`, then run the same `docker compose` command. With your own FeltDB
|
|
215
215
|
server (`--target self-hosted`), create a key for the app's namespace (`feltdb-server keys
|
|
216
216
|
create --keys <keys.json> --name tasks --namespace tasks --scope state:read,state:write`) and
|
|
217
|
-
put `FELTDB_URL` and `FELTDB_TOKEN` in `.env`. On Vercel (`--target vercel`),
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
put `FELTDB_URL` and `FELTDB_TOKEN` in `.env`. On Vercel (`--target vercel`), create the app in
|
|
218
|
+
Managed FeltDB (`npx feltdb init-managed --contract .feltkit/deploy/feltdb.contract.json
|
|
219
|
+
--runtime-scopes minimal`, which writes `.env.local`), then run `npx feltkit vercel deploy`. It links
|
|
220
|
+
the Vercel project the first time, uploads only the settings the deployment needs, deploys, and
|
|
221
|
+
signs you in: it prints the app's URL, your session token, and a one-time link to production
|
|
222
|
+
Studio. Either container refuses to start without its
|
|
220
223
|
settings, and checks the database answers, so it never keeps data on its own disk. For
|
|
221
224
|
Fly.io, plain Docker, or other hosts, follow `.feltkit/deploy/DEPLOY.md`.
|
|
222
225
|
|
|
223
226
|
Open <http://localhost:3000>.
|
|
224
227
|
|
|
225
228
|
4. **Sign in.** Production has no development sign-in (Ada and Grace are for development).
|
|
226
|
-
Until you connect your own login,
|
|
227
|
-
|
|
229
|
+
Until you connect your own login, sign in with a session token pasted into the app's sign-in
|
|
230
|
+
screen. On Vercel, `npx feltkit vercel deploy` printed yours. To sign in someone else (or
|
|
231
|
+
yourself again), run this in the project's folder:
|
|
228
232
|
|
|
229
233
|
```bash
|
|
230
234
|
npx feltkit session create --env production --type user --id you --role member
|
|
231
235
|
```
|
|
232
236
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
When the deployment's data is in FeltDB (Vercel, `--target hosted`, `--target self-hosted`), it
|
|
238
|
+
uses the deployment's settings from `.env.local` and the app keeps running; it refuses rather
|
|
239
|
+
than write anywhere else when they are missing. For the Node run, use `.feltkit/deploy` with
|
|
240
|
+
the app stopped (only one process may open its state). For the one-container Docker run, use a
|
|
241
|
+
one-off container on the same volume while the app's container is stopped:
|
|
236
242
|
|
|
237
243
|
```bash
|
|
238
244
|
docker run --rm -v tasks-data:/data tasks node node_modules/@feltdb/feltkit/bin/feltkit.js session create --env production --type user --id you --role member
|
|
@@ -241,6 +247,11 @@ without their FeltDB settings.
|
|
|
241
247
|
For real users, add `auth.authenticate` to `feltkit({ ... })` to verify requests with your
|
|
242
248
|
identity provider.
|
|
243
249
|
|
|
250
|
+
5. **Manage it.** On Vercel, production Studio is on (at `/_feltkit/` of your app). Run
|
|
251
|
+
`npx feltkit manage` for a one-time sign-in link, or use **Manage in production Studio** on
|
|
252
|
+
the Settings page of your local Studio (`npm run dev`), which also shows where production's data
|
|
253
|
+
is and links to the live app.
|
|
254
|
+
|
|
244
255
|
**Production settings** (from your secret manager, never in the repository). With one
|
|
245
256
|
container, none is required:
|
|
246
257
|
|
package/template/package.json
CHANGED
package/template/src/App.tsx
CHANGED
|
@@ -144,7 +144,8 @@ function TokenSignIn() {
|
|
|
144
144
|
return (
|
|
145
145
|
<form className="stack" onSubmit={submit}>
|
|
146
146
|
<p className="muted">
|
|
147
|
-
Sign in with a session token.
|
|
147
|
+
Sign in with a session token. <code>npx feltkit vercel deploy</code> prints yours the first time it deploys. To make another, run this in your project's folder (it uses your
|
|
148
|
+
deployment's FeltDB settings from <code>.env.local</code>):
|
|
148
149
|
</p>
|
|
149
150
|
<code className="block">npx feltkit session create --env production --type user --id you --role member</code>
|
|
150
151
|
<input type="password" value={token} onChange={(e) => setToken(e.target.value)} placeholder="Session token (fks_…)" aria-label="Session token" autoComplete="off" />
|