Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
13781a9
feat: Add nativewind
codinsonn Apr 4, 2024
8aee576
fix: Add TextLink to provide styles for Next Link
codinsonn Apr 5, 2024
7fed591
chore: Rewrite HomeScreen & SlugScreen to use Nativewind classNames
codinsonn Apr 5, 2024
ca782e9
chore: Add custom primary color in tailwind.theme.js
codinsonn Apr 5, 2024
9efca2f
feat: Parse NativeWind styles in custom Image & Link
codinsonn Apr 8, 2024
8c19f65
feat: Implement React portability patterns
codinsonn Apr 5, 2024
c299b6a
feat: Add portable Image component
codinsonn Apr 9, 2024
9d7c056
feat: Add Apollo Server at '/api/graphql'
codinsonn Apr 12, 2024
328b192
feat: Add graphql.tada for automagic GraphQL typesafety
codinsonn Apr 12, 2024
df0de06
feat: Add buildSchema() script & isomorphic graphqlQuery() helper
codinsonn Apr 14, 2024
6129c89
feat: Add Turborepo setup
codinsonn Apr 21, 2024
0b8518e
chore: Merge plugins for nativewind & portability patterns
codinsonn Apr 25, 2024
6e64548
chore: Merge plugin branch 'with/turborepo'
codinsonn Apr 25, 2024
b05b183
feat: Merge plugin branch 'with/graphql-server-apollo'
codinsonn Apr 29, 2024
08e3201
feat: Add UniversalRouteScreen data fetching with react-query
codinsonn Apr 18, 2024
5892833
feat: Merge plugin branch 'with/react-query'
codinsonn May 1, 2024
fc16c49
chore: Move core files to '@green-stack/core' package workspace
codinsonn May 8, 2024
5232f9b
feat: Add Zod schemas as Source of Truth basis
codinsonn May 12, 2024
3385aae
switch to strict typing
codinsonn May 18, 2024
a2a6fa5
feat: Update to Expo SDK 51
codinsonn May 18, 2024
ad323e9
feat: Add createDataBridge() util to bridge resolvers
codinsonn May 19, 2024
3db6ac2
feat: Add bridgedFetcher() util to @green-stack/core
codinsonn May 20, 2024
07e620d
feat: Add createResolver() util to build resolver from DataBridge
codinsonn May 22, 2024
85e00a9
feat: Add JSON scalar and request context to GraphQL
codinsonn May 23, 2024
29d82e0
feat: Add plugin tests for createSchemaPlugin()
codinsonn Jun 6, 2024
91dfea9
chore: Rename 'typeName' in introspection meta to 'zodType'
codinsonn Jun 7, 2024
9f91787
feat: Add automagic GraphQL codegen for both executable schema & SDL
codinsonn Jun 12, 2024
5731297
feat: Add scriptUtils to build scripts and generators with
codinsonn Jun 13, 2024
cc32977
feat: Add check-workspaces script to @green-stack/core
codinsonn Jun 14, 2024
bd41905
feat: Add collect-resolvers script
codinsonn Jun 15, 2024
92bfc5a
feat: Add link-routes script
codinsonn Jun 16, 2024
12adef1
feat: Add href & params prop hints to Universal Link
codinsonn Jun 16, 2024
baa318a
feat: Add useLayoutInfo() hook to @green-stack/core
codinsonn Jun 16, 2024
fd9bfea
feat: Add workspace generator
codinsonn Jun 16, 2024
1886cf2
feat: Add collect-generators script
codinsonn Jun 16, 2024
6b831ac
feat: Add aliases for @app/core & @green-stack/core through tsConfig …
codinsonn Jun 19, 2024
e97ee50
feat: Add createSchemaModel() method for mock memory db driver
codinsonn Jun 20, 2024
e574d32
feat: Add mock db driver & collect:drivers scripts
codinsonn Jun 28, 2024
44d1031
feat: Added an "add-dependencies" script / generator
codinsonn Jul 10, 2024
b6b8904
feat: Update HomeScreen design
codinsonn Jul 12, 2024
95b54a0
chore: Merge 'main' into 'with/green-stack'
codinsonn Jul 24, 2024
b08dc8e
chore: Merge 'main' into 'with/green-stack'
codinsonn Jul 24, 2024
d73c679
chore: Rename args & response schemas to input & output
codinsonn Aug 8, 2024
ed0cae4
feat: Add upsertOne() to db model driver
codinsonn Aug 8, 2024
3fb34de
feat: Add useFormState() hook to @green-stack/core
codinsonn Aug 23, 2024
6f1d955
chore: Bump expo SDK 51 dependencies
codinsonn Aug 26, 2024
644905a
feat: Add FormScreen and demo route
codinsonn Aug 26, 2024
cc8b05f
feat: Update to nativewind V4
codinsonn Aug 27, 2024
ce023b7
feat: Add styled example Checkbox
codinsonn Aug 28, 2024
1278c57
feat: Add CheckList form component
codinsonn Sep 2, 2024
22ca317
feat: Add array and object support to universal URL params
codinsonn Sep 2, 2024
b8ae2a9
feat: Add RadioGroup form component
codinsonn Sep 3, 2024
3927d18
fix: Deprecated fields 'editable' & 'nativeID'
codinsonn Sep 4, 2024
357fbf4
feat: Add Select form component
codinsonn Sep 8, 2024
4ada53c
feat: Add NumberStepper form component
codinsonn Sep 9, 2024
4ef4fc1
feat: Add TextArea form Component
codinsonn Sep 10, 2024
1eae120
feat: Add useScrollToFocusedInput() hook
codinsonn Sep 10, 2024
f578af5
feat: Add build-theme-colors script and flesh out color utils
codinsonn Sep 12, 2024
d2321d7
feat: Add nativewind support to SVG through cssInterop
codinsonn Sep 12, 2024
fd15841
feat: Add Switch form component
codinsonn Sep 12, 2024
4a15a50
feat: Add geolocation to headerContext if available
codinsonn Sep 13, 2024
410baba
feat: Add UniversalIcon component
codinsonn Sep 13, 2024
e2940c9
feat: Add Button component
codinsonn Sep 17, 2024
d09deb3
feat: Make Form Input components more narrowable
codinsonn Sep 22, 2024
bf24d80
feat: Add efficiency calculator to forms demo
codinsonn Sep 25, 2024
9c87af9
startup-sin: Finish implementing Dark Mode
codinsonn Oct 4, 2024
289332b
fix: Form input styles
codinsonn Oct 11, 2024
300c69a
feat: Add createKey() util to turn objects into key strings
codinsonn Oct 11, 2024
4722b60
fix: Add proper error and disabled states to Form components
codinsonn Oct 19, 2024
bb0e9f6
fix: Remove redundant ComponentDocs.tsx file
codinsonn Oct 27, 2024
7bcdc54
feat: Add schema generator
codinsonn Oct 27, 2024
7573322
fix: Expand @app/config flags
codinsonn Nov 22, 2024
9094402
chore: Add @app/forms path alias to tsconfig
codinsonn Nov 29, 2024
3b2c96f
chore: Update @app/expo dependencies to SDK 52
codinsonn Dec 3, 2024
f59c0cd
fix: Add globRel() as replacement for updated glob version
codinsonn Dec 3, 2024
24b1cbc
fix: Include file extensions in driver/model scripts for expo web
codinsonn Dec 3, 2024
a0ac296
fix: Pin @rn-primitives and reanimated versions
codinsonn Dec 5, 2024
d9fa66f
fix: BackButton behaviour to avoid hydration iissues
codinsonn Dec 6, 2024
6e6146b
fix: Remove expo-constants use in middleware to avoid edge build issues
codinsonn Dec 6, 2024
e9b4a80
chore: Upgrade to Expo SDK 52 #11
codinsonn Dec 6, 2024
a63b448
feat: Add usePrevious() hook to @green-stack/core
codinsonn Dec 6, 2024
90a345c
chore: Upgrade to Next.js 15
codinsonn Dec 7, 2024
7c2afe5
fix: Dark Mode toggle on iOS
codinsonn Dec 9, 2024
83bcd3f
fix: Add patches for react-native-web react 19 compatibility
codinsonn Dec 9, 2024
f991fd0
feat: Upgrade to Next.js 15
codinsonn Dec 9, 2024
1db1bce
fix: Mobile web select
codinsonn Dec 11, 2024
0a8f192
chore: Disable next default logs, add meta to FormScreen
codinsonn Dec 11, 2024
3f5e138
feat: Revamp FormScreen efficiency calculator
codinsonn Dec 13, 2024
73de73c
feat: Add default open-graph image example
codinsonn Dec 13, 2024
1e86967
fix: iPad HomeScreen styles
codinsonn Dec 19, 2024
f82dc19
fix: Add getSelectInputProps() to formState methods
codinsonn Dec 20, 2024
94964cd
chore: Split up FormsScreen into calculation and form demo
codinsonn Dec 24, 2024
ae3d7bf
feat: Overhaul UI colors, add key handlers to forms demo
codinsonn Jan 1, 2025
4917b29
feat: Add build:preview script to test production build locally
codinsonn Jan 1, 2025
f671aa6
chore: Add expo-system-ui for Android Dark Mode stability
codinsonn Jan 3, 2025
c0cf141
feat: Add encrypt() and decrypt() to apiUtils
codinsonn Jan 19, 2025
79701f8
feat: Include requestContext during SSR
codinsonn Jan 19, 2025
2b4e718
feat: Include requestContext in SSR graphql, add ServerRouteScreen
codinsonn Jan 19, 2025
7293eda
fix: Support empty args in GraphQL query + schema scaffolding
codinsonn Jan 19, 2025
084e4b0
feat: Add .sensitive() and 'isSensitive' to schemas
codinsonn Mar 17, 2025
71c7f31
feat: Add DBEntity to @db/driver
codinsonn Mar 17, 2025
447a1e2
chore: Prep for fullproduct.dev and official docs launch
codinsonn Mar 17, 2025
9cf2eff
fix: Utils in preparation for more supported node envs
codinsonn Jun 19, 2025
ede0734
feat: Add createMetadata for Next.js Metadata
codinsonn Jun 19, 2025
270c136
feat: Enable transforming schemas to Zod & TS definitions
codinsonn Jun 19, 2025
b824404
chore: Unify way of doing scripts and templates
codinsonn Jun 19, 2025
f943f0b
feat: Add collect-schemas script
codinsonn Jun 19, 2025
837539f
feat: Add @green-stack/core reference docs files
codinsonn Jun 19, 2025
aa00ddc
feat: Add createPrompts() helper for building generators
codinsonn Jun 19, 2025
13645e6
feat: Add generator generator
codinsonn Jun 19, 2025
76ac987
feat: Add script generator
codinsonn Jun 19, 2025
4c2cee7
feat: Add form generator
codinsonn Jun 19, 2025
f352c89
feat: Add resolver / API generator
codinsonn Jun 19, 2025
c176bf9
feat: Add universal route generator
codinsonn Jun 19, 2025
a16c88a
chore: Remove patch for metro-file-map as no longer required
codinsonn Jun 21, 2025
c9e72ef
feat: Update README.md
codinsonn Jun 21, 2025
7d1d7f6
fix: Issue with reusing input schemas in GraphQL output
codinsonn Jun 27, 2025
409092c
chore: Expand README with image sections to highlight benefits
codinsonn Jun 27, 2025
3d15766
fix: Issue with getAvailableSchemas() in scriptUtils
codinsonn Jun 27, 2025
bfc4b6b
chore: Update README
codinsonn Jun 30, 2025
67c42f6
feat: Update link-routes to allow native only route re-exports
codinsonn Oct 7, 2025
93d5a37
feat: Add 'dev:sim' command to run web + ios
codinsonn Oct 7, 2025
e91f28f
feat: Add universal 'WebView' iframe component
codinsonn Oct 7, 2025
c563eea
feat: Add 'Style' component
codinsonn Oct 7, 2025
7138221
feat: Add 'getCheckableInputProps' to useFormState()
codinsonn Oct 7, 2025
cb47c33
feat: Support img url icons in Button.tsx
codinsonn Oct 8, 2025
2635f4e
feat: Allow jsx children as label in 'Checkbox' component
codinsonn Oct 8, 2025
a6aaf4a
chore: Add selectTriggerRef prop to 'Select' component
codinsonn Oct 8, 2025
8e1b666
feat: Revamp demo screens
codinsonn Oct 8, 2025
7b719c0
feat: Migrate mock DB driver to driver signature pattern
codinsonn Nov 2, 2025
4eea2e0
fix: Update collect-drivers script to avoid circular deps
codinsonn Nov 2, 2025
3c39822
fix: Update collect-schemas script to collect partial definitions
codinsonn Nov 2, 2025
a0865cd
feat: Add minimal User schema and model to be expanded in plugins
codinsonn Nov 2, 2025
421664c
fix: Issue with default exports in link-routes script
codinsonn Nov 2, 2025
5ba52e8
feat: Add formatPercentage() and formatMoney() to numberUtils
codinsonn Jan 27, 2026
7a5326d
feat: Add startFromPlaceholder flag to NumberStepper
codinsonn Jan 27, 2026
54e670d
feat: Add stringifyMetadata() to objectUtils
codinsonn Jan 27, 2026
d8c4f60
feat: Demo LICENSE.md to with/green-stack + mention in README
codinsonn Jan 27, 2026
a5ae229
chore: Set minimum node version to 22
codinsonn Jan 27, 2026
309ce34
fix: Lazy load graphqlQuery module to fix tests
codinsonn Feb 13, 2026
5c2f706
feat: Add reactive & shallow flags to universal route param utils
codinsonn Feb 13, 2026
35205c7
feat: Refactor generators to plop for better args handling
codinsonn Feb 16, 2026
44d4c22
chore: Update note in README
codinsonn Feb 16, 2026
594bc98
feat: Upgrade to Expo SDK 53 & Next.js 16
codinsonn Mar 4, 2026
5dfcf42
feat: Split off @app/ui and @app/demo from @app/core
codinsonn Mar 4, 2026
ac0dde7
feat: Upgrade to Turbo V2
codinsonn Mar 5, 2026
7c21b1c
feat: Prep for Nextra V4 update
codinsonn Mar 6, 2026
1b30182
feat: Add --open flag to generators to open creation in editor
codinsonn Mar 7, 2026
7843364
feat: Add AGENTS.md, CLAUDE.md and cursor rules
codinsonn Mar 7, 2026
0a1812a
feat: Support Zod v3 + Zod v4 + Zod mini schemas
codinsonn Mar 19, 2026
fb33c17
feat: Update to Expo 54 and Next.js 16.2
codinsonn Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .cursor/rules/comments.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
description: Preserve existing comments when editing
alwaysApply: true
---

