@odvi/create-dtt-framework 0.1.3 → 0.1.6

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.
Files changed (111) hide show
  1. package/dist/commands/create.d.ts.map +1 -1
  2. package/dist/commands/create.js +16 -13
  3. package/dist/commands/create.js.map +1 -1
  4. package/package.json +3 -2
  5. package/template/.env.example +106 -0
  6. package/template/components.json +22 -0
  7. package/template/docs/framework/01-overview.md +289 -0
  8. package/template/docs/framework/02-techstack.md +503 -0
  9. package/template/docs/framework/api-layer.md +681 -0
  10. package/template/docs/framework/clerk-authentication.md +649 -0
  11. package/template/docs/framework/cli-installation.md +564 -0
  12. package/template/docs/framework/deployment/ci-cd.md +907 -0
  13. package/template/docs/framework/deployment/digitalocean.md +991 -0
  14. package/template/docs/framework/deployment/domain-setup.md +972 -0
  15. package/template/docs/framework/deployment/environment-variables.md +862 -0
  16. package/template/docs/framework/deployment/monitoring.md +927 -0
  17. package/template/docs/framework/deployment/production-checklist.md +649 -0
  18. package/template/docs/framework/deployment/vercel.md +791 -0
  19. package/template/docs/framework/environment-variables.md +646 -0
  20. package/template/docs/framework/health-check-system.md +583 -0
  21. package/template/docs/framework/implementation.md +559 -0
  22. package/template/docs/framework/snowflake-integration.md +594 -0
  23. package/template/docs/framework/state-management.md +615 -0
  24. package/template/docs/framework/supabase-integration.md +582 -0
  25. package/template/docs/framework/testing-guide.md +544 -0
  26. package/template/docs/framework/what-did-i-miss.md +526 -0
  27. package/template/drizzle.config.ts +11 -0
  28. package/template/next.config.js +21 -0
  29. package/template/postcss.config.js +5 -0
  30. package/template/prettier.config.js +4 -0
  31. package/template/public/favicon.ico +0 -0
  32. package/template/src/app/(auth)/layout.tsx +4 -0
  33. package/template/src/app/(auth)/sign-in/[[...sign-in]]/page.tsx +10 -0
  34. package/template/src/app/(auth)/sign-up/[[...sign-up]]/page.tsx +10 -0
  35. package/template/src/app/(dashboard)/dashboard/page.tsx +8 -0
  36. package/template/src/app/(dashboard)/health/page.tsx +16 -0
  37. package/template/src/app/(dashboard)/layout.tsx +17 -0
  38. package/template/src/app/api/[[...route]]/route.ts +11 -0
  39. package/template/src/app/api/debug-files/route.ts +33 -0
  40. package/template/src/app/api/webhooks/clerk/route.ts +112 -0
  41. package/template/src/app/layout.tsx +28 -0
  42. package/template/src/app/page.tsx +12 -0
  43. package/template/src/app/providers.tsx +20 -0
  44. package/template/src/components/layouts/navbar.tsx +14 -0
  45. package/template/src/components/shared/loading-spinner.tsx +6 -0
  46. package/template/src/components/ui/badge.tsx +46 -0
  47. package/template/src/components/ui/button.tsx +62 -0
  48. package/template/src/components/ui/card.tsx +92 -0
  49. package/template/src/components/ui/collapsible.tsx +33 -0
  50. package/template/src/components/ui/scroll-area.tsx +58 -0
  51. package/template/src/components/ui/sheet.tsx +139 -0
  52. package/template/src/config/__tests__/env.test.ts +164 -0
  53. package/template/src/config/__tests__/site.test.ts +46 -0
  54. package/template/src/config/env.ts +36 -0
  55. package/template/src/config/site.ts +10 -0
  56. package/template/src/env.js +44 -0
  57. package/template/src/features/__tests__/health-check-config.test.ts +142 -0
  58. package/template/src/features/__tests__/health-check-types.test.ts +201 -0
  59. package/template/src/features/documentation/components/doc-sidebar.tsx +109 -0
  60. package/template/src/features/documentation/components/doc-viewer.tsx +70 -0
  61. package/template/src/features/documentation/index.tsx +92 -0
  62. package/template/src/features/documentation/utils/doc-loader.ts +177 -0
  63. package/template/src/features/health-check/components/health-dashboard.tsx +374 -0
  64. package/template/src/features/health-check/config.ts +71 -0
  65. package/template/src/features/health-check/index.ts +4 -0
  66. package/template/src/features/health-check/stores/health-store.ts +14 -0
  67. package/template/src/features/health-check/types.ts +18 -0
  68. package/template/src/hooks/__tests__/use-debounce.test.tsx +28 -0
  69. package/template/src/hooks/queries/use-health-checks.ts +16 -0
  70. package/template/src/hooks/utils/use-debounce.ts +20 -0
  71. package/template/src/lib/__tests__/utils.test.ts +52 -0
  72. package/template/src/lib/__tests__/validators.test.ts +114 -0
  73. package/template/src/lib/nextbank/client.ts +67 -0
  74. package/template/src/lib/snowflake/client.ts +102 -0
  75. package/template/src/lib/supabase/admin.ts +7 -0
  76. package/template/src/lib/supabase/client.ts +7 -0
  77. package/template/src/lib/supabase/server.ts +23 -0
  78. package/template/src/lib/utils.ts +6 -0
  79. package/template/src/lib/validators.ts +9 -0
  80. package/template/src/middleware.ts +22 -0
  81. package/template/src/server/api/index.ts +22 -0
  82. package/template/src/server/api/middleware/auth.ts +19 -0
  83. package/template/src/server/api/middleware/logger.ts +4 -0
  84. package/template/src/server/api/routes/health/clerk.ts +214 -0
  85. package/template/src/server/api/routes/health/database.ts +141 -0
  86. package/template/src/server/api/routes/health/edge-functions.ts +107 -0
  87. package/template/src/server/api/routes/health/framework.ts +48 -0
  88. package/template/src/server/api/routes/health/index.ts +102 -0
  89. package/template/src/server/api/routes/health/nextbank.ts +46 -0
  90. package/template/src/server/api/routes/health/snowflake.ts +83 -0
  91. package/template/src/server/api/routes/health/storage.ts +177 -0
  92. package/template/src/server/api/routes/users.ts +79 -0
  93. package/template/src/server/db/index.ts +17 -0
  94. package/template/src/server/db/queries/users.ts +8 -0
  95. package/template/src/server/db/schema/__tests__/health-checks.test.ts +31 -0
  96. package/template/src/server/db/schema/__tests__/users.test.ts +46 -0
  97. package/template/src/server/db/schema/health-checks.ts +11 -0
  98. package/template/src/server/db/schema/index.ts +2 -0
  99. package/template/src/server/db/schema/users.ts +16 -0
  100. package/template/src/server/db/schema.ts +1 -0
  101. package/template/src/stores/__tests__/ui-store.test.ts +87 -0
  102. package/template/src/stores/ui-store.ts +14 -0
  103. package/template/src/styles/globals.css +129 -0
  104. package/template/src/test/mocks/clerk.ts +35 -0
  105. package/template/src/test/mocks/snowflake.ts +28 -0
  106. package/template/src/test/mocks/supabase.ts +37 -0
  107. package/template/src/test/setup.ts +69 -0
  108. package/template/src/test/utils/test-helpers.ts +158 -0
  109. package/template/src/types/index.ts +14 -0
  110. package/template/tsconfig.json +43 -0
  111. package/template/vitest.config.ts +44 -0
