nitrostack 1.0.74 → 1.0.76
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__/pkce.test.js +53 -4
- package/dist/auth/__tests__/pkce.test.js.map +1 -1
- package/dist/auth/__tests__/simple-jwt.test.js +153 -2
- package/dist/auth/__tests__/simple-jwt.test.js.map +1 -1
- 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.map +1 -1
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -1
- 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__/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/pipes/__tests__/pipes.test.js +113 -1
- package/dist/core/pipes/__tests__/pipes.test.js.map +1 -1
- 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/lib/llm-service.ts +77 -10
- package/templates/typescript-oauth/OAUTH_SETUP.md +592 -0
- package/templates/typescript-oauth/README.md +184 -235
- package/templates/typescript-oauth/package.json +4 -3
- package/templates/typescript-pizzaz/README.md +76 -57
- package/templates/typescript-pizzaz/package.json +31 -30
- package/templates/typescript-starter/README.md +20 -14
- package/templates/typescript-starter/package.json +3 -1
- package/templates/typescript-starter/package-lock.json +0 -4112
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
# NitroStack
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
1
|
+
# ✈️ NitroStack Flight Booking
|
|
2
|
+
|
|
3
|
+
A production-ready NitroStack template showcasing real-time flight search and booking with **Duffel API** integration. Search flights, view details, select seats, and book - all through beautiful interactive widgets.
|
|
4
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
### 🔌 **Duffel API Integration**
|
|
8
|
+
- Real-time flight search across 300+ airlines
|
|
9
|
+
- Live pricing and availability
|
|
10
|
+
- Seat selection with cabin maps
|
|
11
|
+
- Booking and order management
|
|
12
|
+
|
|
13
|
+
### 🎨 **Interactive Widgets**
|
|
14
|
+
- **Airport Search** - Autocomplete airport selection
|
|
15
|
+
- **Flight Search Results** - Compare flights with prices
|
|
16
|
+
- **Flight Details** - Comprehensive flight information
|
|
17
|
+
- **Seat Selection** - Visual cabin map with seat picker
|
|
18
|
+
- **Order Summary** - Complete booking overview
|
|
19
|
+
- **Payment Confirmation** - Secure payment flow
|
|
20
|
+
|
|
21
|
+
### 🛠️ **MCP Tools**
|
|
22
|
+
- `search_airports` - Find airports by name/code
|
|
23
|
+
- `search_flights` - Search available flights
|
|
24
|
+
- `show_flight_details` - Detailed flight information
|
|
25
|
+
- `select_seats` - Interactive seat selection
|
|
26
|
+
- `create_booking` - Book flights
|
|
27
|
+
- `get_order` - Retrieve booking details
|
|
16
28
|
|
|
17
29
|
## 🚀 Quick Start
|
|
18
30
|
|
|
@@ -26,289 +38,226 @@ npm install -g nitrostack
|
|
|
26
38
|
npx nitrostack --version
|
|
27
39
|
```
|
|
28
40
|
|
|
29
|
-
###
|
|
41
|
+
### 1. Create Your Project
|
|
30
42
|
|
|
31
43
|
```bash
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
# Create a new project
|
|
45
|
+
nitrostack init my-flight-app --template typescript-oauth
|
|
46
|
+
cd my-flight-app
|
|
35
47
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- ✅ Builds the widgets
|
|
40
|
-
- ✅ Sets up the project structure
|
|
48
|
+
# Install all dependencies (root + widgets)
|
|
49
|
+
nitrostack install
|
|
50
|
+
```
|
|
41
51
|
|
|
42
|
-
###
|
|
52
|
+
### 2. Get Your Duffel API Key (Free)
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
npm run dev
|
|
46
|
-
```
|
|
54
|
+
[Duffel](https://duffel.com/) provides a free API for flight search and booking:
|
|
47
55
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
1. **Sign up** at [duffel.com](https://duffel.com/) (click "Start now" - it's free!)
|
|
57
|
+
2. Create a free account (no credit card required)
|
|
58
|
+
3. Go to your **Dashboard** → **Developers** → **Access tokens**
|
|
59
|
+
4. Click **"Create token"** to generate your API key
|
|
60
|
+
5. Copy the token (starts with `duffel_test_` for sandbox)
|
|
52
61
|
|
|
53
|
-
> 💡 **
|
|
62
|
+
> 💡 **Tip**: The test mode (`duffel_test_*` tokens) gives you access to realistic mock data for development. Production tokens (`duffel_live_*`) connect to real airlines.
|
|
54
63
|
|
|
55
|
-
|
|
56
|
-
- ✅ Auto-detects widget directory
|
|
57
|
-
- ✅ Installs dependencies (if needed)
|
|
58
|
-
- ✅ Builds widgets (on first run)
|
|
59
|
-
- ✅ Starts all services concurrently
|
|
60
|
-
- ✅ Hot reload for TypeScript and widgets
|
|
64
|
+
### 3. Configure Environment
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
Copy the example environment file and add your Duffel API key:
|
|
63
67
|
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
├── modules/
|
|
67
|
-
│ └── calculator/
|
|
68
|
-
│ ├── calculator.module.ts # @Module definition
|
|
69
|
-
│ ├── calculator.tools.ts # @Tool with examples
|
|
70
|
-
│ ├── calculator.resources.ts # @Resource
|
|
71
|
-
│ └── calculator.prompts.ts # @Prompt
|
|
72
|
-
├── widgets/ # Next.js UI widgets
|
|
73
|
-
│ └── app/
|
|
74
|
-
│ ├── calculator-result/ # Tool result widget
|
|
75
|
-
│ └── calculator-operations/ # Resource widget
|
|
76
|
-
├── app.module.ts # Root @McpApp module
|
|
77
|
-
└── index.ts # Application bootstrap
|
|
68
|
+
```bash
|
|
69
|
+
cp .env.example .env
|
|
78
70
|
```
|
|
79
71
|
|
|
80
|
-
|
|
72
|
+
Edit `.env` and update:
|
|
81
73
|
|
|
82
|
-
|
|
74
|
+
```env
|
|
75
|
+
# Duffel API Configuration
|
|
76
|
+
DUFFEL_API_KEY=duffel_test_your_api_key_here
|
|
77
|
+
```
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
### 4. Run Development Server
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- **Status**: `up`, `degraded`, or `down`
|
|
81
|
+
```bash
|
|
82
|
+
npm run dev
|
|
83
|
+
```
|
|
90
84
|
|
|
91
|
-
|
|
85
|
+
This starts:
|
|
86
|
+
- **MCP Server** - Hot reloads on code changes
|
|
87
|
+
- **Studio** on http://localhost:3000 - Visual testing environment
|
|
88
|
+
- **Widget Dev Server** on http://localhost:3001 - Hot module replacement
|
|
92
89
|
|
|
93
|
-
###
|
|
90
|
+
### 5. Test in Studio
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
Try these prompts in Studio chat:
|
|
93
|
+
- "Search flights from London to New York for next week"
|
|
94
|
+
- "Show me flight details"
|
|
95
|
+
- "I want to select seats"
|
|
96
|
+
- "Show me flights from JFK to LAX"
|
|
96
97
|
|
|
97
|
-
|
|
98
|
-
@Tool({
|
|
99
|
-
name: 'calculate',
|
|
100
|
-
description: 'Perform basic arithmetic calculations',
|
|
101
|
-
inputSchema: z.object({
|
|
102
|
-
operation: z.enum(['add', 'subtract', 'multiply', 'divide']),
|
|
103
|
-
a: z.number(),
|
|
104
|
-
b: z.number()
|
|
105
|
-
}),
|
|
106
|
-
examples: {
|
|
107
|
-
request: { operation: 'add', a: 5, b: 3 },
|
|
108
|
-
response: { result: 8, expression: '5 + 3 = 8' }
|
|
109
|
-
}
|
|
110
|
-
})
|
|
111
|
-
```
|
|
98
|
+
## 📁 Project Structure
|
|
112
99
|
|
|
113
|
-
**Usage:**
|
|
114
100
|
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
101
|
+
typescript-oauth/
|
|
102
|
+
├── src/
|
|
103
|
+
│ ├── index.ts # Main server entry
|
|
104
|
+
│ ├── app.module.ts # App module
|
|
105
|
+
│ ├── services/
|
|
106
|
+
│ │ └── duffel.service.ts # Duffel API client
|
|
107
|
+
│ └── modules/
|
|
108
|
+
│ └── flights/
|
|
109
|
+
│ ├── flights.module.ts # Module definition
|
|
110
|
+
│ ├── flights.tools.ts # Search & display tools
|
|
111
|
+
│ ├── flights.prompts.ts # AI prompts
|
|
112
|
+
│ ├── flights.resources.ts # Static resources
|
|
113
|
+
│ └── booking.tools.ts # Booking tools
|
|
114
|
+
│ └── widgets/
|
|
115
|
+
│ ├── app/
|
|
116
|
+
│ │ ├── airport-search/ # Airport autocomplete
|
|
117
|
+
│ │ ├── flight-search-results/ # Results list
|
|
118
|
+
│ │ ├── flight-details/ # Flight info
|
|
119
|
+
│ │ ├── seat-selection/ # Seat picker
|
|
120
|
+
│ │ ├── order-summary/ # Booking summary
|
|
121
|
+
│ │ └── payment-confirmation/ # Payment widget
|
|
122
|
+
├── .env.example # Environment template
|
|
123
|
+
├── OAUTH_SETUP.md # OAuth configuration guide
|
|
124
|
+
├── package.json
|
|
125
|
+
└── README.md
|
|
118
126
|
```
|
|
119
127
|
|
|
120
|
-
### Resource: `calculator://operations`
|
|
121
|
-
|
|
122
|
-
Lists all available operations with examples.
|
|
123
|
-
|
|
124
|
-
### Prompt: `calculator_help`
|
|
125
|
-
|
|
126
|
-
Get help on how to use the calculator.
|
|
127
|
-
|
|
128
|
-
## 🎨 Widgets
|
|
129
|
-
|
|
130
|
-
### Calculator Result Widget
|
|
131
|
-
- Gradient background
|
|
132
|
-
- Operation icon
|
|
133
|
-
- Breakdown of numbers
|
|
134
|
-
- Beautiful animations
|
|
135
|
-
|
|
136
|
-
### Calculator Operations Widget
|
|
137
|
-
- Grid of all operations
|
|
138
|
-
- Color-coded by type
|
|
139
|
-
- Examples for each operation
|
|
140
|
-
|
|
141
|
-
## 💡 Learning Path
|
|
142
|
-
|
|
143
|
-
This template is perfect for learning:
|
|
144
|
-
|
|
145
|
-
1. **Module Organization** - How to structure a feature module
|
|
146
|
-
2. **Tools** - How to create a tool with `@Tool` decorator
|
|
147
|
-
3. **Resources** - How to expose data with `@Resource`
|
|
148
|
-
4. **Prompts** - How to create conversation templates
|
|
149
|
-
5. **Widgets** - How to build UI components
|
|
150
|
-
6. **Examples** - How to include request/response examples
|
|
151
|
-
7. **Validation** - How to use Zod schemas
|
|
152
|
-
|
|
153
128
|
## 🔧 Commands
|
|
154
129
|
|
|
155
130
|
```bash
|
|
131
|
+
# Installation
|
|
132
|
+
npm install # Install all dependencies (root + widgets)
|
|
133
|
+
nitrostack install # Same as above
|
|
134
|
+
|
|
156
135
|
# Development
|
|
157
|
-
npm run dev # Start dev server with Studio
|
|
136
|
+
npm run dev # Start dev server with Studio
|
|
158
137
|
npm run build # Build TypeScript and widgets for production
|
|
159
138
|
npm start # Run production server
|
|
160
139
|
|
|
140
|
+
# Upgrade
|
|
141
|
+
npm run upgrade # Upgrade nitrostack to latest version
|
|
142
|
+
|
|
161
143
|
# Widget Management
|
|
162
144
|
npm run widget <command> # Run npm command in widgets directory
|
|
163
|
-
npm run widget add <pkg> # Add a widget dependency
|
|
145
|
+
npm run widget add <pkg> # Add a widget dependency
|
|
164
146
|
```
|
|
165
147
|
|
|
166
|
-
|
|
148
|
+
## 🔐 OAuth Setup (Optional)
|
|
167
149
|
|
|
168
|
-
|
|
150
|
+
This template includes OAuth 2.1 authentication support. If you want to protect your MCP server with authentication:
|
|
169
151
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
AI: Calls calculate(operation="multiply", a=12, b=8)
|
|
174
|
-
Result: Widget showing "12 × 8 = 96"
|
|
175
|
-
```
|
|
152
|
+
1. Read the detailed guide: **[OAUTH_SETUP.md](./OAUTH_SETUP.md)**
|
|
153
|
+
2. Configure Auth0 (or your OAuth provider)
|
|
154
|
+
3. Update your `.env` with OAuth credentials
|
|
176
155
|
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
User: "How do I use the calculator?"
|
|
180
|
-
AI: Uses calculator_help prompt
|
|
181
|
-
Result: Complete usage instructions
|
|
182
|
-
```
|
|
156
|
+
> **Note**: OAuth is optional for local development. The template works without it using Duffel's test API.
|
|
183
157
|
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
User: "What operations are available?"
|
|
187
|
-
AI: Fetches calculator://operations resource
|
|
188
|
-
Result: Widget showing all 4 operations with examples
|
|
189
|
-
```
|
|
158
|
+
## 📊 Duffel API Features
|
|
190
159
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
### 1. Tool Definition
|
|
194
|
-
|
|
195
|
-
```typescript
|
|
196
|
-
@Tool({
|
|
197
|
-
name: 'calculate',
|
|
198
|
-
description: 'Perform basic arithmetic calculations',
|
|
199
|
-
inputSchema: z.object({...}),
|
|
200
|
-
examples: {...}
|
|
201
|
-
})
|
|
202
|
-
@Widget('calculator-result') // Link UI widget
|
|
203
|
-
async calculate(input: any, ctx: ExecutionContext) {
|
|
204
|
-
// Your logic here
|
|
205
|
-
return { result, expression };
|
|
206
|
-
}
|
|
207
|
-
```
|
|
160
|
+
### Test Mode vs Live Mode
|
|
208
161
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
### 2. Resource Definition
|
|
217
|
-
|
|
218
|
-
```typescript
|
|
219
|
-
@Resource({
|
|
220
|
-
uri: 'calculator://operations',
|
|
221
|
-
name: 'Calculator Operations',
|
|
222
|
-
mimeType: 'application/json',
|
|
223
|
-
examples: {...}
|
|
224
|
-
})
|
|
225
|
-
@Widget('calculator-operations')
|
|
226
|
-
async getOperations(uri: string, ctx: ExecutionContext) {
|
|
227
|
-
return { contents: [{...}] };
|
|
228
|
-
}
|
|
229
|
-
```
|
|
162
|
+
| Feature | Test Mode (`duffel_test_*`) | Live Mode (`duffel_live_*`) |
|
|
163
|
+
|---------|----------------------------|----------------------------|
|
|
164
|
+
| API Access | ✅ Full access | ✅ Full access |
|
|
165
|
+
| Pricing | Mock data | Real prices |
|
|
166
|
+
| Bookings | Simulated | Real bookings |
|
|
167
|
+
| Credit Card | Not charged | Charged |
|
|
168
|
+
| Rate Limits | Generous | Production limits |
|
|
230
169
|
|
|
231
|
-
###
|
|
170
|
+
### Supported Airlines
|
|
232
171
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
})
|
|
238
|
-
async getHelp(args: any, ctx: ExecutionContext) {
|
|
239
|
-
return { messages: [...] };
|
|
240
|
-
}
|
|
241
|
-
```
|
|
172
|
+
Duffel provides access to 300+ airlines including:
|
|
173
|
+
- Major carriers (British Airways, Lufthansa, Emirates, etc.)
|
|
174
|
+
- Low-cost carriers (Ryanair, EasyJet, Spirit, etc.)
|
|
175
|
+
- Regional airlines
|
|
242
176
|
|
|
243
|
-
###
|
|
177
|
+
### API Capabilities
|
|
244
178
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
export class CalculatorModule {}
|
|
251
|
-
```
|
|
179
|
+
- **Search**: Real-time availability and pricing
|
|
180
|
+
- **Ancillaries**: Seats, bags, meals
|
|
181
|
+
- **Booking**: Create and manage orders
|
|
182
|
+
- **Changes**: Modify existing bookings
|
|
183
|
+
- **Cancellations**: Cancel and refund
|
|
252
184
|
|
|
253
|
-
|
|
185
|
+
## 🎨 Widget Features
|
|
254
186
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
@Module({
|
|
260
|
-
imports: [ConfigModule.forRoot(), CalculatorModule]
|
|
261
|
-
})
|
|
262
|
-
export class AppModule {}
|
|
263
|
-
```
|
|
187
|
+
### Airport Search Widget
|
|
188
|
+
- Autocomplete with IATA codes
|
|
189
|
+
- City and airport name search
|
|
190
|
+
- Recent searches
|
|
264
191
|
|
|
265
|
-
|
|
192
|
+
### Flight Search Results Widget
|
|
193
|
+
- Compare multiple flights
|
|
194
|
+
- Filter by stops, price, time
|
|
195
|
+
- Sort options
|
|
196
|
+
- Airline logos
|
|
266
197
|
|
|
267
|
-
###
|
|
198
|
+
### Flight Details Widget
|
|
199
|
+
- Complete itinerary
|
|
200
|
+
- Fare breakdown
|
|
201
|
+
- Baggage allowance
|
|
202
|
+
- Flight duration and stops
|
|
268
203
|
|
|
269
|
-
|
|
204
|
+
### Seat Selection Widget
|
|
205
|
+
- Visual cabin map
|
|
206
|
+
- Seat categories (standard, extra legroom, etc.)
|
|
207
|
+
- Price per seat
|
|
208
|
+
- Real-time availability
|
|
270
209
|
|
|
271
|
-
|
|
210
|
+
## 🛠️ Customization
|
|
272
211
|
|
|
273
|
-
|
|
274
|
-
2. Add a `get_history` tool
|
|
275
|
-
3. Create a history widget
|
|
212
|
+
### Adding New Airlines
|
|
276
213
|
|
|
277
|
-
|
|
214
|
+
Duffel handles airline integrations automatically. You don't need to configure individual airlines.
|
|
278
215
|
|
|
279
|
-
|
|
280
|
-
nitrostack generate module converter
|
|
281
|
-
```
|
|
216
|
+
### Modifying Search Parameters
|
|
282
217
|
|
|
283
|
-
|
|
218
|
+
Edit `src/modules/flights/flights.tools.ts` to customize:
|
|
219
|
+
- Default passenger counts
|
|
220
|
+
- Cabin class options
|
|
221
|
+
- Date ranges
|
|
222
|
+
- Result limits
|
|
284
223
|
|
|
285
|
-
|
|
224
|
+
### Styling Widgets
|
|
286
225
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
226
|
+
Each widget in `src/widgets/app/` can be customized:
|
|
227
|
+
- Edit page.tsx for layout
|
|
228
|
+
- Add custom CSS
|
|
229
|
+
- Modify component styles
|
|
230
|
+
|
|
231
|
+
## 📚 Resources
|
|
232
|
+
|
|
233
|
+
### Duffel Documentation
|
|
234
|
+
- [Duffel API Docs](https://duffel.com/docs/api)
|
|
235
|
+
- [Duffel SDK (Node.js)](https://github.com/duffel/duffel-api-javascript)
|
|
236
|
+
- [Duffel Postman Collection](https://duffel.com/docs/postman)
|
|
237
|
+
|
|
238
|
+
### NitroStack Documentation
|
|
239
|
+
- [NitroStack Docs](https://nitrostack.ai/docs)
|
|
240
|
+
- [Widget Development Guide](https://nitrostack.ai/docs/widgets)
|
|
291
241
|
|
|
292
242
|
## 💡 Tips
|
|
293
243
|
|
|
294
|
-
- **
|
|
295
|
-
- **
|
|
296
|
-
- **
|
|
297
|
-
- **
|
|
244
|
+
- **Use Test Mode**: Start with `duffel_test_*` tokens for development
|
|
245
|
+
- **Check Rate Limits**: Duffel has rate limits - cache searches when possible
|
|
246
|
+
- **Error Handling**: The template includes comprehensive error handling
|
|
247
|
+
- **Responsive Design**: Widgets are mobile-friendly out of the box
|
|
298
248
|
|
|
299
|
-
##
|
|
249
|
+
## 📚 Next Steps
|
|
300
250
|
|
|
301
|
-
|
|
251
|
+
- Try the **Starter Template** - Learn NitroStack basics
|
|
252
|
+
- Try the **Pizza Shop Template** - Interactive maps with Mapbox
|
|
253
|
+
- Read the [Duffel Getting Started Guide](https://duffel.com/docs/guides/getting-started)
|
|
302
254
|
|
|
303
|
-
|
|
304
|
-
- **Text Tools** - String manipulation, formatting
|
|
305
|
-
- **Data Processors** - JSON, CSV, XML parsing
|
|
306
|
-
- **Simple APIs** - Weather, jokes, facts
|
|
307
|
-
- **Utilities** - Date/time, UUID generation
|
|
255
|
+
## License
|
|
308
256
|
|
|
309
|
-
|
|
257
|
+
MIT
|
|
310
258
|
|
|
311
|
-
|
|
259
|
+
---
|
|
312
260
|
|
|
313
|
-
|
|
261
|
+
**Built with ❤️ using NitroStack + Duffel API**
|
|
314
262
|
|
|
263
|
+
Need help? Check [Duffel Support](https://duffel.com/docs) or [NitroStack Docs](https://nitrostack.ai/docs)
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "nitrostack-
|
|
2
|
+
"name": "nitrostack-flight-booking",
|
|
3
3
|
"version": "1.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"description": "NitroStack Flight Booking - Real-time flight search and booking with Duffel API integration",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"dev": "nitrostack dev",
|
|
8
9
|
"build": "nitrostack build",
|
|
9
10
|
"start": "npm run build && nitrostack start",
|
|
10
11
|
"start:prod": "nitrostack start",
|
|
12
|
+
"upgrade": "nitrostack upgrade",
|
|
11
13
|
"widget": "npm --prefix src/widgets"
|
|
12
14
|
},
|
|
13
15
|
"dependencies": {
|
|
@@ -21,6 +23,5 @@
|
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"typescript": "^5.3.3"
|
|
23
25
|
},
|
|
24
|
-
"description": "NitroStack OAuth 2.1 template with flight booking - demonstrates authentication, API integration, and modern widget development",
|
|
25
26
|
"author": ""
|
|
26
|
-
}
|
|
27
|
+
}
|