create-pilotprojects-app 0.3.1 → 0.3.3

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 CHANGED
@@ -59,7 +59,7 @@ The CLI is interactive — it asks a few questions then scaffolds, installs depe
59
59
  | ------------------------------ | -------------------------------------------------------- | ----------------- |
60
60
  | Project name | Any lowercase slug | — |
61
61
  | Package scope | `@<name>` | `@<project-name>` |
62
- | Apps to scaffold | Web / Mobile / Both | Both |
62
+ | Apps to scaffold | Web only / Mobile only / Both | Web only |
63
63
  | Environments | development / uat / production _(local always included)_ | production |
64
64
  | Include design system? | Yes / No | Yes |
65
65
  | Include Sentry? | Yes / No | Yes |
package/dist/index.js CHANGED
@@ -40,13 +40,15 @@ program
40
40
  pc.green("✔ Project created successfully!\n"),
41
41
  pc.bold("Next steps:"),
42
42
  ` cd ${pc.cyan(config.projectName)}`,
43
- ` cp apps/web/.env.development.example apps/web/.env.development`,
43
+ config.apps.includes("web")
44
+ ? ` cp apps/web/.env.local.example apps/web/.env.local`
45
+ : "",
44
46
  config.apps.includes("mobile")
45
- ? ` cp apps/mobile/.env.example apps/mobile/.env`
47
+ ? ` cp apps/mobile/.env.local.example apps/mobile/.env.local`
46
48
  : "",
47
49
  ` ${config.packageManager} run dev`,
48
50
  "",
49
- pc.dim("See docs/ for full setup instructions."),
51
+ pc.dim("See README.md for full setup instructions."),
50
52
  ]
51
53
  .filter(Boolean)
52
54
  .join("\n"));
package/dist/prompts.js CHANGED
@@ -25,14 +25,26 @@ export async function runPrompts(projectNameArg) {
25
25
  return "Scope must start with @";
26
26
  },
27
27
  }),
28
- apps: () => p.multiselect({
28
+ apps: () => p.select({
29
29
  message: "Which apps do you want to scaffold?",
30
30
  options: [
31
- { value: "web", label: "Web", hint: "Next.js 15 + tRPC + Drizzle" },
32
- { value: "mobile", label: "Mobile", hint: "Expo SDK 52 + React Native" },
31
+ {
32
+ value: ["web"],
33
+ label: "Web only",
34
+ hint: "Next.js 15 + tRPC + Drizzle",
35
+ },
36
+ {
37
+ value: ["mobile"],
38
+ label: "Mobile only",
39
+ hint: "Expo SDK 52 + React Native",
40
+ },
41
+ {
42
+ value: ["web", "mobile"],
43
+ label: "Web + Mobile",
44
+ hint: "Both apps",
45
+ },
33
46
  ],
34
- initialValues: ["web", "mobile"],
35
- required: true,
47
+ initialValue: ["web"],
36
48
  }),
37
49
  environments: () => p.multiselect({
38
50
  message: "Which environments? (local is always included)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-pilotprojects-app",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "CLI to scaffold the Pilotprojects monorepo boilerplate",
5
5
  "keywords": [
6
6
  "create",
@@ -0,0 +1,120 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ A full-stack monorepo with Next.js web app and Expo mobile app, built on tRPC, Supabase, and Drizzle ORM.
4
+
5
+ ## Quick Start
6
+
7
+ ### 1. Set up environment variables
8
+
9
+ ```bash
10
+ # Web
11
+ cp apps/web/.env.local.example apps/web/.env.local
12
+
13
+ # Mobile (if applicable)
14
+ cp apps/mobile/.env.local.example apps/mobile/.env.local
15
+ ```
16
+
17
+ Open `.env.local` and fill in your values:
18
+
19
+ | Variable | Where to get it |
20
+ | --- | --- |
21
+ | `DATABASE_URL` | Supabase → Project Settings → Database → Connection string (Transaction pooler) |
22
+ | `SUPABASE_URL` | Supabase → Project Settings → API → Project URL |
23
+ | `SUPABASE_ANON_KEY` | Supabase → Project Settings → API → anon public |
24
+ | `SUPABASE_SERVICE_ROLE_KEY` | Supabase → Project Settings → API → service_role (keep secret) |
25
+ | `NEXT_PUBLIC_SUPABASE_URL` | Same as `SUPABASE_URL` |
26
+ | `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Same as `SUPABASE_ANON_KEY` |
27
+
28
+ ### 2. Start local Supabase
29
+
30
+ Requires the [Supabase CLI](https://supabase.com/docs/guides/cli).
31
+
32
+ ```bash
33
+ supabase start
34
+ ```
35
+
36
+ This starts a local Postgres database on port `54322` and the Supabase API on `54321`. The local credentials are already pre-filled in `.env.local.example`.
37
+
38
+ ### 3. Run database migrations
39
+
40
+ ```bash
41
+ pnpm --filter {{PACKAGE_SCOPE}}/db db:migrate
42
+ ```
43
+
44
+ ### 4. Start dev servers
45
+
46
+ ```bash
47
+ pnpm dev
48
+ # → web: http://localhost:3000
49
+ # → mobile: Expo DevTools (if mobile app is included)
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Environment Strategy
55
+
56
+ `local` is always present. Additional environments (development, uat, production) each have their own env file:
57
+
58
+ ```
59
+ apps/web/.env.local ← local Supabase (localhost)
60
+ apps/web/.env.development ← dev Supabase project
61
+ apps/web/.env.uat ← UAT Supabase project
62
+ apps/web/.env.production ← production Supabase project
63
+ ```
64
+
65
+ Copy the matching `.example` file for each environment you need and fill in the remote values.
66
+
67
+ ---
68
+
69
+ ## Common Commands
70
+
71
+ ```bash
72
+ # Install dependencies
73
+ pnpm install
74
+
75
+ # Lint all packages
76
+ pnpm lint
77
+
78
+ # Type-check all packages
79
+ pnpm type-check
80
+
81
+ # Generate a database migration after schema changes
82
+ pnpm --filter {{PACKAGE_SCOPE}}/db db:generate
83
+
84
+ # Apply migrations
85
+ pnpm --filter {{PACKAGE_SCOPE}}/db db:migrate
86
+
87
+ # Open Drizzle Studio (visual DB browser)
88
+ pnpm --filter {{PACKAGE_SCOPE}}/db db:studio
89
+ ```
90
+
91
+ ---
92
+
93
+ ## Project Structure
94
+
95
+ ```
96
+ apps/
97
+ web/ Next.js 15 (App Router)
98
+ mobile/ Expo SDK 52 / React Native
99
+
100
+ packages/
101
+ api/ tRPC routers — shared by web and mobile
102
+ auth/ Supabase Auth helpers
103
+ db/ Drizzle ORM schema + database client
104
+ ui/ Design system (web + native components)
105
+ validators/ Shared Zod schemas
106
+ email/ Resend + React Email templates
107
+ config/ Shared ESLint and TypeScript configs
108
+ ```
109
+
110
+ ## Adding API Features
111
+
112
+ Create a new feature folder in `packages/api/src/features/<name>/` with three files:
113
+
114
+ ```
115
+ <name>.schema.ts → Zod input/output types
116
+ <name>.service.ts → Business logic (pure async functions)
117
+ <name>.router.ts → tRPC router (validate → auth → call service)
118
+ ```
119
+
120
+ Register the router in `packages/api/src/root.ts`.