@@ -0,0 +1,526 @@
1
+ # DTT Framework - What Did I Miss
2
+
3
+ ## Overview
4
+
5
+ This document outlines potential improvements, features not included, and considerations for production use. While the DTT Framework provides a solid foundation, there are always areas for enhancement.
6
+
7
+ ---
8
+
9
+ ## Potential Improvements
10
+
11
+ ### 1. Testing Infrastructure
12
+
13
+ **Current State:**
14
+ - No test suite included
15
+ - No CI/CD configuration
16
+ - No test coverage reporting
17
+
18
+ **Recommended Improvements:**
19
+
20
+ - **Unit Tests**: Add Vitest for unit testing
21
+ - **Component Tests**: Add React Testing Library for components
22
+ - **E2E Tests**: Add Playwright for end-to-end testing
23
+ - **CI/CD**: Add GitHub Actions for automated testing and deployment
24
+ - **Coverage**: Add coverage reporting with `vitest --coverage`
25
+
26
+ **Priority:** High - Testing is essential for maintainability
27
+
28
+ ### 2. Error Handling
29
+
30
+ **Current State:**
31
+ - Basic try-catch in API routes
32
+ - No global error handler
33
+ - No error logging service
34
+
35
+ **Recommended Improvements:**
36
+
37
+ - **Global Error Handler**: Add centralized error handling in Hono
38
+ - **Error Logging**: Integrate Sentry or similar service
39
+ - **Error Boundaries**: Add React Error Boundaries for client-side errors
40
+ - **Custom Error Pages**: Add 404, 500, and other error pages
41
+ - **Error Types**: Define custom error types for better error handling
42
+
43
+ **Priority:** High - Error handling is critical for production
44
+
45
+ ### 3. Performance Monitoring
46
+
47
+ **Current State:**
48
+ - Response time tracking in health checks
49
+ - No performance monitoring
50
+ - No analytics
51
+
52
+ **Recommended Improvements:**
53
+
54
+ - **Vercel Analytics**: Add Vercel Analytics for performance monitoring
55
+ - **Web Vitals**: Add web-vitals library for Core Web Vitals
56
+ - **APM**: Add Application Performance Monitoring (e.g., Datadog, New Relic)
57
+ - **Performance Budgets**: Define and enforce performance budgets
58
+ - **Bundle Analysis**: Add bundle analyzer to monitor bundle size
59
+
60
+ **Priority:** Medium - Important for production monitoring
61
+
62
+ ### 4. Internationalization (i18n)
63
+
64
+ **Current State:**
65
+ - No i18n support
66
+ - Hardcoded English text
67
+
68
+ **Recommended Improvements:**
69
+
70
+ - **next-intl**: Add next-intl for internationalization
71
+ - **Language Detection**: Auto-detect user's preferred language
72
+ - **Translation Files**: Add translation files for supported languages
73
+ - **RTL Support**: Add right-to-left language support
74
+
75
+ **Priority:** Low - Only needed if supporting multiple languages
76
+
77
+ ### 5. Accessibility (a11y)
78
+
79
+ **Current State:**
80
+ - Shadcn/ui components are accessible
81
+ - No comprehensive a11y testing
82
+ - No a11y audit
83
+
84
+ **Recommended Improvements:**
85
+
86
+ - **axe-core**: Add axe-core for accessibility testing
87
+ - **Playwright a11y**: Add Playwright accessibility testing
88
+ - **ARIA Labels**: Ensure all interactive elements have ARIA labels
89
+ - **Keyboard Navigation**: Ensure full keyboard navigation support
90
+ - **Screen Reader Testing**: Test with screen readers
91
+
92
+ **Priority:** Medium - Accessibility is important for inclusive design
93
+
94
+ ### 6. SEO Optimization
95
+
96
+ **Current State:**
97
+ - Basic meta tags
98
+ - No structured data
99
+ - No sitemap
100
+
101
+ **Recommended Improvements:**
102
+
103
+ - **Metadata API**: Use Next.js Metadata API for better SEO
104
+ - **Structured Data**: Add JSON-LD for structured data
105
+ - **Sitemap**: Generate sitemap.xml
106
+ - **Robots.txt**: Add robots.txt
107
+ - **Open Graph**: Add Open Graph tags for social sharing
108
+
109
+ **Priority:** Low - Only needed for public-facing applications
110
+
111
+ ### 7. Security Enhancements
112
+
113
+ **Current State:**
114
+ - Basic auth middleware
115
+ - Environment variables for secrets
116
+ - No rate limiting
117
+ - No CSRF protection
118
+
119
+ **Recommended Improvements:**
120
+
121
+ - **Rate Limiting**: Add rate limiting to API routes
122
+ - **CSRF Protection**: Add CSRF tokens for form submissions
123
+ - **CSP Headers**: Add Content Security Policy headers
124
+ - **Security Headers**: Add security-related headers (HSTS, X-Frame-Options, etc.)
125
+ - **Dependency Scanning**: Add automated dependency scanning
126
+
127
+ **Priority:** High - Security is critical for production
128
+
129
+ ---
130
+
131
+ ## Features Not Included
132
+
133
+ ### 1. Real-time Features
134
+
135
+ **Not Included:**
136
+ - Real-time database subscriptions
137
+ - WebSocket connections
138
+ - Live updates
139
+
140
+ **Potential Implementation:**
141
+ - Use Supabase Realtime for real-time database subscriptions
142
+ - Add WebSocket support for live updates
143
+ - Implement server-sent events for push notifications
144
+
145
+ ### 2. File Processing
146
+
147
+ **Not Included:**
148
+ - Image processing
149
+ - Video transcoding
150
+ - Document conversion
151
+
152
+ **Potential Implementation:**
153
+ - Add Sharp for image processing
154
+ - Add FFmpeg for video transcoding
155
+ - Add file conversion utilities
156
+
157
+ ### 3. Email Service
158
+
159
+ **Not Included:**
160
+ - Email sending
161
+ - Email templates
162
+ - Email notifications
163
+
164
+ **Potential Implementation:**
165
+ - Add Resend or SendGrid for email sending
166
+ - Add email templates with React Email
167
+ - Add email notification system
168
+
169
+ ### 4. Background Jobs
170
+
171
+ **Not Included:**
172
+ - Job queue
173
+ - Scheduled tasks
174
+ - Background processing
175
+
176
+ **Potential Implementation:**
177
+ - Add BullMQ for job queuing
178
+ - Add cron jobs for scheduled tasks
179
+ - Implement background job processing
180
+
181
+ ### 5. Caching Layer
182
+
183
+ **Not Included:**
184
+ - Redis caching
185
+ - CDN caching
186
+ - API response caching
187
+
188
+ **Potential Implementation:**
189
+ - Add Redis for caching
190
+ - Configure CDN for static assets
191
+ - Implement API response caching
192
+
193
+ ### 6. Advanced Authentication Features
194
+
195
+ **Not Included:**
196
+ - Multi-factor authentication (MFA)
197
+ - Social login providers
198
+ - Passwordless authentication
199
+
200
+ **Potential Implementation:**
201
+ - Enable Clerk MFA
202
+ - Add social login providers (Google, GitHub, etc.)
203
+ - Implement magic link authentication
204
+
205
+ ### 7. Admin Panel
206
+
207
+ **Not Included:**
208
+ - Admin dashboard
209
+ - User management
210
+ - System configuration
211
+
212
+ **Potential Implementation:**
213
+ - Build admin panel for user management
214
+ - Add system configuration interface
215
+ - Implement admin analytics
216
+
217
+ ### 8. Analytics Dashboard
218
+
219
+ **Not Included:**
220
+ - User analytics
221
+ - Usage metrics
222
+ - Custom dashboards
223
+
224
+ **Potential Implementation:**
225
+ - Add analytics tracking
226
+ - Build custom dashboards
227
+ - Implement usage metrics
228
+
229
+ ---
230
+
231
+ ## Future Enhancements
232
+
233
+ ### 1. Mobile App Support
234
+
235
+ **Potential:**
236
+ - Add React Native or Expo for mobile app
237
+ - Share API between web and mobile
238
+ - Implement authentication for mobile
239
+
240
+ ### 2. Progressive Web App (PWA)
241
+
242
+ **Potential:**
243
+ - Add PWA support with next-pwa
244
+ - Add offline support
245
+ - Add push notifications
246
+
247
+ ### 3. GraphQL Support
248
+
249
+ **Potential:**
250
+ - Add GraphQL API alongside REST
251
+ - Use Apollo Server or Yoga
252
+ - Implement GraphQL subscriptions
253
+
254
+ ### 4. Microservices Architecture
255
+
256
+ **Potential:**
257
+ - Split into microservices
258
+ - Use service mesh
259
+ - Implement service discovery
260
+
261
+ ### 5. Event-Driven Architecture
262
+
263
+ **Potential:**
264
+ - Add event bus (e.g., Kafka, RabbitMQ)
265
+ - Implement event sourcing
266
+ - Add CQRS pattern
267
+
268
+ ---
269
+
270
+ ## Production Considerations
271
+
272
+ ### 1. Database Scaling
273
+
274
+ **Considerations:**
275
+ - **Connection Pooling**: Ensure proper connection pooling configuration
276
+ - **Read Replicas**: Use read replicas for read-heavy workloads
277
+ - **Database Sharding**: Consider sharding for very large datasets
278
+ - **Backup Strategy**: Implement automated backups
279
+ - **Monitoring**: Monitor database performance
280
+
281
+ ### 2. API Rate Limiting
282
+
283
+ **Considerations:**
284
+ - **Per-User Limits**: Implement per-user rate limits
285
+ - **Per-IP Limits**: Implement per-IP rate limits
286
+ - **Burst Handling**: Handle burst traffic gracefully
287
+ - **Rate Limit Headers**: Include rate limit headers in responses
288
+
289
+ ### 3. CDN Configuration
290
+
291
+ **Considerations:**
292
+ - **Static Assets**: Serve static assets from CDN
293
+ - **API Caching**: Cache API responses at CDN level
294
+ - **Edge Computing**: Use edge computing for faster responses
295
+ - **Cache Invalidation**: Implement cache invalidation strategy
296
+
297
+ ### 4. Monitoring and Alerting
298
+
299
+ **Considerations:**
300
+ - **Uptime Monitoring**: Use uptime monitoring services
301
+ - **Error Tracking**: Use error tracking services (Sentry, Rollbar)
302
+ - **Performance Monitoring**: Use APM tools (Datadog, New Relic)
303
+ - **Alerting**: Set up alerts for critical issues
304
+ - **Dashboards**: Create monitoring dashboards
305
+
306
+ ### 5. Deployment Strategy
307
+
308
+ **Considerations:**
309
+ - **Blue-Green Deployment**: Use blue-green deployment for zero downtime
310
+ - **Canary Releases**: Use canary releases for gradual rollout
311
+ - **Rollback Strategy**: Implement quick rollback strategy
312
+ - **Environment Promotion**: Use proper environment promotion (dev → staging → prod)
313
+
314
+ ### 6. Security Hardening
315
+
316
+ **Considerations:**
317
+ - **Security Audit**: Conduct regular security audits
318
+ - **Penetration Testing**: Perform penetration testing
319
+ - **Dependency Updates**: Keep dependencies up to date
320
+ - **Security Headers**: Implement all recommended security headers
321
+ - **Input Validation**: Validate all user inputs
322
+
323
+ ### 7. Disaster Recovery
324
+
325
+ **Considerations:**
326
+ - **Backup Strategy**: Implement automated backups
327
+ - **Disaster Recovery Plan**: Create disaster recovery plan
328
+ - **Failover Strategy**: Implement failover strategy
329
+ - **Data Replication**: Replicate data across regions
330
+ - **Testing**: Regularly test disaster recovery procedures
331
+
332
+ ---
333
+
334
+ ## Known Limitations
335
+
336
+ ### 1. Single Database
337
+
338
+ **Limitation:**
339
+ - Only supports PostgreSQL via Supabase
340
+ - No support for other databases
341
+
342
+ **Workaround:**
343
+ - Use database abstraction layer for multi-database support
344
+ - Use database-agnostic ORM (e.g., Prisma)
345
+
346
+ ### 2. Single Auth Provider
347
+
348
+ **Limitation:**
349
+ - Only supports Clerk for authentication
350
+ - No support for other auth providers
351
+
352
+ **Workaround:**
353
+ - Use auth abstraction layer for multi-provider support
354
+ - Implement custom auth with NextAuth.js
355
+
356
+ ### 3. No Multi-Tenancy
357
+
358
+ **Limitation:**
359
+ - Organization support is basic
360
+ - No advanced multi-tenancy features
361
+
362
+ **Workaround:**
363
+ - Implement advanced multi-tenancy with row-level security
364
+ - Use tenant-aware queries
365
+
366
+ ### 4. Limited Real-time
367
+
368
+ **Limitation:**
369
+ - No real-time features implemented
370
+ - Supabase Realtime not configured
371
+
372
+ **Workaround:**
373
+ - Implement real-time with Supabase Realtime
374
+ - Use WebSocket for custom real-time features
375
+
376
+ ---
377
+
378
+ ## Lessons Learned
379
+
380
+ ### 1. Service Integration Complexity
381
+
382
+ **Observation:**
383
+ Integrating multiple third-party services (Clerk, Supabase, Snowflake) requires careful coordination of authentication, configuration, and error handling.
384
+
385
+ **Takeaways:**
386
+ - Each service has its own authentication mechanism and SDK quirks
387
+ - Environment variable management becomes critical as the number of services grows
388
+ - Health checks are essential for debugging integration issues
389
+ - Documentation for each service varies in quality and completeness
390
+
391
+ **Recommendation:**
392
+ Start with a single service and add others incrementally. Build health checks early in the integration process.
393
+
394
+ ### 2. Type Safety Trade-offs
395
+
396
+ **Observation:**
397
+ While TypeScript provides excellent type safety, maintaining type consistency across service boundaries can be challenging.
398
+
399
+ **Takeaways:**
400
+ - Zod schemas are invaluable for runtime validation
401
+ - Type inference from ORMs (Drizzle) saves time but requires careful schema design
402
+ - Environment variable validation prevents runtime errors
403
+ - Generated types from SDKs can sometimes be overly complex
404
+
405
+ **Recommendation:**
406
+ Invest time in creating shared type definitions and validation schemas early in the project.
407
+
408
+ ### 3. State Management Decisions
409
+
410
+ **Observation:**
411
+ Choosing between server state (TanStack Query) and client state (Zustand) requires understanding the data lifecycle.
412
+
413
+ **Takeaways:**
414
+ - Server state should be cached and synchronized with the backend
415
+ - Client state should be limited to UI-specific concerns
416
+ - Mixing concerns leads to complex bugs and hard-to-debug issues
417
+ - TanStack Query's caching and invalidation strategies are powerful but require learning
418
+
419
+ **Recommendation:**
420
+ Clearly separate server state from client state in your architecture. Use TanStack Query for all data fetched from APIs and Zustand for UI state only.
421
+
422
+ ### 4. Database Connection Management
423
+
424
+ **Observation:**
425
+ Connection pooling configuration significantly impacts performance, especially with serverless functions.
426
+
427
+ **Takeaways:**
428
+ - Supabase Transaction mode requires specific connection string format
429
+ - Connection leaks can occur if connections aren't properly closed
430
+ - Serverless environments need connection pooling for performance
431
+ - Drizzle's `prepare: false` option is required for Supabase pooling
432
+
433
+ **Recommendation:**
434
+ Always use connection pooling in production. Test connection behavior under load to identify issues early.
435
+
436
+ ### 5. Health Check Design
437
+
438
+ **Observation:**
439
+ A well-designed health check system is invaluable for debugging and monitoring, but requires thoughtful design.
440
+
441
+ **Takeaways:**
442
+ - Health checks should be fast and non-destructive
443
+ - Response time tracking provides valuable performance insights
444
+ - Status types (healthy, unhealthy, error, unconfigured) help distinguish issues
445
+ - Aggregated health checks simplify monitoring
446
+
447
+ **Recommendation:**
448
+ Design health checks to be idempotent and fast. Include detailed error messages for debugging but keep the UI simple.
449
+
450
+ ### 6. API Layer Architecture
451
+
452
+ **Observation:**
453
+ Using Hono for the API layer provides a lightweight, type-safe alternative to Next.js API routes.
454
+
455
+ **Takeaways:**
456
+ - Hono's middleware system is elegant and composable
457
+ - Type inference works well with TypeScript
458
+ - Mounting Hono in Next.js requires careful configuration
459
+ - Hono's performance is excellent for API endpoints
460
+
461
+ **Recommendation:**
462
+ Consider Hono for API-heavy applications. Its lightweight nature and excellent TypeScript support make it a great choice.
463
+
464
+ ### 7. Testing Strategy
465
+
466
+ **Observation:**
467
+ Testing is often neglected in boilerplate projects but is critical for long-term maintainability.
468
+
469
+ **Takeaways:**
470
+ - Unit tests are essential for business logic
471
+ - Integration tests are valuable for service integrations
472
+ - E2E tests catch issues that unit tests miss
473
+ - Test coverage should be tracked and improved over time
474
+
475
+ **Recommendation:**
476
+ Set up testing infrastructure early. Write tests alongside features, not as an afterthought.
477
+
478
+ ### 8. Documentation Importance
479
+
480
+ **Observation:**
481
+ Good documentation is as important as good code, especially for framework projects.
482
+
483
+ **Takeaways:**
484
+ - Documentation should explain "why" not just "how"
485
+ - Examples should be copy-pasteable and work out of the box
486
+ - Troubleshooting sections save hours of debugging
487
+ - Architecture diagrams help with mental models
488
+
489
+ **Recommendation:**
490
+ Document as you build. Keep documentation up to date with code changes.
491
+
492
+ ### 9. Environment Variable Management
493
+
494
+ **Observation:**
495
+ As the number of services grows, environment variable management becomes complex.
496
+
497
+ **Takeaways:**
498
+ - Validation at build time catches configuration errors early
499
+ - Grouping related variables improves readability
500
+ - Comments explaining each variable are essential
501
+ - Separate .env files for different environments help prevent mistakes
502
+
503
+ **Recommendation:**
504
+ Use a validation library like `@t3-oss/env-nextjs` for type-safe environment variables.
505
+
506
+ ### 10. Performance Considerations
507
+
508
+ **Observation:**
509
+ Performance optimization should be considered from the start, not as an afterthought.
510
+
511
+ **Takeaways:**
512
+ - Bundle size impacts initial load time
513
+ - Database query performance affects API response times
514
+ - Caching strategies can dramatically improve perceived performance
515
+ - Monitoring is necessary to identify performance bottlenecks
516
+
517
+ **Recommendation:**
518
+ Set up performance monitoring early. Optimize critical paths first.
519
+
520
+ ---
521
+
522
+ ## Related Documentation
523
+
524
+ - [Overview](./01-overview.md) - Framework introduction
525
+ - [Implementation](./implementation.md) - How framework was built
526
+ - [Testing Guide](./testing-guide.md) - Testing patterns
@@ -0,0 +1,11 @@
1
+ import { type Config } from "drizzle-kit";
2
+
3
+ import { env } from "~/env";
4
+
5
+ export default {
6
+ schema: "./src/server/db/schema.ts",
7
+ dialect: "postgresql",
8
+ dbCredentials: {
9
+ url: env.DATABASE_URL,
10
+ },
11
+ } satisfies Config;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
3
+ * for Docker builds.
4
+ */
5
+ import "./src/env.js";
6
+
7
+ /** @type {import("next").NextConfig} */
8
+ const config = {
9
+ serverExternalPackages: ["snowflake-sdk"],
10
+ eslint: {
11
+ ignoreDuringBuilds: true,
12
+ },
13
+ outputFileTracingIncludes: {
14
+ "/": ["./docs/**/*", "./README.md", "./DESIGN.md", "./cli/template/README.md"],
15
+ "/*": ["./docs/**/*", "./README.md", "./DESIGN.md", "./cli/template/README.md"],
16
+ },
17
+ experimental: {
18
+ },
19
+ };
20
+
21
+ export default config;
@@ -0,0 +1,5 @@
1
+ export default {
2
+ plugins: {
3
+ "@tailwindcss/postcss": {},
4
+ },
5
+ };
@@ -0,0 +1,4 @@
1
+ /** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
2
+ export default {
3
+ plugins: ["prettier-plugin-tailwindcss"],
4
+ };
Binary file
@@ -0,0 +1,4 @@
1
+ // Auth layout placeholder
2
+ export default function AuthLayout({ children }: { children: React.ReactNode }) {
3
+ return <div>{children}</div>
4
+ }
@@ -0,0 +1,10 @@
1
+ // Clerk Sign In page placeholder
2
+ import { SignIn } from '@clerk/nextjs'
3
+
4
+ export default function SignInPage() {
5
+ return (
6
+ <div className="flex min-h-screen items-center justify-center">
7
+ <SignIn />
8
+ </div>
9
+ )
10
+ }
@@ -0,0 +1,10 @@
1
+ // Clerk Sign Up page placeholder
2
+ import { SignUp } from '@clerk/nextjs'
3
+
4
+ export default function SignUpPage() {
5
+ return (
6
+ <div className="flex min-h-screen items-center justify-center">
7
+ <SignUp />
8
+ </div>
9
+ )
10
+ }
@@ -0,0 +1,8 @@
1
+ // Dashboard index page placeholder
2
+ export default function DashboardPage() {
3
+ return (
4
+ <div className="container py-8">
5
+ <h1 className="text-2xl font-semibold">Dashboard</h1>
6
+ </div>
7
+ )
8
+ }
@@ -0,0 +1,16 @@
1
+ // Health check dashboard page placeholder
2
+ import { HealthDashboard } from '@/features/health-check'
3
+
4
+ export default function HealthPage() {
5
+ return (
6
+ <div className="container mx-auto py-8">
7
+ <div className="mb-8">
8
+ <h1 className="text-2xl font-semibold">Health Check Dashboard</h1>
9
+ <p className="text-muted-foreground">
10
+ Verify all services are connected and working correctly.
11
+ </p>
12
+ </div>
13
+ <HealthDashboard />
14
+ </div>
15
+ )
16
+ }
@@ -0,0 +1,17 @@
1
+ // Dashboard layout placeholder
2
+ import { UserButton } from '@clerk/nextjs'
3
+ import Link from 'next/link'
4
+
5
+ export default function DashboardLayout({ children }: { children: React.ReactNode }) {
6
+ return (
7
+ <div className="min-h-screen bg-background">
8
+ <header className="border-b">
9
+ <div className="container mx-auto flex h-14 items-center justify-between">
10
+ <Link href="/" className="font-semibold">DTT Framework</Link>
11
+ <UserButton afterSignOutUrl="/sign-in" />
12
+ </div>
13
+ </header>
14
+ <main>{children}</main>
15
+ </div>
16
+ )
17
+ }
@@ -0,0 +1,11 @@
1
+ // Hono catch-all route placeholder
2
+ import { handle } from 'hono/vercel'
3
+ import { app } from '@/server/api'
4
+
5
+ export const runtime = 'nodejs'
6
+
7
+ export const GET = handle(app)
8
+ export const POST = handle(app)
9
+ export const PUT = handle(app)
10
+ export const DELETE = handle(app)
11
+ export const PATCH = handle(app)
@@ -0,0 +1,33 @@
1
+ import { NextResponse } from 'next/server';
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+
5
+ export async function GET() {
6
+ const root = process.cwd();
7
+ const files: any = {
8
+ root,
9
+ rootFiles: [],
10
+ docsFiles: [],
11
+ docsExists: false,
12
+ };
13
+
14
+ try {
15
+ files.rootFiles = await fs.promises.readdir(root);
16
+ } catch (e: any) {
17
+ files.rootError = e.message;
18
+ }
19
+
20
+ try {
21
+ const docsPath = path.join(root, 'docs');
22
+ files.docsPath = docsPath;
23
+ files.docsExists = fs.existsSync(docsPath);
24
+ if (files.docsExists) {
25
+ files.docsFiles = await fs.promises.readdir(docsPath);
26
+ }
27
+ } catch (e: any) {
28
+ files.docsError = e.message;
29
+ }
30
+
31
+ return NextResponse.json(files);
32
+ }
33
+