nitrostack 1.0.73 → 1.0.75
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/dist/auth/__tests__/api-key.test.d.ts +2 -0
- package/dist/auth/__tests__/api-key.test.d.ts.map +1 -0
- package/dist/auth/__tests__/api-key.test.js +136 -0
- package/dist/auth/__tests__/api-key.test.js.map +1 -0
- package/dist/auth/__tests__/middleware.test.d.ts +2 -0
- package/dist/auth/__tests__/middleware.test.d.ts.map +1 -0
- package/dist/auth/__tests__/middleware.test.js +186 -0
- package/dist/auth/__tests__/middleware.test.js.map +1 -0
- package/dist/auth/__tests__/pkce.test.d.ts +2 -0
- package/dist/auth/__tests__/pkce.test.d.ts.map +1 -0
- package/dist/auth/__tests__/pkce.test.js +110 -0
- package/dist/auth/__tests__/pkce.test.js.map +1 -0
- package/dist/auth/__tests__/secure-secret.test.d.ts +2 -0
- package/dist/auth/__tests__/secure-secret.test.d.ts.map +1 -0
- package/dist/auth/__tests__/secure-secret.test.js +42 -0
- package/dist/auth/__tests__/secure-secret.test.js.map +1 -0
- package/dist/auth/__tests__/simple-jwt.test.d.ts +2 -0
- package/dist/auth/__tests__/simple-jwt.test.d.ts.map +1 -0
- package/dist/auth/__tests__/simple-jwt.test.js +219 -0
- package/dist/auth/__tests__/simple-jwt.test.js.map +1 -0
- package/dist/auth/__tests__/token-store.test.d.ts +2 -0
- package/dist/auth/__tests__/token-store.test.d.ts.map +1 -0
- package/dist/auth/__tests__/token-store.test.js +79 -0
- package/dist/auth/__tests__/token-store.test.js.map +1 -0
- package/dist/auth/__tests__/token-validation.test.d.ts +2 -0
- package/dist/auth/__tests__/token-validation.test.d.ts.map +1 -0
- package/dist/auth/__tests__/token-validation.test.js +23 -0
- package/dist/auth/__tests__/token-validation.test.js.map +1 -0
- package/dist/cli/__tests__/cli-dev.test.d.ts +2 -0
- package/dist/cli/__tests__/cli-dev.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cli-dev.test.js +83 -0
- package/dist/cli/__tests__/cli-dev.test.js.map +1 -0
- package/dist/cli/__tests__/cli-start.test.d.ts +2 -0
- package/dist/cli/__tests__/cli-start.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cli-start.test.js +61 -0
- package/dist/cli/__tests__/cli-start.test.js.map +1 -0
- package/dist/cli/__tests__/cli.test.d.ts +2 -0
- package/dist/cli/__tests__/cli.test.d.ts.map +1 -0
- package/dist/cli/__tests__/cli.test.js +73 -0
- package/dist/cli/__tests__/cli.test.js.map +1 -0
- package/dist/cli/__tests__/commands.test.d.ts +2 -0
- package/dist/cli/__tests__/commands.test.d.ts.map +1 -0
- package/dist/cli/__tests__/commands.test.js +64 -0
- package/dist/cli/__tests__/commands.test.js.map +1 -0
- package/dist/cli/commands/install.d.ts +10 -0
- package/dist/cli/commands/install.d.ts.map +1 -0
- package/dist/cli/commands/install.js +79 -0
- package/dist/cli/commands/install.js.map +1 -0
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +76 -45
- package/dist/cli/index.js.map +1 -1
- package/dist/core/__tests__/core-modules.test.d.ts +2 -0
- package/dist/core/__tests__/core-modules.test.d.ts.map +1 -0
- package/dist/core/__tests__/core-modules.test.js +36 -0
- package/dist/core/__tests__/core-modules.test.js.map +1 -0
- package/dist/core/__tests__/errors.test.d.ts +2 -0
- package/dist/core/__tests__/errors.test.d.ts.map +1 -0
- package/dist/core/__tests__/errors.test.js +109 -0
- package/dist/core/__tests__/errors.test.js.map +1 -0
- package/dist/core/__tests__/logger.test.d.ts +2 -0
- package/dist/core/__tests__/logger.test.d.ts.map +1 -0
- package/dist/core/__tests__/logger.test.js +83 -0
- package/dist/core/__tests__/logger.test.js.map +1 -0
- package/dist/core/__tests__/models.test.d.ts +2 -0
- package/dist/core/__tests__/models.test.d.ts.map +1 -0
- package/dist/core/__tests__/models.test.js +142 -0
- package/dist/core/__tests__/models.test.js.map +1 -0
- package/dist/core/__tests__/module.test.d.ts +2 -0
- package/dist/core/__tests__/module.test.d.ts.map +1 -0
- package/dist/core/__tests__/module.test.js +60 -0
- package/dist/core/__tests__/module.test.js.map +1 -0
- package/dist/core/__tests__/prompt.test.d.ts +2 -0
- package/dist/core/__tests__/prompt.test.d.ts.map +1 -0
- package/dist/core/__tests__/prompt.test.js +126 -0
- package/dist/core/__tests__/prompt.test.js.map +1 -0
- package/dist/core/__tests__/resource.test.d.ts +2 -0
- package/dist/core/__tests__/resource.test.d.ts.map +1 -0
- package/dist/core/__tests__/resource.test.js +173 -0
- package/dist/core/__tests__/resource.test.js.map +1 -0
- package/dist/core/__tests__/server.test.d.ts +2 -0
- package/dist/core/__tests__/server.test.d.ts.map +1 -0
- package/dist/core/__tests__/server.test.js +120 -0
- package/dist/core/__tests__/server.test.js.map +1 -0
- package/dist/core/__tests__/transports.test.d.ts +2 -0
- package/dist/core/__tests__/transports.test.d.ts.map +1 -0
- package/dist/core/__tests__/transports.test.js +12 -0
- package/dist/core/__tests__/transports.test.js.map +1 -0
- package/dist/core/decorators/__tests__/decorators.test.d.ts +2 -0
- package/dist/core/decorators/__tests__/decorators.test.d.ts.map +1 -0
- package/dist/core/decorators/__tests__/decorators.test.js +103 -0
- package/dist/core/decorators/__tests__/decorators.test.js.map +1 -0
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts +2 -0
- package/dist/core/decorators/__tests__/extended-decorators.test.d.ts.map +1 -0
- package/dist/core/decorators/__tests__/extended-decorators.test.js +194 -0
- package/dist/core/decorators/__tests__/extended-decorators.test.js.map +1 -0
- package/dist/core/di/__tests__/container.test.d.ts +2 -0
- package/dist/core/di/__tests__/container.test.d.ts.map +1 -0
- package/dist/core/di/__tests__/container.test.js +88 -0
- package/dist/core/di/__tests__/container.test.js.map +1 -0
- package/dist/core/events/__tests__/events.test.d.ts +2 -0
- package/dist/core/events/__tests__/events.test.d.ts.map +1 -0
- package/dist/core/events/__tests__/events.test.js +177 -0
- package/dist/core/events/__tests__/events.test.js.map +1 -0
- package/dist/core/filters/__tests__/filters.test.d.ts +2 -0
- package/dist/core/filters/__tests__/filters.test.d.ts.map +1 -0
- package/dist/core/filters/__tests__/filters.test.js +72 -0
- package/dist/core/filters/__tests__/filters.test.js.map +1 -0
- package/dist/core/guards/__tests__/guards.test.d.ts +2 -0
- package/dist/core/guards/__tests__/guards.test.d.ts.map +1 -0
- package/dist/core/guards/__tests__/guards.test.js +55 -0
- package/dist/core/guards/__tests__/guards.test.js.map +1 -0
- package/dist/core/health/__tests__/health.test.d.ts +2 -0
- package/dist/core/health/__tests__/health.test.d.ts.map +1 -0
- package/dist/core/health/__tests__/health.test.js +31 -0
- package/dist/core/health/__tests__/health.test.js.map +1 -0
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts +2 -0
- package/dist/core/interceptors/__tests__/interceptors.test.d.ts.map +1 -0
- package/dist/core/interceptors/__tests__/interceptors.test.js +52 -0
- package/dist/core/interceptors/__tests__/interceptors.test.js.map +1 -0
- package/dist/core/middleware/__tests__/middleware.test.d.ts +2 -0
- package/dist/core/middleware/__tests__/middleware.test.d.ts.map +1 -0
- package/dist/core/middleware/__tests__/middleware.test.js +105 -0
- package/dist/core/middleware/__tests__/middleware.test.js.map +1 -0
- package/dist/core/pipes/__tests__/pipes.test.d.ts +2 -0
- package/dist/core/pipes/__tests__/pipes.test.d.ts.map +1 -0
- package/dist/core/pipes/__tests__/pipes.test.js +164 -0
- package/dist/core/pipes/__tests__/pipes.test.js.map +1 -0
- package/dist/core/transports/__tests__/transports.test.d.ts +2 -0
- package/dist/core/transports/__tests__/transports.test.d.ts.map +1 -0
- package/dist/core/transports/__tests__/transports.test.js +249 -0
- package/dist/core/transports/__tests__/transports.test.js.map +1 -0
- package/dist/core/widgets/__tests__/registry.test.d.ts +2 -0
- package/dist/core/widgets/__tests__/registry.test.d.ts.map +1 -0
- package/dist/core/widgets/__tests__/registry.test.js +69 -0
- package/dist/core/widgets/__tests__/registry.test.js.map +1 -0
- package/dist/testing/__tests__/testing.test.d.ts +2 -0
- package/dist/testing/__tests__/testing.test.d.ts.map +1 -0
- package/dist/testing/__tests__/testing.test.js +167 -0
- package/dist/testing/__tests__/testing.test.js.map +1 -0
- package/dist/testing/index.d.ts +0 -6
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/ui-next/__tests__/ui-next.test.d.ts +2 -0
- package/dist/ui-next/__tests__/ui-next.test.d.ts.map +1 -0
- package/dist/ui-next/__tests__/ui-next.test.js +74 -0
- package/dist/ui-next/__tests__/ui-next.test.js.map +1 -0
- package/dist/widgets/__tests__/utils.test.d.ts +2 -0
- package/dist/widgets/__tests__/utils.test.d.ts.map +1 -0
- package/dist/widgets/__tests__/utils.test.js +80 -0
- package/dist/widgets/__tests__/utils.test.js.map +1 -0
- package/dist/widgets/__tests__/widgets.test.d.ts +2 -0
- package/dist/widgets/__tests__/widgets.test.d.ts.map +1 -0
- package/dist/widgets/__tests__/widgets.test.js +245 -0
- package/dist/widgets/__tests__/widgets.test.js.map +1 -0
- package/dist/widgets/hooks/__tests__/hooks.test.d.ts +2 -0
- package/dist/widgets/hooks/__tests__/hooks.test.d.ts.map +1 -0
- package/dist/widgets/hooks/__tests__/hooks.test.js +129 -0
- package/dist/widgets/hooks/__tests__/hooks.test.js.map +1 -0
- package/dist/widgets/hooks/__tests__/use-widget-state.test.d.ts +2 -0
- package/dist/widgets/hooks/__tests__/use-widget-state.test.d.ts.map +1 -0
- package/dist/widgets/hooks/__tests__/use-widget-state.test.js +66 -0
- package/dist/widgets/hooks/__tests__/use-widget-state.test.js.map +1 -0
- package/dist/widgets/runtime/__tests__/widget-polyfill.test.d.ts +2 -0
- package/dist/widgets/runtime/__tests__/widget-polyfill.test.d.ts.map +1 -0
- package/dist/widgets/runtime/__tests__/widget-polyfill.test.js +66 -0
- package/dist/widgets/runtime/__tests__/widget-polyfill.test.js.map +1 -0
- package/package.json +6 -2
- package/src/studio/app/chat/page.tsx +21 -0
- package/src/studio/components/WidgetErrorBoundary.tsx +1 -0
- package/src/studio/components/ops/index.ts +1 -0
- package/src/studio/components/ops/nodes/index.ts +1 -0
- package/src/studio/lib/llm-service.ts +77 -10
- package/templates/typescript-oauth/OAUTH_SETUP.md +592 -0
- package/templates/typescript-oauth/README.md +186 -235
- package/templates/typescript-oauth/package.json +5 -3
- package/templates/typescript-pizzaz/README.md +78 -57
- package/templates/typescript-pizzaz/package.json +32 -30
- package/templates/typescript-starter/README.md +22 -14
- package/templates/typescript-starter/package.json +4 -1
- package/templates/typescript-starter/package-lock.json +0 -4112
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 🍕
|
|
1
|
+
# 🍕 NitroStack Pizza Shop Finder
|
|
2
2
|
|
|
3
|
-
A comprehensive NitroStack template showcasing interactive pizza shop discovery with maps, lists, and detailed views. This template demonstrates the NitroStack Widget SDK for building interactive widgets.
|
|
3
|
+
A comprehensive NitroStack template showcasing interactive pizza shop discovery with maps, lists, and detailed views. This template demonstrates the NitroStack Widget SDK for building beautiful, interactive widgets.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -22,55 +22,64 @@ A comprehensive NitroStack template showcasing interactive pizza shop discovery
|
|
|
22
22
|
- `show_pizza_list` - Show filterable list of shops
|
|
23
23
|
- `show_pizza_shop` - Display detailed shop information
|
|
24
24
|
|
|
25
|
-
## Quick Start
|
|
25
|
+
## 🚀 Quick Start
|
|
26
26
|
|
|
27
|
-
###
|
|
27
|
+
### Prerequisites
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
30
|
+
# Install NitroStack CLI globally
|
|
31
|
+
npm install -g nitrostack
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
# Or use npx
|
|
34
|
+
npx nitrostack --version
|
|
35
|
+
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
### Setup Your Project
|
|
37
38
|
|
|
38
|
-
1. Get a free API key from [Mapbox](https://www.mapbox.com/)
|
|
39
|
-
2. Create `.env` file:
|
|
40
39
|
```bash
|
|
41
|
-
|
|
40
|
+
# Create a new project
|
|
41
|
+
nitrostack init my-pizza-app --template typescript-pizzaz
|
|
42
|
+
cd my-pizza-app
|
|
43
|
+
|
|
44
|
+
# Install all dependencies (root + widgets)
|
|
45
|
+
npm install
|
|
46
|
+
# or
|
|
47
|
+
nitrostack install
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
### Configure Mapbox (Optional but Recommended)
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
The map widget uses Mapbox GL for beautiful interactive maps:
|
|
53
|
+
|
|
54
|
+
1. Get a **free** API key from [Mapbox](https://www.mapbox.com/) (sign up takes 1 minute)
|
|
55
|
+
2. Create `src/widgets/.env` file:
|
|
47
56
|
|
|
48
57
|
```bash
|
|
49
|
-
|
|
58
|
+
NEXT_PUBLIC_MAPBOX_TOKEN=your_mapbox_token_here
|
|
50
59
|
```
|
|
51
60
|
|
|
52
|
-
The
|
|
61
|
+
> **Note**: The template works without Mapbox, but the map widget will show a placeholder. You can still use the list and shop detail widgets.
|
|
53
62
|
|
|
54
|
-
###
|
|
55
|
-
|
|
56
|
-
In a separate terminal:
|
|
63
|
+
### Run Development Server
|
|
57
64
|
|
|
58
65
|
```bash
|
|
59
|
-
npm run
|
|
66
|
+
npm run dev
|
|
60
67
|
```
|
|
61
68
|
|
|
62
|
-
|
|
69
|
+
This starts:
|
|
70
|
+
- **MCP Server** - Hot reloads on code changes
|
|
71
|
+
- **Studio** on http://localhost:3000 - Visual testing environment
|
|
72
|
+
- **Widget Dev Server** on http://localhost:3001 - Hot module replacement
|
|
63
73
|
|
|
64
|
-
###
|
|
74
|
+
### Test in Studio
|
|
65
75
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- "Show me details for Tony's New York Pizza"
|
|
76
|
+
Try these prompts in Studio chat:
|
|
77
|
+
- "Show me pizza shops on a map"
|
|
78
|
+
- "List all pizza shops"
|
|
79
|
+
- "Show me details for Tony's New York Pizza"
|
|
80
|
+
- "Find pizza shops with high ratings"
|
|
72
81
|
|
|
73
|
-
## Project Structure
|
|
82
|
+
## 📁 Project Structure
|
|
74
83
|
|
|
75
84
|
```
|
|
76
85
|
typescript-pizzaz/
|
|
@@ -94,7 +103,7 @@ typescript-pizzaz/
|
|
|
94
103
|
└── README.md
|
|
95
104
|
```
|
|
96
105
|
|
|
97
|
-
## Widget Features
|
|
106
|
+
## 🎨 Widget Features
|
|
98
107
|
|
|
99
108
|
### Pizza Map Widget
|
|
100
109
|
- **Interactive Mapbox map** with custom markers
|
|
@@ -117,7 +126,27 @@ typescript-pizzaz/
|
|
|
117
126
|
- **Related shops** recommendations
|
|
118
127
|
- **External link handling** via `useWidgetSDK()`
|
|
119
128
|
|
|
120
|
-
##
|
|
129
|
+
## 🔧 Commands
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Installation
|
|
133
|
+
npm install # Install all dependencies (root + widgets)
|
|
134
|
+
nitrostack install # Same as above
|
|
135
|
+
|
|
136
|
+
# Development
|
|
137
|
+
npm run dev # Start dev server with Studio
|
|
138
|
+
npm run build # Build TypeScript and widgets for production
|
|
139
|
+
npm start # Run production server
|
|
140
|
+
|
|
141
|
+
# Upgrade
|
|
142
|
+
npm run upgrade # Upgrade nitrostack to latest version
|
|
143
|
+
|
|
144
|
+
# Widget Management
|
|
145
|
+
npm run widget <command> # Run npm command in widgets directory
|
|
146
|
+
npm run widget add <pkg> # Add a widget dependency
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 🛠️ Customization
|
|
121
150
|
|
|
122
151
|
### Adding More Shops
|
|
123
152
|
|
|
@@ -160,28 +189,7 @@ style: isDark
|
|
|
160
189
|
|
|
161
190
|
Edit `src/modules/pizzaz/pizzaz.service.ts` to add more filter options.
|
|
162
191
|
|
|
163
|
-
##
|
|
164
|
-
|
|
165
|
-
### Build for Production
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
npm run build
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### Deploy to OpenAI ChatGPT
|
|
172
|
-
|
|
173
|
-
1. Build widgets:
|
|
174
|
-
```bash
|
|
175
|
-
cd src/widgets && npm run build
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
2. Widget HTML files will be in `src/widgets/out/`
|
|
179
|
-
|
|
180
|
-
3. Upload to your MCP server
|
|
181
|
-
|
|
182
|
-
4. **Zero code changes needed!** Widgets work identically in OpenAI ChatGPT.
|
|
183
|
-
|
|
184
|
-
## SDK Features Demonstrated
|
|
192
|
+
## 📚 SDK Features Demonstrated
|
|
185
193
|
|
|
186
194
|
### Theme Awareness
|
|
187
195
|
```typescript
|
|
@@ -218,11 +226,24 @@ const { openExternal } = useWidgetSDK();
|
|
|
218
226
|
openExternal('https://example.com');
|
|
219
227
|
```
|
|
220
228
|
|
|
221
|
-
##
|
|
229
|
+
## 🚀 Deployment
|
|
230
|
+
|
|
231
|
+
### Build for Production
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
npm run build
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Deploy Widgets
|
|
238
|
+
|
|
239
|
+
Widget HTML files will be generated in `src/widgets/out/` - these work identically in any MCP-compatible client including OpenAI ChatGPT.
|
|
240
|
+
|
|
241
|
+
## 📚 Next Steps
|
|
222
242
|
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
- [
|
|
243
|
+
- Try the **Starter Template** - Learn the basics
|
|
244
|
+
- Try the **Flight Booking Template** - API integration with Duffel
|
|
245
|
+
- Read the [NitroStack Documentation](https://nitrostack.ai/docs)
|
|
246
|
+
- Check out [Mapbox GL JS Documentation](https://docs.mapbox.com/mapbox-gl-js/)
|
|
226
247
|
|
|
227
248
|
## License
|
|
228
249
|
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "nitrostack-pizzaz",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "NitroStack Pizza Shop Finder - Interactive map widgets with Mapbox integration",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"postinstall": "nitrostack install --skip-widgets || true",
|
|
9
|
+
"dev": "nitrostack dev",
|
|
10
|
+
"build": "nitrostack build",
|
|
11
|
+
"start": "npm run build && nitrostack start",
|
|
12
|
+
"start:prod": "nitrostack start",
|
|
13
|
+
"upgrade": "nitrostack upgrade",
|
|
14
|
+
"widget": "npm --prefix src/widgets"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"nitrostack",
|
|
18
|
+
"mcp",
|
|
19
|
+
"pizza",
|
|
20
|
+
"map",
|
|
21
|
+
"widgets"
|
|
22
|
+
],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"nitrostack": "^1",
|
|
27
|
+
"zod": "^3.22.4",
|
|
28
|
+
"dotenv": "^16.3.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.3.3"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# NitroStack Starter Template
|
|
2
2
|
|
|
3
|
-
**The simple starter template** - Learn NitroStack
|
|
3
|
+
**The simple starter template** - Learn NitroStack fundamentals with a clean calculator example.
|
|
4
4
|
|
|
5
5
|
## 🎯 What's Inside
|
|
6
6
|
|
|
7
|
-
This template demonstrates core NitroStack
|
|
7
|
+
This template demonstrates core NitroStack features:
|
|
8
8
|
|
|
9
9
|
- **One Module** - Calculator module with all features
|
|
10
10
|
- **One Tool** - `calculate` - Perform arithmetic operations
|
|
@@ -29,14 +29,19 @@ npx nitrostack --version
|
|
|
29
29
|
### Setup Your Project
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
+
# Create a new project
|
|
32
33
|
nitrostack init my-calculator --template typescript-starter
|
|
33
34
|
cd my-calculator
|
|
35
|
+
|
|
36
|
+
# Install all dependencies (root + widgets)
|
|
37
|
+
npm install
|
|
38
|
+
# or
|
|
39
|
+
nitrostack install
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
That's it! The CLI automatically:
|
|
37
|
-
- ✅ Installs all dependencies
|
|
43
|
+
- ✅ Installs all root dependencies
|
|
38
44
|
- ✅ Installs widget dependencies
|
|
39
|
-
- ✅ Builds the widgets
|
|
40
45
|
- ✅ Sets up the project structure
|
|
41
46
|
|
|
42
47
|
### Run the Project
|
|
@@ -46,11 +51,11 @@ npm run dev
|
|
|
46
51
|
```
|
|
47
52
|
|
|
48
53
|
This starts:
|
|
49
|
-
- **MCP Server** (dual transport: STDIO + HTTP
|
|
54
|
+
- **MCP Server** (dual transport: STDIO + HTTP) - Hot reloads on code changes
|
|
50
55
|
- **Studio** on http://localhost:3000 - Visual testing environment
|
|
51
56
|
- **Widget Dev Server** on http://localhost:3001 - Hot module replacement
|
|
52
57
|
|
|
53
|
-
> 💡 **Dual Transport**: Your server exposes tools via both STDIO (for direct connections) and HTTP (for remote access
|
|
58
|
+
> 💡 **Dual Transport**: Your server exposes tools via both STDIO (for direct connections) and HTTP (for remote access). Switch between transports in Studio → Settings.
|
|
54
59
|
|
|
55
60
|
The `nitrostack dev` command handles everything automatically:
|
|
56
61
|
- ✅ Auto-detects widget directory
|
|
@@ -153,18 +158,23 @@ This template is perfect for learning:
|
|
|
153
158
|
## 🔧 Commands
|
|
154
159
|
|
|
155
160
|
```bash
|
|
161
|
+
# Installation
|
|
162
|
+
npm install # Install all dependencies (root + widgets)
|
|
163
|
+
nitrostack install # Same as above
|
|
164
|
+
|
|
156
165
|
# Development
|
|
157
|
-
npm run dev # Start dev server with Studio
|
|
166
|
+
npm run dev # Start dev server with Studio
|
|
158
167
|
npm run build # Build TypeScript and widgets for production
|
|
159
168
|
npm start # Run production server
|
|
160
169
|
|
|
170
|
+
# Upgrade
|
|
171
|
+
npm run upgrade # Upgrade nitrostack to latest version
|
|
172
|
+
|
|
161
173
|
# Widget Management
|
|
162
174
|
npm run widget <command> # Run npm command in widgets directory
|
|
163
175
|
npm run widget add <pkg> # Add a widget dependency (e.g., @mui/material)
|
|
164
176
|
```
|
|
165
177
|
|
|
166
|
-
**Note:** The NitroStack CLI automatically handles building, installing dependencies, and hot reload. You don't need separate commands for widgets anymore!
|
|
167
|
-
|
|
168
178
|
## 📝 Example Interactions
|
|
169
179
|
|
|
170
180
|
### Basic Calculation
|
|
@@ -284,10 +294,9 @@ nitrostack generate module converter
|
|
|
284
294
|
|
|
285
295
|
Once you understand this template:
|
|
286
296
|
|
|
287
|
-
1. Try the
|
|
288
|
-
2.
|
|
289
|
-
3. Read [
|
|
290
|
-
4. Read [Widgets Guide](/sdk/typescript/ui/widgets) - Build better UIs
|
|
297
|
+
1. Try the **Pizza Shop Template** - Interactive maps and widgets
|
|
298
|
+
2. Try the **Flight Booking Template** - API integration with Duffel
|
|
299
|
+
3. Read the [NitroStack Documentation](https://nitrostack.ai/docs)
|
|
291
300
|
|
|
292
301
|
## 💡 Tips
|
|
293
302
|
|
|
@@ -311,4 +320,3 @@ Use this as a starting point for:
|
|
|
311
320
|
**Happy Learning! 📖**
|
|
312
321
|
|
|
313
322
|
Start simple, learn the patterns, then build something amazing!
|
|
314
|
-
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "nitrostack-starter",
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"description": "NitroStack starter template - Learn MCP server basics with a simple calculator example",
|
|
6
7
|
"scripts": {
|
|
8
|
+
"postinstall": "nitrostack install --skip-widgets || true",
|
|
7
9
|
"dev": "nitrostack dev",
|
|
8
10
|
"build": "nitrostack build",
|
|
9
11
|
"start": "npm run build && nitrostack start",
|
|
10
12
|
"start:prod": "nitrostack start",
|
|
13
|
+
"upgrade": "nitrostack upgrade",
|
|
11
14
|
"widget": "npm --prefix src/widgets"
|
|
12
15
|
},
|
|
13
16
|
"dependencies": {
|