Skip to content

Commit e98ac81

Browse files
authored
Merge pull request #227 from udecode/codex/226-expo-auth-site-url
2 parents ced2a42 + a7cc7b3 commit e98ac81

206 files changed

Lines changed: 8854 additions & 59 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/expo-init-template.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"kitcn": patch
3+
---
4+
5+
Add `kitcn init -t expo` for a fresh Expo scaffold built on the official
6+
`create-expo-app` shell, including the Convex baseline, starter messages
7+
screen, and first-class `kitcn add auth` parity on the Expo scaffold.
8+
9+
Expo local env now also owns `EXPO_PUBLIC_SITE_URL`, so Concave dev and Expo
10+
auth keep one local app-origin contract instead of drifting back to
11+
`http://localhost:3000`.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONTEXT.md
12
.omx
23
**/tsconfig.tsbuildinfo
34
.netrc

CONTEXT.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# kitcn
2+
3+
kitcn is a framework and CLI for bootstrapping Convex-first application
4+
surfaces. This context defines the product language for scaffold lanes and auth
5+
surfaces so new integrations do not invent parallel contracts.
6+
7+
## Language
8+
9+
**Default auth scaffold**:
10+
The first-class `kitcn add auth` capability that owns auth server, client,
11+
provider, and managed schema refresh behavior.
12+
_Avoid_: Standard auth, normal auth, main auth path
13+
14+
**Raw Convex auth preset**:
15+
The conservative `kitcn add auth --preset convex` lane for plain Convex apps
16+
that do not adopt the full kitcn auth surface.
17+
_Avoid_: Convex auth parity, default auth
18+
19+
**Expo auth parity**:
20+
Expo support that uses the **Default auth scaffold** product surface rather
21+
than introducing an Expo-only auth contract.
22+
_Avoid_: Expo auth preset, mobile-only auth mode
23+
24+
**Managed auth schema refresh**:
25+
The `kitcn add auth --schema --yes` flow that refreshes auth-owned schema
26+
blocks without rerunning the full auth install.
27+
_Avoid_: auth regen, full auth rerun
28+
29+
**Auth demo route**:
30+
The generated sign-in/sign-up screen owned by the **Default auth scaffold**.
31+
_Avoid_: sample auth page, temporary auth UI
32+
33+
**Auth-aware provider wiring**:
34+
Client provider wiring that mounts the auth-capable Convex provider rather than
35+
the unauthenticated baseline provider.
36+
_Avoid_: auth bootstrap only, runtime-only auth
37+
38+
**Generated auth contract**:
39+
The kitcn backend auth model built around `auth.config.ts`, `auth.ts`,
40+
`generated/auth`, and `kitcn/auth/http`.
41+
_Avoid_: component auth model, manual createClient auth model
42+
43+
**Expo Better Auth client plugin**:
44+
The Better Auth Expo client plugin and native storage setup used in Expo
45+
clients.
46+
_Avoid_: generic web auth client, browser-only auth client
47+
48+
## Relationships
49+
50+
- **Expo auth parity** reuses the **Default auth scaffold**
51+
- **Expo auth parity** includes **Managed auth schema refresh**
52+
- **Expo auth parity** includes an **Auth demo route**
53+
- **Expo auth parity** includes **Auth-aware provider wiring**
54+
- **Expo auth parity** uses the **Generated auth contract**
55+
- **Expo auth parity** uses the **Expo Better Auth client plugin**
56+
- **Raw Convex auth preset** is distinct from the **Default auth scaffold**
57+
- The **Default auth scaffold** supports managed schema refresh via
58+
`kitcn add auth --schema`
59+
- The **Raw Convex auth preset** does not use `--schema`; it refreshes by
60+
rerunning the full preset command
61+
- The **Auth demo route** stays on `/auth` across first-class auth surfaces
62+
- Protected route groups are not part of **Expo auth parity** v1
63+
64+
## Example dialogue
65+
66+
> **Dev:** "For Expo, should we add a mobile auth preset?"
67+
> **Domain expert:** "No. Expo is **Expo auth parity**, which means the same
68+
> **Default auth scaffold** surface. The separate lane is only the **Raw Convex
69+
> auth preset**."
70+
71+
> **Dev:** "After changing auth plugins for Expo, do we rerun full install?"
72+
> **Domain expert:** "No. Expo parity keeps **Managed auth schema refresh**,
73+
> just like the **Default auth scaffold**."
74+
75+
> **Dev:** "Should Expo auth just wire the runtime and leave UI to users?"
76+
> **Domain expert:** "No. **Expo auth parity** owns the **Auth demo route** and
77+
> **Auth-aware provider wiring**, or parity means nothing."
78+
79+
> **Dev:** "Do we port the old component-style auth API from
80+
> `convex-better-auth`?"
81+
> **Domain expert:** "No. Expo parity keeps the **Generated auth contract**.
82+
> `convex-better-auth` is the reference for native mechanics, not the public
83+
> product model."
84+
85+
## Flagged ambiguities
86+
87+
- "Expo auth" was ambiguous between **Expo auth parity** and the
88+
**Raw Convex auth preset** — resolved: Expo uses **Expo auth parity**
89+
- "`--schema` support" was ambiguous between optional convenience and product
90+
identity — resolved: it is part of **Expo auth parity** because Expo reuses
91+
the **Default auth scaffold**
92+
- "Expo auth route" was ambiguous between generated UX and runtime-only wiring
93+
— resolved: **Expo auth parity** owns an **Auth demo route** at `/auth`
94+
- "convex-better-auth as reference" was ambiguous between implementation donor
95+
and public contract — resolved: it informs native mechanics, while kitcn
96+
keeps the **Generated auth contract**

