-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspecification.json
More file actions
329 lines (318 loc) · 9.11 KB
/
specification.json
File metadata and controls
329 lines (318 loc) · 9.11 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
{
"projectName": "TrailOpt - Intelligent Trip Planning & Optimization",
"description": "A full-stack hiking trip optimizer that computes calorie expenditure, evaluates weather risk, generates packing lists, and performs gear weight minimization via DP. Built with Next.js, React, TypeScript, Tailwind, and MongoDB/PostgreSQL. Includes Google Login via NextAuth.",
"auth": {
"provider": "NextAuth (Auth.js)",
"providers": [
{
"name": "Google",
"type": "oauth",
"envVarsRequired": [
"GOOGLE_CLIENT_ID",
"GOOGLE_CLIENT_SECRET",
"NEXTAUTH_SECRET",
"NEXTAUTH_URL"
]
}
],
"sessionStrategy": "jwt",
"callbacks": {
"jwt": "Attach user.id, email, name, and image",
"session": "Expose user.id, email, name, and image to client"
},
"pages": {
"signIn": "/auth/signin"
},
"protectedRoutes": [
"/dashboard",
"/trips/*",
"/gear/*",
"/optimize/*"
],
"sessionProtectionBehavior": "Redirect unauthenticated users to /auth/signin"
},
"staticTrails": [
{
"name": "Yosemite Valley Loop",
"location": "California, USA",
"distanceKm": 18,
"elevationGainM": 150,
"typicalTemperatureRange": "5°C to 25°C",
"difficulty": "Moderate",
"recommendedTripLengthDays": 1,
"notes": "Scenic valley loop with waterfalls and granite cliffs."
},
{
"name": "Inca Trail",
"location": "Peru",
"distanceKm": 42,
"elevationGainM": 1350,
"typicalTemperatureRange": "2°C to 20°C",
"difficulty": "Hard",
"recommendedTripLengthDays": 4,
"notes": "High-altitude trekking finishing at Machu Picchu."
},
{
"name": "Appalachian Trail (Smokies Section)",
"location": "Tennessee/North Carolina, USA",
"distanceKm": 114,
"elevationGainM": 4300,
"typicalTemperatureRange": "-5°C to 20°C",
"difficulty": "Hard",
"recommendedTripLengthDays": 7,
"notes": "Forest ridges with reliable shelters."
},
{
"name": "Pacific Crest Trail (Section J)",
"location": "Washington, USA",
"distanceKm": 113,
"elevationGainM": 3800,
"typicalTemperatureRange": "0°C to 22°C",
"difficulty": "Hard",
"recommendedTripLengthDays": 6,
"notes": "Alpine terrain with glacier views."
},
{
"name": "John Muir Trail",
"location": "California, USA",
"distanceKm": 340,
"elevationGainM": 15000,
"typicalTemperatureRange": "-3°C to 23°C",
"difficulty": "Very Hard",
"recommendedTripLengthDays": 20,
"notes": "Iconic Sierra Nevada thru-hike."
},
{
"name": "Banff Skyline Trail",
"location": "Alberta, Canada",
"distanceKm": 44,
"elevationGainM": 1520,
"typicalTemperatureRange": "0°C to 18°C",
"difficulty": "Moderate-Hard",
"recommendedTripLengthDays": 3,
"notes": "High-alpine ridge walking with 360° views."
},
{
"name": "Tour du Mont Blanc",
"location": "France/Italy/Switzerland",
"distanceKm": 170,
"elevationGainM": 10000,
"typicalTemperatureRange": "4°C to 20°C",
"difficulty": "Hard",
"recommendedTripLengthDays": 10,
"notes": "Famous Europe long-distance loop."
},
{
"name": "Everest Base Camp Trek",
"location": "Nepal",
"distanceKm": 130,
"elevationGainM": 3000,
"typicalTemperatureRange": "-15°C to 12°C",
"difficulty": "Very Hard",
"recommendedTripLengthDays": 12,
"notes": "Extreme elevation trek in Himalayas."
},
{
"name": "Milford Track",
"location": "New Zealand",
"distanceKm": 53,
"elevationGainM": 1500,
"typicalTemperatureRange": "5°C to 18°C",
"difficulty": "Moderate",
"recommendedTripLengthDays": 4,
"notes": "Lush forest and waterfalls."
},
{
"name": "Kilimanjaro (Machame Route)",
"location": "Tanzania",
"distanceKm": 62,
"elevationGainM": 4100,
"typicalTemperatureRange": "-10°C to 20°C",
"difficulty": "Very Hard",
"recommendedTripLengthDays": 7,
"notes": "Extreme elevation gain across multiple climate zones."
}
],
"techStack": {
"frontend": ["Next.js", "React", "TypeScript", "Tailwind CSS", "Recharts or Chart.js"],
"backend": ["Next.js API Routes", "Node.js", "TypeScript"],
"database": ["MongoDB or PostgreSQL"],
"optional": {
"orm": "Prisma (if PostgreSQL)",
"auth": "NextAuth Google OAuth"
}
},
"systemArchitecture": {
"frontend": [
"Trip creation wizard",
"Gear inventory manager",
"Optimization dashboard",
"Charts and visualizations",
"Auth-protected dashboard",
"Google sign-in UI"
],
"backend": [
"Trip analytics engine",
"Weather risk engine",
"Dynamic packing list generator",
"Knapsack-based optimizer",
"Database CRUD",
"Auth session callbacks"
],
"databaseModels": {
"User": {
"fields": [
"id", "name", "email", "image", "createdAt"
]
},
"GearItem": {
"fields": [
"id", "userId", "name", "category", "baseWeight",
"warmthRating", "priority", "isEssential", "createdAt"
]
},
"Trip": {
"fields": [
"id", "userId", "trailName", "distanceKm", "elevationGainM",
"startDate", "location", "desiredPackWeightLimit",
"temperatureRange", "weatherRiskScore", "optimizedGearListId",
"createdAt"
]
},
"GearList": {
"fields": [
"id", "tripId", "items[]", "totalWeight", "generatedBy", "createdAt"
]
}
}
},
"coreFeatures": {
"tripAnalytics": {
"inputs": [
"distanceKm", "elevationGainM", "expectedHours",
"temperatureRange", "trailDifficulty"
],
"logic": {
"calorieEstimation": "Modified Naismith + MET-based adjustments",
"fatigueScore": "Weighted combination of elevation, distance, temp"
},
"outputs": [
"calorieEstimate",
"fatigueScore",
"charts"
]
},
"weatherRiskEngine": {
"dataSourceOptions": ["Mock data", "OpenWeather API"],
"riskModel": {
"coldExposure": "Temperature thresholds",
"heatExposure": "High temp penalty",
"stormProbability": "Precipitation-based",
"windRisk": "Wind speed scoring"
},
"finalRiskScore": "Low / Medium / High"
},
"autoGeneratedPackingList": {
"inputs": [
"distance", "elevation", "temperature",
"tripLength", "weatherRiskScore"
],
"rules": [
"Essentials always included",
"Add insulation if cold",
"Add water/food based on distance",
"Add shelter for multi-day trips"
],
"output": "Gear items[] with computed weights"
},
"weightOptimizationDP": {
"approach": "0/1 Knapsack DP",
"inputs": ["gearItems", "weightLimit"],
"constraints": [
"Essentials must be included",
"Stay within weight limit"
],
"goal": "Max usefulness while minimizing weight",
"dpState": "dp[i][w] = best usefulness",
"output": [
"optimizedGearList",
"optimizedWeight",
"itemsChosen[]"
]
},
"visualizations": {
"charts": [
"Weight breakdown",
"Calorie burn curve",
"Weather timeline",
"Before/After optimization comparison"
]
}
},
"uiPages": {
"auth": [
"/auth/signin (Google login button)"
],
"home": [
"Marketing hero",
"Start a Trip button",
"Sign in with Google"
],
"dashboard": [
"Requires login",
"Recent trips grid",
"Gear inventory summary"
],
"tripBuilderWizard": [
"Step 1: Trail Select",
"Step 2: Trail Stats Auto-Fill",
"Step 3: Weather Info",
"Step 4: Gear Preferences"
],
"gearInventoryManager": [
"CRUD",
"Category filters",
"Weight auto-sum",
"Image upload"
],
"optimizationDashboard": [
"Calorie Estimate",
"Weather Risk Score",
"Suggested Gear",
"Run Optimization button",
"Weight comparison charts"
],
"tripDetailPage": [
"Timeline",
"Charts",
"Optimized Gear List",
"Export"
]
},
"backendAPIs": {
"authRoutes": {
"nextAuth": "/api/auth/[...nextauth]",
"session": "Built-in via next-auth/react"
},
"tripAnalyticsAPI": {
"route": "/api/analytics",
"method": "POST",
"requestBody": [
"distanceKm", "elevationGainM", "packWeight", "tempRange"
],
"response": ["calorieEstimate", "fatigueScore"]
},
"weatherRiskAPI": {
"route": "/api/weather-risk",
"method": "GET",
"queryParams": ["lat", "lon"],
"response": ["riskScore", "recommendations"]
},
"gearOptimizationAPI": {
"route": "/api/optimize-gear",
"method": "POST",
"requestBody": ["gearItems[]", "weightLimit"],
"response": ["optimizedGearList", "totalWeight"]
}
}
}