# Comments

When editing any file in this workspace:

- **Preserve all existing comments** in that file. Do not delete or shorten them unless you are **deleting or rewriting the exact lines they refer to**—then update those comments to match the new behavior.
- **Treat inline and block comments as part of the API** of the file: moving code should move comments with it; refactors must **re-home** comments, not drop them for brevity.
16 changes: 16 additions & 0 deletions .cursor/rules/resolvers.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
description: Data resolvers and API design - createDataBridge, createResolver
globs: "**/resolvers/**/*.ts"
alwaysApply: false
---

# Data Resolvers

When editing resolver files, reference [https://fullproduct.dev/docs/data-resolvers](https://fullproduct.dev/docs/data-resolvers) for:

- `createDataBridge()` - Combines input/output schemas for type-safe API bridges
- `createResolver()` - Bind a bridge to business logic
- `createNextRouteHandler()` - Turn resolver into API route
- `createGraphResolver()` - Turn resolver into GraphQL mutation/query
- Use `.bridge.ts` suffix for bridge files
- RPC-style (GraphQL or API route) resolver (shape resolvers for UI screens, not traversible graph)
14 changes: 14 additions & 0 deletions .cursor/rules/routing.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Workspace-defined routes - define in features, not apps
globs: "**/routes/**/*"
alwaysApply: false
---

# Routing

When editing route files, reference [https://fullproduct.dev/docs/universal-routing](https://fullproduct.dev/docs/universal-routing) for:

- Routes live in `features/*/routes/`, not in `apps/expo/app/` or `apps/next/app/`
- Run `npm run link:routes` to re-export routes from features to the Expo/Next app routers
- Use `npm run add:route` generator to create new routes
- Re-export screens from route files; use Next.js-style routing conventions
15 changes: 15 additions & 0 deletions .cursor/rules/schemas.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
description: Zod schemas as single source of truth - schema() usage
globs: "**/schemas/**/*.ts"
alwaysApply: false
---

# Schemas

When editing schema files, reference [https://fullproduct.dev/docs/single-sources-of-truth](https://fullproduct.dev/docs/single-sources-of-truth) for:

- Use `schema()` from `@green-stack/schemas` (not raw `z.object()`)
- Schemas drive types, validation, GraphQL, API inputs/outputs, forms, docs and even DB models
- Use `.extendSchema()`, `.pickSchema()`, `.omitSchema()` for schema composition
- Add `.describe()`, `.example()`, `.default()` for docs and docgen
- Use `.sensitive()` for fields that shouldn't appear in GraphQL/introspection or on the front-end at all
25 changes: 25 additions & 0 deletions .cursor/rules/workspace-expo-dependencies.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
description: Portable workspaces — declare Expo/native deps on the package that imports them, not on @app/expo
globs: "**/package.json"
alwaysApply: true
---

# Expo & native dependencies (portable workspaces)

**Goal:** Keep `apps/expo/package.json` lean. Anything required only by a feature or `packages/*` workspace should live in **that workspace’s `dependencies`** and `package.json`, not duplicated on the Expo app.

## Adding or upgrading Expo SDK–aligned packages

1. Use **`npm run add:dependencies`** (generator in `packages/@green-stack-core/generators/add-dependencies.ts`). It runs `expo install` in `@app/expo` to resolve **SDK-compatible** versions, then moves the new entries to the **target workspace** you choose.
2. Do **not** leave Expo-only deps on `@app/expo` unless the **Expo app** is the only consumer (shell, router, `expo-router`, `expo-constants`, etc.).

## When to put a dep on `@app/expo` vs a workspace

| Put on `@app/expo` | Put on the feature / `packages/*` workspace that imports it |
|--------------------|-------------------------------------------------------------|
| `expo`, `expo-router`, `expo-constants`, `nativewind`, app shell | `expo-auth-session`, `expo-secure-store`, `expo-web-browser` if only `@auth/clerk` (or similar) imports them |
| Core RN stack shared by the app entry | Driver-specific packages (`@clerk/*`, etc.) |

## After edits

Run `npm install` at the repo root and verify with **`npm run build:mobile`** (and any affected app build) when changing native/Expo deps.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ yarn-error.log*
*.mobileprovision
*.orig.*

# Expo Builds
apps/expo/dist

# Next.js
/.next/*
/out/
Expand All @@ -57,3 +60,13 @@ yarn-error.log*
.pnp.js

# -- @end @expo/next-adapter --

.turbo
.vscode/tmp

# Cursor
.cursor/hooks/state
.cursor/worktrees.json

# GraphQL
features/@app-core/graphql-env.d.ts.tmp
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -i- React Native / Expo pin react@19.1.0 to match the bundled react-native-renderer.
# -i- Clerk packages declare peer ranges that omit 19.1.0 (e.g. ~19.1.4 is the next band),
# -i- so npm 7+ strict peer resolution prints ERESOLVE warnings even though root overrides intentionally align the tree.
# -i- legacy-peer-deps uses npm 6-style peer handling so installs stay quiet without changing pinned React.
legacy-peer-deps=true
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
96 changes: 96 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# FullProduct.dev / GREEN Stack

This project was kickstarted with FullProduct.dev's universal app starterkit:

## Core conventions

- **Zod schemas as single source of truth**: Use `schema()` from `@green-stack/schemas`. APIs, types, db models and docs derive from these to stay in sync.
- **Workspace-defined routes**: Define routes in `features/*/routes/`. Run `npm run link:routes` to re-export to Expo/Next.
- **Universal UI**: Use `View`, `Text`, `Image` from `@app/ui` with Nativewind compatible `className` instead of HTML primitives.
- **Expo + Next.js**: Most UI must work on **web (Next.js)** and **mobile (Expo)**. Routing, images, and some APIs use **React Portability Patterns** (shared types + `*.next` / `*.expo` implementations injected at app roots)—not only `.web.ts` / `.ios.ts` splits. See [React Portability Patterns](https://fullproduct.dev/docs/portability-patterns).
- **Feature-first colocation**: Routes, resolvers, schemas, screens live together in `features/*/` or `packages/*/` workspaces instead of being split by frontend/backend.
- **Portable workspaces and dependencies**: Expo/native packages used only by a `features/*/` or `packages/*/` workspace belong in **that workspace’s `package.json`**, not on `apps/expo`. Use **`npm run add:dependencies`** to install SDK-compatible versions via `expo install`, the script will then move the resolved versions to the target workspace (see `.cursor/rules/workspace-expo-dependencies.mdc`).

## Detailed docs (reference when relevant)

- [Project structure](https://fullproduct.dev/docs/project-structure)
- [Routing](https://fullproduct.dev/docs/universal-routing)
- [React Portability Patterns](https://fullproduct.dev/docs/portability-patterns)
- [Data resolvers & APIs](https://fullproduct.dev/docs/data-resolvers)
- [Data fetching](https://fullproduct.dev/docs/data-fetching)
- [Schemas & single sources of truth](https://fullproduct.dev/docs/single-sources-of-truth)
- [Universal styling](https://fullproduct.dev/docs/write-once-styles)
- [Form management](https://fullproduct.dev/docs/form-management)
- [Generators](https://fullproduct.dev/docs/generators)
- [Workspace drivers](https://fullproduct.dev/docs/workspace-drivers)
- [Env vars + App config](https://fullproduct.dev/docs/app-config)
- [Automatic docgen](https://fullproduct.dev/docs/automatic-docgen)

---
# Code Style
---

When updating or recreating files:
- always maintain the same code style and tab spacing of the existing files

### Comments

- **Preserve all existing comments** in any file you edit. Do not delete or shorten them unless you are **deleting or rewriting the exact lines they refer to**—then update those comments to match the new behavior.
- **Treat inline and block comments as part of the API** of the file: moving code should move comments with it; refactors must **re-home** comments, not drop them for brevity.

### Type Safety

- Try to never use `any` unless absolutely necessary. Attempt to use generics instead or inference instead.
- If we need a type and can extract a type from a Zod schema, we should. Check our single sources of truth docs for more info about that.

### File layout (section dividers)

- Use section dividers like `/* --- Section name ------------------------------------------------------------- */` padded to **~100 characters** (match surrounding files).
- Prefer this **order** when it fits: **constants** → **types** → **implementation** (add other sections such as styles or exports as needed).

---
# Plans
---

Wherever possible, think of a plan and good feeback loop for the code you'll be writing.

Make the plan extremely concise. Sacrifice grammar for the sake of concision.

At the end of each plan, give me a list of unresolved questions to answer, if any.

A good feedback loop could be a test suite to run red green iterations with, or look at some of our scripts to run to help test everything still works as expected.

---
# Checks
---

### Testing and regression checks

To see whether all apps are still working as expected, run the relevant commands to check:

- `npm run test` runs all bun tests in `@green-stack/core`.
- `npm run typecheck` runs `typecheck` in every workspace that defines it (via Turbo, parallel + cached).
- `npm run typecheck:web` and `typecheck:mobile` scope to one app.
- `npm run build:web` runs the Next.js production build for `@app/next` (`apps/next`).
- `npm run build:mobile` runs `expo export` for `@app/expo` (`apps/expo`).
- `npm run build` runs the full Turbo `build` pipeline for the monorepo.

---
# Cursor Cloud specific instructions
---

### Prerequisites

- **bun** is required for `npm run test` (the test runner is bun). Install via `curl -fsSL https://bun.sh/install | bash` if missing, then ensure `~/.bun/bin` is on `PATH`.

### Running the app

- `npm run dev:web` starts the Next.js app with Turbo; it first runs `build:schema` (which also triggers `collect:resolvers`, `collect:schemas`, `collect:drivers`, `collect:models`).
- **Expo / mobile**: Cloud agents usually run **Linux VMs** without **macOS/iOS Simulator** or a typical local **Android emulator**. Do not assume you can open a simulator here; rely on `dev:web` + tests/builds where possible and call out **manual Expo verification** for the user when changes are platform-sensitive.
- The DB layer has a built-in mock memory DB fallback if no `DB_URL`/`MONGODB_URI` is set, so the app runs without an external database.
- Clerk auth and Stripe require real secrets to function; without them the app still starts but auth/payment flows will fail.

### Gotchas

- `npm run dev:web` uses `next dev --webpack` (webpack mode, not Turbopack).
- The dev server first-compiles pages on demand; initial page loads may be slow.
76 changes: 76 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# FullProduct.dev / GREEN Stack

This project was kickstarted with FullProduct.dev's universal app starterkit:

## Core conventions

- **Zod schemas as single source of truth**: Use `schema()` from `@green-stack/schemas`. APIs, types, db models and docs derive from these to stay in sync.
- **Workspace-defined routes**: Define routes in `features/*/routes/`. Run `npm run link:routes` to re-export to Expo/Next.
- **Universal UI**: Use `View`, `Text`, `Image` from `@app/ui` with Nativewind compatible `className` instead of HTML primitives.
- **Expo + Next.js**: Most UI must work on **web (Next.js)** and **mobile (Expo)**. Routing, images, and some APIs use **React Portability Patterns** (shared types + `*.next` / `*.expo` implementations injected at app roots)—not only `.web.ts` / `.ios.ts` splits. See [React Portability Patterns](https://fullproduct.dev/docs/portability-patterns).
- **Feature-first colocation**: Routes, resolvers, schemas, screens live together in `features/*/` or `packages/*/` workspaces instead of being split by frontend/backend.
- **Portable workspaces and dependencies**: Expo/native packages used only by a `features/*/` or `packages/*/` workspace belong in **that workspace’s `package.json`**, not on `apps/expo`. Use **`npm run add:dependencies`** to install SDK-compatible versions via `expo install`, the script will then move the resolved versions to the target workspace (see `.cursor/rules/workspace-expo-dependencies.mdc`).

## Detailed docs (reference when relevant)

- [Project structure](https://fullproduct.dev/docs/project-structure)
- [Routing](https://fullproduct.dev/docs/universal-routing)
- [React Portability Patterns](https://fullproduct.dev/docs/portability-patterns)
- [Data resolvers & APIs](https://fullproduct.dev/docs/data-resolvers)
- [Data fetching](https://fullproduct.dev/docs/data-fetching)
- [Schemas & single sources of truth](https://fullproduct.dev/docs/single-sources-of-truth)
- [Universal styling](https://fullproduct.dev/docs/write-once-styles)
- [Form management](https://fullproduct.dev/docs/form-management)
- [Generators](https://fullproduct.dev/docs/generators)
- [Workspace drivers](https://fullproduct.dev/docs/workspace-drivers)
- [Env vars + App config](https://fullproduct.dev/docs/app-config)
- [Automatic docgen](https://fullproduct.dev/docs/automatic-docgen)

---
# Code Style
---

When updating or recreating files:
- always maintain the same code style and tab spacing of the existing files

### Comments

- **Preserve all existing comments** in any file you edit. Do not delete or shorten them unless you are **deleting or rewriting the exact lines they refer to**—then update those comments to match the new behavior.
- **Treat inline and block comments as part of the API** of the file: moving code should move comments with it; refactors must **re-home** comments, not drop them for brevity.

### Type Safety

- Try to never use `any` unless absolutely necessary. Attempt to use generics instead or inference instead.
- If we need a type and can extract a type from a Zod schema, we should. Check our single sources of truth docs for more info about that.

### File layout (section dividers)

- Use section dividers like `/* --- Section name ------------------------------------------------------------- */` padded to **~100 characters** (match surrounding files).
- Prefer this **order** when it fits: **constants** → **types** → **implementation** (add other sections such as styles or exports as needed).

---
# Plans
---

Wherever possible, think of a plan and good feeback loop for the code you'll be writing.

Make the plan extremely concise. Sacrifice grammar for the sake of concision.

At the end of each plan, give me a list of unresolved questions to answer, if any.

A good feedback loop could be a test suite to run red green iterations with, or look at some of our scripts to run to help test everything still works as expected.

---
# Checks
---

### Testing and regression checks

To see whether all apps are still working as expected, run the relevant commands to check:

- `npm run test` runs all bun tests in `@green-stack/core`.
- `npm run typecheck` runs `typecheck` in every workspace that defines it (via Turbo, parallel + cached).
- `npm run typecheck:web` and `typecheck:mobile` scope to one app.
- `npm run build:web` runs the Next.js production build for `@app/next` (`apps/next`).
- `npm run build:mobile` runs `expo export` for `@app/expo` (`apps/expo`).
- `npm run build` runs the full Turbo `build` pipeline for the monorepo.
Loading