docs/adr/0001-expo-auth-parity.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Expo auth uses the default auth scaffold, not a separate Expo preset
2+
3+
Expo auth support will reuse the default `kitcn add auth` product surface,
4+
including `/auth` demo route ownership, auth-aware provider wiring, and
5+
`--schema` refresh. We explicitly rejected a separate Expo-only auth lane even
6+
though `../convex-better-auth` has Expo-specific mechanics, because that repo is
7+
the implementation reference for native behavior, not the public product model.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
date: 2026-04-18
3+
topic: expo-template
4+
---
5+
6+
# Expo Template
7+
8+
## Problem Frame
9+
10+
`kitcn init -t` currently has web-first fresh-app scaffolds (`next`, `start`,
11+
`vite`) plus auth layering that assumes web/react project shapes. There is no
12+
first-class Expo lane, so mobile users either start elsewhere or force a web
13+
template into a native-shaped app.
14+
15+
The goal is to add a first-party Expo template that feels like current kitcn
16+
templates: start from an official upstream shell, overlay the minimum kitcn
17+
Convex wiring, and prove the app is real with one tiny live demo. V1 should
18+
solve fresh mobile bootstrap only. It should not drag in auth, styling stack
19+
wars, or existing-app adoption.
20+
21+
```mermaid
22+
flowchart TB
23+
A["User runs `kitcn init -t expo --yes`"] --> B["kitcn creates app from official `create-expo-app` template"]
24+
B --> C["kitcn overlays Convex config, env, and client wiring"]
25+
C --> D["kitcn replaces starter content with one live messages demo screen"]
26+
D --> E["User can run Expo app against Convex without extra manual setup"]
27+
```
28+
29+
## Requirements
30+
31+
**Official Base**
32+
- R1. `kitcn init -t expo` must scaffold from the official Expo CLI path rather
33+
than from a kitcn-owned handwritten Expo shell.
34+
- R2. V1 must use `create-expo-app` as the source of truth for the app shell,
35+
mirroring the repo's shadcn-owned Next approach.
36+
- R3. As of April 18, 2026, the intended upstream base is
37+
`create-expo-app --template default@sdk-55`; planning must verify that this
38+
still matches Expo's current official recommendation before implementation.
39+
40+
**Generated App Shape**
41+
- R4. The generated app must be a fresh Expo Router app with a single-screen
42+
shell, not tabs or drawer navigation.
43+
- R5. kitcn must overlay the minimum Convex runtime wiring needed for a working
44+
native app instead of replacing the whole Expo project structure.
45+
- R6. The scaffolded app must include one live Convex-backed messages screen
46+
with list and create behavior, matching the current tiny demo posture used in
47+
other kitcn templates.
48+
- R7. The demo should replace upstream starter content enough that the scaffold
49+
clearly reads as a kitcn+Convex app rather than a stock Expo welcome screen.
50+
51+
**Scope and Compatibility**
52+
- R8. V1 must support fresh scaffolding only via `kitcn init -t expo`.
53+
- R9. V1 must not include auth scaffolding, auth-ready shell behavior, or
54+
`kitcn add auth` support for Expo.
55+
- R10. V1 must not pick a styling system beyond the official Expo baseline; no
56+
NativeWind, Unistyles, or other opinionated styling stack should be part of
57+
the initial template.
58+
- R11. Planning must treat existing Expo app adoption as a separate future lane,
59+
not as hidden scope inside this template work.
60+
61+
**CLI Contract**
62+
- R12. `kitcn init` help, template validation, and machine-readable output must
63+
recognize `expo` as a supported fresh-app template.
64+
- R13. Repo project detection and scaffold-context logic must gain an explicit
65+
Expo/native lane rather than misclassifying Expo as generic React or leaving
66+
it unsupported.
67+
- R14. The Expo template must preserve current kitcn expectations around
68+
deterministic `--yes` behavior and fresh-app bootstrap flow.
69+
70+
## Success Criteria
71+
- `kitcn init -t expo --yes` produces a runnable Expo app with Convex wired in.
72+
- The generated app opens to one live messages screen backed by Convex.
73+
- The implementation keeps Expo shell ownership upstream and keeps kitcn-owned
74+
changes narrowly scoped to overlay files and minimal patch points.
75+
- V1 does not accidentally expand into auth, existing-app adoption, tabs/drawer
76+
shells, or styling-framework decisions.
77+
78+
## Scope Boundaries
79+
- No Expo auth support in v1.
80+
- No `kitcn add auth` Expo path in v1.
81+
- No existing Expo app adoption in v1.
82+
- No tabs or drawer starter shell in v1.
83+
- No NativeWind, Unistyles, or other opinionated mobile styling layer in v1.
84+
- No attempt to reuse `create-better-t-stack` as the generator source of truth.
85+
86+
## Key Decisions
87+
- Official Expo base wins: use `create-expo-app`, not a kitcn-owned Expo shell.
88+
- kitcn overlays Convex onto the upstream app instead of replacing the app
89+
structure wholesale.
90+
- V1 is fresh scaffold only: adoption work is deferred.
91+
- V1 is unauthenticated: auth is intentionally out of scope.
92+
- Demo shape is the existing tiny messages pattern: enough proof, low carrying
93+
cost.
94+
- `create-better-t-stack` is a donor for Expo choices when useful, not the
95+
baseline owner.
96+
97+
## Dependencies / Assumptions
98+
- Expo's official template contract remains stable enough to wrap from the CLI.
99+
- The repo is willing to add a native/Expo project-context lane in CLI
100+
detection and scaffold planning.
101+
- Convex's current React/React Native client surface is sufficient for a simple
102+
Expo messages demo without introducing auth-specific runtime dependencies.
103+
104+
## Outstanding Questions
105+
106+
### Deferred to Planning
107+
- [Affects R1][Technical] Which exact files from the official Expo scaffold
108+
should stay upstream-owned versus receive kitcn overlay patches?
109+
- [Affects R5][Technical] What is the smallest durable scaffold-context model
110+
for Expo/native without contorting the current `next-app` vs `react` split?
111+
- [Affects R6][Technical] Which existing messages demo assets can be reused
112+
directly versus needing Expo-native variants?
113+
- [Affects R12][Needs research] Which current CLI tests should be mirrored for
114+
Expo template bootstrap, detection, and JSON output?
115+
- [Affects R3][Needs research] At implementation time, does Expo still
116+
recommend `default@sdk-55`, or has the official template target changed?
117+
118+
## Next Steps
119+
`/ce:plan` for structured implementation planning

0 commit comments

Comments
 (0)