create-githat-app 1.0.0
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 +18 -0
- package/README.md +259 -0
- package/bin/index.js +6 -0
- package/dist/cli.js +623 -0
- package/package.json +42 -0
- package/templates/base/.env.example.hbs +13 -0
- package/templates/base/.env.local.hbs +10 -0
- package/templates/base/.gitignore.hbs +11 -0
- package/templates/base/githat/api/agents.ts.hbs +17 -0
- package/templates/base/githat/api/auth.ts.hbs +38 -0
- package/templates/base/githat/api/client.ts.hbs +92 -0
- package/templates/base/githat/api/mcp.ts.hbs +21 -0
- package/templates/base/githat/api/orgs.ts.hbs +34 -0
- package/templates/base/githat/api/types.ts.hbs +70 -0
- package/templates/base/githat/api/users.ts.hbs +14 -0
- package/templates/base/githat/auth/guard.tsx.hbs +53 -0
- package/templates/base/githat/auth/index.ts.hbs +3 -0
- package/templates/base/githat/config.ts.hbs +18 -0
- package/templates/base/githat/dashboard/agents.tsx.hbs +121 -0
- package/templates/base/githat/dashboard/apps.tsx.hbs +53 -0
- package/templates/base/githat/dashboard/layout.tsx.hbs +83 -0
- package/templates/base/githat/dashboard/mcp-servers.tsx.hbs +111 -0
- package/templates/base/githat/dashboard/members.tsx.hbs +123 -0
- package/templates/base/githat/dashboard/overview.tsx.hbs +37 -0
- package/templates/base/githat/dashboard/settings.tsx.hbs +87 -0
- package/templates/nextjs/app/(auth)/forgot-password/page.tsx.hbs +63 -0
- package/templates/nextjs/app/(auth)/sign-in/page.tsx.hbs +9 -0
- package/templates/nextjs/app/(auth)/sign-up/page.tsx.hbs +9 -0
- package/templates/nextjs/app/(auth)/verify-email/page.tsx.hbs +58 -0
- package/templates/nextjs/app/dashboard/agents/page.tsx.hbs +9 -0
- package/templates/nextjs/app/dashboard/apps/page.tsx.hbs +9 -0
- package/templates/nextjs/app/dashboard/layout.tsx.hbs +28 -0
- package/templates/nextjs/app/dashboard/mcp/page.tsx.hbs +9 -0
- package/templates/nextjs/app/dashboard/members/page.tsx.hbs +9 -0
- package/templates/nextjs/app/dashboard/page.tsx.hbs +30 -0
- package/templates/nextjs/app/dashboard/settings/page.tsx.hbs +9 -0
- package/templates/nextjs/app/globals.css.hbs +20 -0
- package/templates/nextjs/app/layout.tsx.hbs +33 -0
- package/templates/nextjs/app/page.tsx.hbs +18 -0
- package/templates/nextjs/middleware.ts.hbs +10 -0
- package/templates/nextjs/next.config.ts.hbs +5 -0
- package/templates/nextjs/postcss.config.mjs.hbs +9 -0
- package/templates/nextjs/tsconfig.json.hbs +21 -0
- package/templates/react-vite/index.html.hbs +12 -0
- package/templates/react-vite/src/App.tsx.hbs +46 -0
- package/templates/react-vite/src/index.css.hbs +20 -0
- package/templates/react-vite/src/main.tsx.hbs +30 -0
- package/templates/react-vite/src/pages/Dashboard.tsx.hbs +68 -0
- package/templates/react-vite/src/pages/ForgotPassword.tsx.hbs +58 -0
- package/templates/react-vite/src/pages/Home.tsx.hbs +18 -0
- package/templates/react-vite/src/pages/SignIn.tsx.hbs +9 -0
- package/templates/react-vite/src/pages/SignUp.tsx.hbs +9 -0
- package/templates/react-vite/src/pages/VerifyEmail.tsx.hbs +51 -0
- package/templates/react-vite/tsconfig.json.hbs +16 -0
- package/templates/react-vite/vite.config.ts.hbs +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 GitHat. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary property of GitHat. You may use the hosted GitHat service at
|
|
7
|
+
https://githat.io subject to the terms published there.
|
|
8
|
+
|
|
9
|
+
You may NOT copy, modify, merge, publish, distribute, sublicense, or sell
|
|
10
|
+
copies of the Software, or permit others to do so, without the prior written
|
|
11
|
+
permission of GitHat.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
16
|
+
GITHAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
17
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
18
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# create-githat-app
|
|
2
|
+
|
|
3
|
+
Scaffold enterprise-grade apps with [GitHat](https://githat.io) identity — for humans, AI agents, and MCP servers.
|
|
4
|
+
|
|
5
|
+
## Install & Launch
|
|
6
|
+
|
|
7
|
+
Run one command from anywhere:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx create-githat-app
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or with a project name:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx create-githat-app my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or install globally:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm i -g create-githat-app
|
|
23
|
+
create-githat-app my-app
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The CLI launches an interactive wizard that walks you through every decision.
|
|
27
|
+
|
|
28
|
+
## How It Works
|
|
29
|
+
|
|
30
|
+
### Step 1 — Answer the prompts
|
|
31
|
+
|
|
32
|
+
The CLI asks you a series of questions:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
◆ Project name?
|
|
36
|
+
│ my-saas-app
|
|
37
|
+
│
|
|
38
|
+
◆ Business name?
|
|
39
|
+
│ Acme Corp
|
|
40
|
+
│
|
|
41
|
+
◆ Framework?
|
|
42
|
+
│ ● Next.js 16 (App Router)
|
|
43
|
+
│ ○ React 19 + Vite 7
|
|
44
|
+
│
|
|
45
|
+
◆ Language?
|
|
46
|
+
│ ● TypeScript
|
|
47
|
+
│ ○ JavaScript
|
|
48
|
+
│
|
|
49
|
+
◆ Package manager?
|
|
50
|
+
│ ● npm
|
|
51
|
+
│ ○ yarn
|
|
52
|
+
│ ○ pnpm
|
|
53
|
+
│ ○ bun
|
|
54
|
+
│
|
|
55
|
+
◆ GitHat publishable key?
|
|
56
|
+
│ pk_live_abc123...
|
|
57
|
+
│
|
|
58
|
+
◆ Auth features to include?
|
|
59
|
+
│ ◻ Forgot password
|
|
60
|
+
│ ◻ Email verification
|
|
61
|
+
│ ◻ Organization management
|
|
62
|
+
│ ◻ MCP server identity
|
|
63
|
+
│ ◻ AI agent identity
|
|
64
|
+
│
|
|
65
|
+
◆ Database?
|
|
66
|
+
│ ● None
|
|
67
|
+
│ ○ Prisma + PostgreSQL
|
|
68
|
+
│ ○ Prisma + MySQL
|
|
69
|
+
│ ○ Drizzle + PostgreSQL
|
|
70
|
+
│ ○ Drizzle + SQLite
|
|
71
|
+
│
|
|
72
|
+
◆ Include Tailwind CSS 4?
|
|
73
|
+
│ ● Yes ○ No
|
|
74
|
+
│
|
|
75
|
+
◆ Include platform dashboard?
|
|
76
|
+
│ ● Yes ○ No
|
|
77
|
+
│
|
|
78
|
+
◆ Initialize git repository?
|
|
79
|
+
│ ● Yes ○ No
|
|
80
|
+
│
|
|
81
|
+
◆ Install dependencies now?
|
|
82
|
+
│ ● Yes ○ No
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Step 2 — Project is generated
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
◇ Project structure created
|
|
89
|
+
◇ package.json generated
|
|
90
|
+
◇ Git repository initialized
|
|
91
|
+
◇ Dependencies installed
|
|
92
|
+
|
|
93
|
+
◇ Setup complete!
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 3 — Start building
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
cd my-saas-app
|
|
100
|
+
npm run dev
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Your app is running at `http://localhost:3000` with auth, dashboard, and the full GitHat platform wired up.
|
|
104
|
+
|
|
105
|
+
## CLI Flags
|
|
106
|
+
|
|
107
|
+
Skip prompts with flags:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Use JavaScript instead of TypeScript
|
|
111
|
+
npx create-githat-app my-app --js
|
|
112
|
+
|
|
113
|
+
# Use TypeScript (default)
|
|
114
|
+
npx create-githat-app my-app --ts
|
|
115
|
+
|
|
116
|
+
# Pass your publishable key directly
|
|
117
|
+
npx create-githat-app my-app --key pk_live_abc123
|
|
118
|
+
|
|
119
|
+
# Combine flags
|
|
120
|
+
npx create-githat-app my-app --js --key pk_live_abc123
|
|
121
|
+
|
|
122
|
+
# Show help
|
|
123
|
+
npx create-githat-app --help
|
|
124
|
+
|
|
125
|
+
# Show version
|
|
126
|
+
npx create-githat-app --version
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## What You Get
|
|
130
|
+
|
|
131
|
+
A production-ready project with:
|
|
132
|
+
|
|
133
|
+
- **Auth pages** — sign-in, sign-up, forgot password, email verification
|
|
134
|
+
- **Protected dashboard** — sidebar navigation, org switcher, user button
|
|
135
|
+
- **`@githat/nextjs` SDK** — `<GitHatProvider>`, `<ProtectedRoute>`, `useAuth()`
|
|
136
|
+
- **`githat/` platform folder** — typed API client and dashboard modules
|
|
137
|
+
- **Dark theme** — zinc/purple design system out of the box
|
|
138
|
+
- **Database ready** — Prisma or Drizzle pre-configured (optional)
|
|
139
|
+
- **Tailwind CSS 4** — utility-first styling (optional)
|
|
140
|
+
|
|
141
|
+
## The `githat/` Folder
|
|
142
|
+
|
|
143
|
+
Your generated project includes a `githat/` directory — a local integration layer between your app and the GitHat platform API:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
githat/
|
|
147
|
+
config.ts # Central configuration (env vars, feature flags)
|
|
148
|
+
api/
|
|
149
|
+
client.ts # Typed fetch wrapper with token refresh
|
|
150
|
+
types.ts # TypeScript interfaces for all API responses
|
|
151
|
+
auth.ts # Login, register, forgot password, verify email
|
|
152
|
+
orgs.ts # Create/update orgs, invite/remove members
|
|
153
|
+
users.ts # List orgs, switch org
|
|
154
|
+
mcp.ts # Register/verify MCP servers
|
|
155
|
+
agents.ts # Register/verify AI agent wallets
|
|
156
|
+
auth/
|
|
157
|
+
guard.tsx # Role-based route protection component
|
|
158
|
+
index.ts # Auth exports
|
|
159
|
+
dashboard/
|
|
160
|
+
layout.tsx # Dashboard shell with sidebar navigation
|
|
161
|
+
overview.tsx # Stats overview page
|
|
162
|
+
apps.tsx # App + API key management
|
|
163
|
+
members.tsx # Invite members, manage roles, remove
|
|
164
|
+
settings.tsx # Edit org name, brand color, save
|
|
165
|
+
mcp-servers.tsx # Register MCP servers, verify, remove
|
|
166
|
+
agents.tsx # Register AI agent wallets, verify, remove
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
All API calls go to `api.githat.io`. The client handles auth tokens and automatic refresh.
|
|
170
|
+
|
|
171
|
+
## Three Identity Types
|
|
172
|
+
|
|
173
|
+
GitHat supports three types of identity in a single platform:
|
|
174
|
+
|
|
175
|
+
| Type | Auth Method | Dashboard Page |
|
|
176
|
+
| --------------- | -------------------------- | -------------- |
|
|
177
|
+
| **Humans** | Email + password | Members |
|
|
178
|
+
| **MCP Servers** | Domain verification | MCP Servers |
|
|
179
|
+
| **AI Agents** | Ethereum wallet signatures | AI Agents |
|
|
180
|
+
|
|
181
|
+
## Project Structure
|
|
182
|
+
|
|
183
|
+
### Next.js 16
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
my-app/
|
|
187
|
+
app/
|
|
188
|
+
layout.tsx
|
|
189
|
+
page.tsx
|
|
190
|
+
globals.css
|
|
191
|
+
(auth)/
|
|
192
|
+
sign-in/page.tsx
|
|
193
|
+
sign-up/page.tsx
|
|
194
|
+
forgot-password/page.tsx
|
|
195
|
+
verify-email/page.tsx
|
|
196
|
+
dashboard/
|
|
197
|
+
layout.tsx
|
|
198
|
+
page.tsx
|
|
199
|
+
apps/page.tsx
|
|
200
|
+
members/page.tsx
|
|
201
|
+
settings/page.tsx
|
|
202
|
+
mcp/page.tsx
|
|
203
|
+
agents/page.tsx
|
|
204
|
+
githat/
|
|
205
|
+
...
|
|
206
|
+
middleware.ts
|
|
207
|
+
next.config.ts
|
|
208
|
+
.env.local
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### React 19 + Vite 7
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
my-app/
|
|
215
|
+
src/
|
|
216
|
+
main.tsx
|
|
217
|
+
App.tsx
|
|
218
|
+
index.css
|
|
219
|
+
pages/
|
|
220
|
+
Home.tsx
|
|
221
|
+
SignIn.tsx
|
|
222
|
+
SignUp.tsx
|
|
223
|
+
ForgotPassword.tsx
|
|
224
|
+
VerifyEmail.tsx
|
|
225
|
+
Dashboard.tsx
|
|
226
|
+
githat/
|
|
227
|
+
...
|
|
228
|
+
index.html
|
|
229
|
+
vite.config.ts
|
|
230
|
+
.env.local
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Environment Variables
|
|
234
|
+
|
|
235
|
+
Generated `.env.local`:
|
|
236
|
+
|
|
237
|
+
```env
|
|
238
|
+
# Next.js
|
|
239
|
+
NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY=pk_live_...
|
|
240
|
+
NEXT_PUBLIC_GITHAT_API_URL=https://api.githat.io
|
|
241
|
+
|
|
242
|
+
# React/Vite
|
|
243
|
+
VITE_GITHAT_PUBLISHABLE_KEY=pk_live_...
|
|
244
|
+
VITE_GITHAT_API_URL=https://api.githat.io
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## Contributing
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
git clone https://github.com/GitHat-IO/create-githat-app.git
|
|
251
|
+
cd create-githat-app
|
|
252
|
+
npm install
|
|
253
|
+
npm run build
|
|
254
|
+
node bin/index.js test-app
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## License
|
|
258
|
+
|
|
259
|
+
MIT
|