r9stack 0.4.1
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/LICENSE +190 -0
- package/README.md +217 -0
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +239 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/payload/assets/.gitkeep +0 -0
- package/dist/payload/assets/favicon.ico +0 -0
- package/dist/payload/assets/images/r9stack-logo-markonly-circle.png +0 -0
- package/dist/payload/assets/images/r9stack-logo-markonly-whitebg.png +0 -0
- package/dist/payload/assets/images/r9stack-logo-markonly.png +0 -0
- package/dist/payload/assets/images/r9stack-logo.png +0 -0
- package/dist/payload/assets/logo192.png +0 -0
- package/dist/payload/assets/logo512.png +0 -0
- package/dist/payload/assets/manifest.json +26 -0
- package/dist/payload/assets/robots.txt +3 -0
- package/dist/payload/templates/.gitkeep +0 -0
- package/dist/payload/templates/config/components.json +25 -0
- package/dist/payload/templates/config/env.example +14 -0
- package/dist/payload/templates/config/tsconfig.json +26 -0
- package/dist/payload/templates/config/vite.config.ts +23 -0
- package/dist/payload/templates/convex/auth.config.ts +7 -0
- package/dist/payload/templates/convex/messages.ts +28 -0
- package/dist/payload/templates/convex/schema.ts +24 -0
- package/dist/payload/templates/convex/tsconfig.json +21 -0
- package/dist/payload/templates/src/components/AppShell.tsx +21 -0
- package/dist/payload/templates/src/components/AuthProvider.tsx +50 -0
- package/dist/payload/templates/src/components/ConvexClientProvider.tsx +20 -0
- package/dist/payload/templates/src/components/NavGroup.tsx +46 -0
- package/dist/payload/templates/src/components/NavItem.tsx +36 -0
- package/dist/payload/templates/src/components/Sidebar.tsx +76 -0
- package/dist/payload/templates/src/components/UserMenu.tsx +102 -0
- package/dist/payload/templates/src/components/ui/button.tsx +59 -0
- package/dist/payload/templates/src/lib/auth-client.ts +29 -0
- package/dist/payload/templates/src/lib/auth-server.ts +97 -0
- package/dist/payload/templates/src/lib/auth.ts +15 -0
- package/dist/payload/templates/src/lib/utils.ts +7 -0
- package/dist/payload/templates/src/router.tsx +18 -0
- package/dist/payload/templates/src/routes/__root.tsx +53 -0
- package/dist/payload/templates/src/routes/app/demo/convex.messages.tsx +66 -0
- package/dist/payload/templates/src/routes/app/index.tsx +20 -0
- package/dist/payload/templates/src/routes/app/route.tsx +23 -0
- package/dist/payload/templates/src/routes/auth/callback.tsx +36 -0
- package/dist/payload/templates/src/routes/auth/sign-in.tsx +22 -0
- package/dist/payload/templates/src/routes/auth/sign-out.tsx +22 -0
- package/dist/payload/templates/src/routes/index.tsx +85 -0
- package/dist/payload/templates/src/styles.css +141 -0
- package/dist/utils/exec.d.ts +17 -0
- package/dist/utils/exec.d.ts.map +1 -0
- package/dist/utils/exec.js +49 -0
- package/dist/utils/exec.js.map +1 -0
- package/dist/utils/flight-rules.d.ts +5 -0
- package/dist/utils/flight-rules.d.ts.map +1 -0
- package/dist/utils/flight-rules.js +23 -0
- package/dist/utils/flight-rules.js.map +1 -0
- package/dist/utils/github.d.ts +17 -0
- package/dist/utils/github.d.ts.map +1 -0
- package/dist/utils/github.js +64 -0
- package/dist/utils/github.js.map +1 -0
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +27 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/starters.d.ts +20 -0
- package/dist/utils/starters.d.ts.map +1 -0
- package/dist/utils/starters.js +43 -0
- package/dist/utils/starters.js.map +1 -0
- package/dist/utils/templates.d.ts +12 -0
- package/dist/utils/templates.d.ts.map +1 -0
- package/dist/utils/templates.js +77 -0
- package/dist/utils/templates.js.map +1 -0
- package/package.json +46 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 Ryan Packer
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/logo/r9stack-logo-clear.png" alt="r9stack" width="200" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
A CLI that scaffolds opinionated SaaS projects with a fully functional walking skeleton—a complete frontend, backend, and database stack with auth pre-integrated.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
## Status
|
|
10
|
+
|
|
11
|
+
🚀 **Available on npm** - Install with `npx r9stack@dev`
|
|
12
|
+
|
|
13
|
+
| Feature | Status |
|
|
14
|
+
|---------|--------|
|
|
15
|
+
| TanStack Start + React 19 | ✅ Working |
|
|
16
|
+
| Starter-based architecture | ✅ Working |
|
|
17
|
+
| shadcn/ui + Tailwind CSS | ✅ Working |
|
|
18
|
+
| Convex backend | ✅ Working |
|
|
19
|
+
| WorkOS auth | ✅ Working |
|
|
20
|
+
| Flight Rules docs | ✅ Working |
|
|
21
|
+
| GitHub repo creation | ✅ Working |
|
|
22
|
+
| Vercel deployment | 📋 Planned |
|
|
23
|
+
| Stripe payments | 📋 Post-V1 |
|
|
24
|
+
|
|
25
|
+
## Why r9stack?
|
|
26
|
+
|
|
27
|
+
Agentic coding has dramatically accelerated feature development, but initial project setup—configuring the frontend framework, wiring up the backend and database, integrating auth providers—remains tedious and error-prone.
|
|
28
|
+
|
|
29
|
+
r9stack eliminates this friction. Run a single command and have a scaffolded full-stack project in minutes.
|
|
30
|
+
|
|
31
|
+
## Architecture
|
|
32
|
+
|
|
33
|
+
r9stack uses TanStack Start's [starter system](docs/tanstack-start-starter-system.md) to create projects:
|
|
34
|
+
|
|
35
|
+
1. **CLI invokes TanStack Start** with a `--starter` flag pointing to a hosted `starter.json`
|
|
36
|
+
2. **TanStack Start creates the project** and applies r9stack customizations
|
|
37
|
+
3. **CLI guides post-creation setup** for Convex, WorkOS, and optional GitHub/Vercel integration
|
|
38
|
+
|
|
39
|
+
## Tech Stack
|
|
40
|
+
|
|
41
|
+
| Layer | Technology | Description |
|
|
42
|
+
|-------|------------|-------------|
|
|
43
|
+
| Framework | TanStack Start | Full-stack React framework with SSR and server functions |
|
|
44
|
+
| UI Library | React 19 | Declarative UI with the latest React features |
|
|
45
|
+
| Language | TypeScript | Type-safe JavaScript for reliable code |
|
|
46
|
+
| Styling | Tailwind CSS 4 | Utility-first CSS framework |
|
|
47
|
+
| Build | Vite | Lightning-fast build tool and dev server |
|
|
48
|
+
| Backend | Convex | Real-time backend with automatic sync |
|
|
49
|
+
| Auth | WorkOS AuthKit | Enterprise-ready SSO and MFA |
|
|
50
|
+
| Sessions | iron-session | Encrypted cookie-based sessions |
|
|
51
|
+
| Components | shadcn/ui | Beautiful, accessible Radix-based components |
|
|
52
|
+
|
|
53
|
+
## Getting Started
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Create a new project
|
|
57
|
+
npx r9stack@dev init my-project
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Local Development
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Clone the repository
|
|
64
|
+
git clone https://github.com/ryanpacker/r9stack.git
|
|
65
|
+
cd r9stack
|
|
66
|
+
|
|
67
|
+
# Install dependencies and build
|
|
68
|
+
npm install
|
|
69
|
+
npm run build
|
|
70
|
+
|
|
71
|
+
# Link globally for testing
|
|
72
|
+
npm link
|
|
73
|
+
|
|
74
|
+
# Create a new project
|
|
75
|
+
r9stack init my-project
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Interactive mode - prompts for project name and options
|
|
82
|
+
npx r9stack@dev init
|
|
83
|
+
|
|
84
|
+
# Provide project name directly
|
|
85
|
+
npx r9stack@dev init my-awesome-app
|
|
86
|
+
|
|
87
|
+
# Non-interactive with defaults (installs Flight Rules, skips GitHub)
|
|
88
|
+
npx r9stack@dev init my-awesome-app --yes
|
|
89
|
+
|
|
90
|
+
# Create with GitHub repo
|
|
91
|
+
npx r9stack@dev init my-awesome-app --yes --github
|
|
92
|
+
|
|
93
|
+
# Create public GitHub repo
|
|
94
|
+
npx r9stack@dev init my-awesome-app --github --public
|
|
95
|
+
|
|
96
|
+
# Skip Flight Rules installation
|
|
97
|
+
npx r9stack@dev init my-awesome-app --no-flight-rules
|
|
98
|
+
|
|
99
|
+
# Use a specific starter
|
|
100
|
+
npx r9stack@dev init my-awesome-app --starter standard
|
|
101
|
+
|
|
102
|
+
# List available starters
|
|
103
|
+
npx r9stack@dev --starter-list
|
|
104
|
+
|
|
105
|
+
# View help
|
|
106
|
+
npx r9stack@dev init --help
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### CLI Options
|
|
110
|
+
|
|
111
|
+
| Flag | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `-y, --yes` | Skip confirmation prompts |
|
|
114
|
+
| `-s, --starter <id>` | Use a specific starter (e.g., 'standard') |
|
|
115
|
+
| `--no-flight-rules` | Skip Flight Rules installation |
|
|
116
|
+
| `--github` | Create GitHub repository |
|
|
117
|
+
| `--no-github` | Skip GitHub repository creation |
|
|
118
|
+
| `--private` | Make GitHub repository private (default) |
|
|
119
|
+
| `--public` | Make GitHub repository public |
|
|
120
|
+
|
|
121
|
+
The CLI will:
|
|
122
|
+
1. Fetch the latest starter template from GitHub
|
|
123
|
+
2. Create your project using TanStack Start
|
|
124
|
+
3. Replace project name placeholders in generated files
|
|
125
|
+
4. Install [Flight Rules](https://github.com/ryanpacker/flight-rules) documentation framework
|
|
126
|
+
5. Optionally create a GitHub repository and push initial commit
|
|
127
|
+
6. Guide you through post-creation setup (Convex, WorkOS)
|
|
128
|
+
|
|
129
|
+
## What Gets Generated (V1 Target)
|
|
130
|
+
|
|
131
|
+
Running `npx r9stack@dev init` will create a project with:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
my-project/
|
|
135
|
+
├── .flight-rules/ # Flight Rules documentation framework
|
|
136
|
+
│ ├── AGENTS.md # Agent guidelines
|
|
137
|
+
│ ├── commands/ # Coding session workflows
|
|
138
|
+
│ └── doc-templates/ # Documentation templates
|
|
139
|
+
├── convex/
|
|
140
|
+
│ ├── _generated/ # Auto-generated by Convex
|
|
141
|
+
│ ├── schema.ts # Database schema
|
|
142
|
+
│ └── messages.ts # Demo Convex functions
|
|
143
|
+
├── public/
|
|
144
|
+
│ └── images/ # App logos and assets
|
|
145
|
+
├── src/
|
|
146
|
+
│ ├── components/
|
|
147
|
+
│ │ ├── ui/ # shadcn components
|
|
148
|
+
│ │ ├── AppShell.tsx # Application shell
|
|
149
|
+
│ │ ├── Sidebar.tsx # Collapsible sidebar
|
|
150
|
+
│ │ ├── NavGroup.tsx # Navigation group
|
|
151
|
+
│ │ ├── NavItem.tsx # Navigation item
|
|
152
|
+
│ │ └── UserMenu.tsx # Auth-aware user menu
|
|
153
|
+
│ ├── lib/
|
|
154
|
+
│ │ ├── auth.ts # Auth types
|
|
155
|
+
│ │ ├── auth-client.ts # Client-side auth context
|
|
156
|
+
│ │ ├── auth-server.ts # Server-side auth (iron-session)
|
|
157
|
+
│ │ └── utils.ts # Utilities (cn helper)
|
|
158
|
+
│ ├── routes/
|
|
159
|
+
│ │ ├── __root.tsx # Root layout with providers
|
|
160
|
+
│ │ ├── index.tsx # Public landing page
|
|
161
|
+
│ │ ├── auth/ # Auth flow routes
|
|
162
|
+
│ │ │ ├── sign-in.tsx
|
|
163
|
+
│ │ │ ├── callback.tsx
|
|
164
|
+
│ │ │ └── sign-out.tsx
|
|
165
|
+
│ │ └── app/ # Protected routes
|
|
166
|
+
│ │ ├── route.tsx # Auth guard + AppShell
|
|
167
|
+
│ │ ├── index.tsx # Authenticated home
|
|
168
|
+
│ │ └── demo/ # Demo pages
|
|
169
|
+
│ └── styles.css # Tailwind + shadcn styles
|
|
170
|
+
├── .env.example
|
|
171
|
+
├── components.json # shadcn configuration
|
|
172
|
+
├── package.json
|
|
173
|
+
├── tsconfig.json
|
|
174
|
+
└── vite.config.ts
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Route Structure
|
|
178
|
+
|
|
179
|
+
- `/` — Public landing page
|
|
180
|
+
- `/auth/*` — Authentication flow (sign-in, callback, sign-out)
|
|
181
|
+
- `/app/*` — Protected routes (requires authentication)
|
|
182
|
+
|
|
183
|
+
## Manual Setup Required
|
|
184
|
+
|
|
185
|
+
After scaffolding, you'll need to:
|
|
186
|
+
|
|
187
|
+
1. **Set up WorkOS** — Create account at https://workos.com, configure redirect URI
|
|
188
|
+
2. **Set up Convex** — Run `npx convex dev` to create project and authenticate
|
|
189
|
+
3. **Add environment variables** — Copy `.env.example` to `.env.local` and fill in credentials
|
|
190
|
+
|
|
191
|
+
## Project Structure
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
r9stack/
|
|
195
|
+
├── src/ # CLI source code
|
|
196
|
+
├── starters/
|
|
197
|
+
│ └── standard/ # r9-starter-standard source
|
|
198
|
+
├── tests/
|
|
199
|
+
│ ├── e2e/ # End-to-end tests
|
|
200
|
+
│ └── output/ # Test output (gitignored)
|
|
201
|
+
├── docs/
|
|
202
|
+
│ ├── prd.md # Product requirements
|
|
203
|
+
│ ├── implementation/ # Implementation specs
|
|
204
|
+
│ └── ...
|
|
205
|
+
└── dist/ # Compiled CLI
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Documentation
|
|
209
|
+
|
|
210
|
+
- [Product Requirements](docs/prd.md)
|
|
211
|
+
- [TanStack Starter System](docs/tanstack-start-starter-system.md)
|
|
212
|
+
- [Starter Development Guide](docs/starter-development.md)
|
|
213
|
+
- [Tech Stack](docs/tech-stack.md)
|
|
214
|
+
|
|
215
|
+
## License
|
|
216
|
+
|
|
217
|
+
Apache 2.0 - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InitOptions {
|
|
2
|
+
starter?: string;
|
|
3
|
+
yes?: boolean;
|
|
4
|
+
flightRules?: boolean;
|
|
5
|
+
github?: boolean;
|
|
6
|
+
private?: boolean;
|
|
7
|
+
public?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function initCommand(projectName: string | undefined, options: InitOptions): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,WAAW,CAC/B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAkQf"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { input, confirm, select } from "@inquirer/prompts";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import pc from "picocolors";
|
|
5
|
+
import { createTanStackProject } from "../utils/exec.js";
|
|
6
|
+
import { logger } from "../utils/logger.js";
|
|
7
|
+
import { getDefaultStarter, getStarterById, fetchStarters, } from "../utils/starters.js";
|
|
8
|
+
import { replaceProjectNamePlaceholder } from "../utils/templates.js";
|
|
9
|
+
import { installFlightRules } from "../utils/flight-rules.js";
|
|
10
|
+
import { isGhCliInstalled, isGhCliAuthenticated, initGitRepo, createGitHubRepo, } from "../utils/github.js";
|
|
11
|
+
export async function initCommand(projectName, options) {
|
|
12
|
+
logger.banner("r9stack - Scaffold your SaaS");
|
|
13
|
+
// Fetch the starter
|
|
14
|
+
let starter;
|
|
15
|
+
try {
|
|
16
|
+
logger.info("Fetching available starters...");
|
|
17
|
+
if (options.starter) {
|
|
18
|
+
// User specified a starter by ID
|
|
19
|
+
const found = await getStarterById(options.starter);
|
|
20
|
+
if (!found) {
|
|
21
|
+
logger.error(`Starter "${options.starter}" not found.`);
|
|
22
|
+
logger.blank();
|
|
23
|
+
logger.info("Available starters:");
|
|
24
|
+
const starters = await fetchStarters();
|
|
25
|
+
for (const s of starters) {
|
|
26
|
+
const shortId = s.id.replace("r9-starter-", "");
|
|
27
|
+
console.log(` ${pc.cyan(shortId)} - ${s.name}`);
|
|
28
|
+
}
|
|
29
|
+
logger.blank();
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
starter = found;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
// Use default starter
|
|
36
|
+
starter = await getDefaultStarter();
|
|
37
|
+
}
|
|
38
|
+
logger.blank();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
logger.error("Could not fetch starters. Please check your internet connection.");
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
44
|
+
// Show starter info
|
|
45
|
+
logger.info(`Using starter: ${pc.cyan(starter.name)} v${starter.version}`);
|
|
46
|
+
logger.info(pc.dim(starter.description));
|
|
47
|
+
logger.blank();
|
|
48
|
+
// Prompt for project name if not provided
|
|
49
|
+
const name = projectName ||
|
|
50
|
+
(await input({
|
|
51
|
+
message: "What is your project name?",
|
|
52
|
+
default: "my-r9-project",
|
|
53
|
+
validate: (value) => {
|
|
54
|
+
if (!value.trim()) {
|
|
55
|
+
return "Project name is required";
|
|
56
|
+
}
|
|
57
|
+
if (!/^[a-z0-9-]+$/.test(value)) {
|
|
58
|
+
return "Project name must be lowercase alphanumeric with hyphens only";
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
const targetPath = resolve(process.cwd(), name);
|
|
64
|
+
// Check if directory exists
|
|
65
|
+
if (existsSync(targetPath)) {
|
|
66
|
+
if (options.yes) {
|
|
67
|
+
logger.warn(`Directory ${pc.yellow(name)} already exists. Continuing...`);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
const proceed = await confirm({
|
|
71
|
+
message: `Directory ${pc.yellow(name)} already exists. Continue anyway?`,
|
|
72
|
+
default: false,
|
|
73
|
+
});
|
|
74
|
+
if (!proceed) {
|
|
75
|
+
logger.info("Aborted.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
// Confirm before proceeding
|
|
81
|
+
logger.blank();
|
|
82
|
+
logger.info(`Project: ${pc.cyan(name)}`);
|
|
83
|
+
logger.info(`Location: ${pc.cyan(targetPath)}`);
|
|
84
|
+
logger.blank();
|
|
85
|
+
if (!options.yes) {
|
|
86
|
+
const confirmed = await confirm({
|
|
87
|
+
message: "Create project with these settings?",
|
|
88
|
+
default: true,
|
|
89
|
+
});
|
|
90
|
+
if (!confirmed) {
|
|
91
|
+
logger.info("Aborted.");
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
logger.blank();
|
|
96
|
+
// Create the TanStack Start project with starter
|
|
97
|
+
const success = await createTanStackProject(name, starter.url);
|
|
98
|
+
if (!success) {
|
|
99
|
+
process.exit(1);
|
|
100
|
+
}
|
|
101
|
+
// Replace project name placeholder in generated files
|
|
102
|
+
replaceProjectNamePlaceholder(targetPath, name);
|
|
103
|
+
logger.blank();
|
|
104
|
+
logger.success("Project created successfully!");
|
|
105
|
+
logger.blank();
|
|
106
|
+
// Track what was installed for next steps
|
|
107
|
+
let flightRulesInstalled = false;
|
|
108
|
+
let gitHubRepoCreated = false;
|
|
109
|
+
let repoVisibility = "private";
|
|
110
|
+
// === Flight Rules Installation ===
|
|
111
|
+
// Default: install unless --no-flight-rules was specified
|
|
112
|
+
const shouldInstallFlightRules = options.flightRules !== false;
|
|
113
|
+
if (shouldInstallFlightRules) {
|
|
114
|
+
let doInstall = options.yes; // With --yes, auto-install
|
|
115
|
+
if (!options.yes) {
|
|
116
|
+
doInstall = await confirm({
|
|
117
|
+
message: "Install Flight Rules documentation framework?",
|
|
118
|
+
default: true,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (doInstall) {
|
|
122
|
+
flightRulesInstalled = await installFlightRules(targetPath);
|
|
123
|
+
if (flightRulesInstalled) {
|
|
124
|
+
logger.success("Flight Rules installed!");
|
|
125
|
+
}
|
|
126
|
+
logger.blank();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// === GitHub Repository Creation ===
|
|
130
|
+
// Default: skip with --yes (unless --github is specified)
|
|
131
|
+
// Interactive: prompt the user
|
|
132
|
+
const githubExplicitlyEnabled = options.github === true;
|
|
133
|
+
const githubExplicitlyDisabled = options.github === false;
|
|
134
|
+
let shouldCreateGitHub = false;
|
|
135
|
+
if (githubExplicitlyDisabled) {
|
|
136
|
+
shouldCreateGitHub = false;
|
|
137
|
+
}
|
|
138
|
+
else if (githubExplicitlyEnabled) {
|
|
139
|
+
shouldCreateGitHub = true;
|
|
140
|
+
}
|
|
141
|
+
else if (options.yes) {
|
|
142
|
+
// With --yes but no explicit flag, skip GitHub
|
|
143
|
+
shouldCreateGitHub = false;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
// Interactive mode: ask the user
|
|
147
|
+
shouldCreateGitHub = await confirm({
|
|
148
|
+
message: "Create a GitHub repository for this project?",
|
|
149
|
+
default: false,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (shouldCreateGitHub) {
|
|
153
|
+
// Check if gh CLI is installed
|
|
154
|
+
const ghInstalled = await isGhCliInstalled();
|
|
155
|
+
if (!ghInstalled) {
|
|
156
|
+
logger.warn("GitHub CLI (gh) is not installed.");
|
|
157
|
+
logger.info("Install it from: https://cli.github.com/");
|
|
158
|
+
logger.info("Then run: gh auth login");
|
|
159
|
+
logger.blank();
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
// Check if authenticated
|
|
163
|
+
const ghAuthenticated = await isGhCliAuthenticated();
|
|
164
|
+
if (!ghAuthenticated) {
|
|
165
|
+
logger.warn("GitHub CLI is not authenticated.");
|
|
166
|
+
logger.info("Run: gh auth login");
|
|
167
|
+
logger.blank();
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
// Determine visibility
|
|
171
|
+
if (options.public) {
|
|
172
|
+
repoVisibility = "public";
|
|
173
|
+
}
|
|
174
|
+
else if (options.private) {
|
|
175
|
+
repoVisibility = "private";
|
|
176
|
+
}
|
|
177
|
+
else if (!options.yes) {
|
|
178
|
+
// Prompt for visibility
|
|
179
|
+
repoVisibility = await select({
|
|
180
|
+
message: "Repository visibility:",
|
|
181
|
+
choices: [
|
|
182
|
+
{ name: "Private", value: "private" },
|
|
183
|
+
{ name: "Public", value: "public" },
|
|
184
|
+
],
|
|
185
|
+
default: "private",
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Initialize git repo
|
|
189
|
+
logger.info("Initializing git repository...");
|
|
190
|
+
const gitInitialized = await initGitRepo(targetPath);
|
|
191
|
+
if (gitInitialized) {
|
|
192
|
+
logger.info(`Creating ${repoVisibility} GitHub repository...`);
|
|
193
|
+
gitHubRepoCreated = await createGitHubRepo(targetPath, name, repoVisibility === "private");
|
|
194
|
+
if (gitHubRepoCreated) {
|
|
195
|
+
logger.success(`GitHub repository created and pushed!`);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
logger.blank();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// Next steps (adjusted based on what was installed)
|
|
203
|
+
logger.info("Next steps:");
|
|
204
|
+
logger.blank();
|
|
205
|
+
let stepNumber = 1;
|
|
206
|
+
// Only show cd step if we're not already in the project
|
|
207
|
+
console.log(` ${pc.cyan(`${stepNumber}.`)} Navigate to your project:`);
|
|
208
|
+
console.log(` ${pc.dim("$")} ${pc.cyan("cd")} ${name}`);
|
|
209
|
+
logger.blank();
|
|
210
|
+
stepNumber++;
|
|
211
|
+
console.log(` ${pc.cyan(`${stepNumber}.`)} Set up Convex (real-time database):`);
|
|
212
|
+
console.log(` ${pc.dim("$")} ${pc.cyan("npx convex dev")}`);
|
|
213
|
+
console.log(` ${pc.dim("This will create your Convex project and generate types.")}`);
|
|
214
|
+
logger.blank();
|
|
215
|
+
stepNumber++;
|
|
216
|
+
console.log(` ${pc.cyan(`${stepNumber}.`)} Configure WorkOS authentication:`);
|
|
217
|
+
console.log(` ${pc.dim("•")} Go to ${pc.underline("https://dashboard.workos.com")}`);
|
|
218
|
+
console.log(` ${pc.dim("•")} Create a project and copy your API keys`);
|
|
219
|
+
console.log(` ${pc.dim("•")} Add them to your ${pc.cyan(".env")} file`);
|
|
220
|
+
logger.blank();
|
|
221
|
+
stepNumber++;
|
|
222
|
+
console.log(` ${pc.cyan(`${stepNumber}.`)} Start the development server:`);
|
|
223
|
+
console.log(` ${pc.dim("$")} ${pc.cyan("npm run dev")}`);
|
|
224
|
+
logger.blank();
|
|
225
|
+
// Show summary of what was set up
|
|
226
|
+
if (flightRulesInstalled || gitHubRepoCreated) {
|
|
227
|
+
logger.info("Additional setup completed:");
|
|
228
|
+
if (flightRulesInstalled) {
|
|
229
|
+
console.log(` ${pc.green("✓")} Flight Rules documentation framework`);
|
|
230
|
+
}
|
|
231
|
+
if (gitHubRepoCreated) {
|
|
232
|
+
console.log(` ${pc.green("✓")} GitHub repository (${repoVisibility})`);
|
|
233
|
+
}
|
|
234
|
+
logger.blank();
|
|
235
|
+
}
|
|
236
|
+
logger.info(`${pc.dim("For more info, see the README.md in your project.")}`);
|
|
237
|
+
logger.blank();
|
|
238
|
+
}
|
|
239
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,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